-
Notifications
You must be signed in to change notification settings - Fork 406
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Correct package for npm #78
Comments
https://github.com/aceslowman/ccapture.js/tree/npm-fix By adding the appropriate requires and exports, I've managed to get PNG and JPG output in NPM, but still struggling to get gif.js to play well. The main issue is in pointing it to the correct file for the Does anyone have an idea of how that could be accomplished? Getting the correct gif.worker.js file included in gif.js? |
gif.js accepts So I see three possiblities:
|
I have it working with npm here: https://github.com/aceslowman/ccapture.js/tree/npm-fix I have a working npm fix up on my forked repo. I haven't been able to get it working again for the non-npm build (nor have I tested webm...), so I haven't submitted a pull request. The main thing was that CCapture.js isn't requiring tar.js, download.js, or gif.js, and those individual files in turn don't have the export set up. |
@aceslowman Cool. I'd be curious to try your fix in my project - Do you know if there's a way to import your version directly into my react.js project? |
Yeah! You can just call |
CCapture.[min].js doesn't require or import scripts, it assumes they're loaded as regular scripts. This library is not designed to be used as a module, that's the point of this issue. That being said, I have no idea why webpack can't find BlobBuffer or ArrayBufferDataStream. |
Actually, it's because of this https://github.com/thenickdude/webm-writer-js/blob/master/src/WebMWriter.js#L659 So may be a solution is not using CCapture.all.min.js, and instead load each individual file, and import https://www.npmjs.com/package/webm-writer |
I tried this:
But as soon as I finish a recording it says: |
I've posted a bounty for getting CCapture fully working as an NPM package: https://www.bountysource.com/issues/56644632-correct-package-for-npm |
Hi all, the issue is require and use CCapture as NPM package, but not to be working in a node enviroment ( out of the browser ) , right ? Some dependences has their own NPM package, do you want to remove the files and keep the references or save your own copy? Is prefered a conditional usage of module.exports or explicit ( using webpack or similar to prebuild the files ) ? |
@kingpalethe, I sent a PR #89 and waiting for feedback :) |
when irun my app i get the following error here is test,js `(function() { var framesPerSecond = 60; var canvas = document.getElementById("c"); var progressElem = document.getElementById("progress"); function onProgress(progress) { function showVideoLink(url, size) { var capturer = new CCapture( { function drawLines(ctx) { function render(time) {
} ` |
Sorry I miss a important point, I was working on Windows and i don't build the standalone file. So if you are using a node enviroment you need to change the |
In the last commit, I included the builded files, should be all good now. |
Still some one in this issue ?? If there are some bug or you want a full rework as NPM package ( merging modules as dependencies and replacing the build script ) just let me know. |
Seems like the author of the package is not active anymore? :( |
any update on this? |
I still waiting feedback from @spite with no luck. |
any updates? |
any update on this? |
any updates? gonna start an annual tradition here |
In the repo there is a file called "download.js" in /src . Downloaded ccapture.js , download.js , webm-writer-0.2.0.js and linked them in the html file. That fixed the error and i was able to download the recording with the .save() function. On Chrome. |
I made some additional changes to the npm-fix branch in my own fork and was able to get it to work (tested in the browser, not node): amandaghassaei@7ada419 I wrote a small wrapper around ccapture to make it easier to bind to hotkeys and take care of any extra weirdness around importing with npm: you can import into your project with |
Hi Amanda, I was trying to follow your examples for installing 'canvas-capture' but I seem to be running into the NPM issue you mentioned. I received an error message when trying to install with npm prompting me to a log file.
Does the above help identify something that is wrong on my side? |
Attempting other install ideas. I received a console message giving me a hint that I could install from a folder. So I downloaded a copy of your code and then typed npm install followed by the path to the downloaded folder. that worked. Probably not the best way to do this but it worked. Probably I could have just copied the folder to my projects node folder and then just updated my package.json file |
@robertmassman I just put the package on npm, try: |
This worked for me, thank you. Getting a different error now that CCapture is not a constructor, but at least making progress |
how should I fix it or make it work? |
Just leaving an update about using WebMWriter and the @aceslowman version of CCapture:
It worked great. Thanks! |
Open for the taking! Someone that uses npm and wants to fix the package to work correctly.
The text was updated successfully, but these errors were encountered: