Skip to content
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

GIF is not defined() #36

Closed
jrogozen opened this issue Dec 9, 2016 · 4 comments
Closed

GIF is not defined() #36

jrogozen opened this issue Dec 9, 2016 · 4 comments

Comments

@jrogozen
Copy link

jrogozen commented Dec 9, 2016

Hi,

I installed using npm and am creating a new capture like this

var capturer = new CCapture({
                        framerate: 60,
                        format: 'gif',
                        workersPath: './node_modules/ccapture.js/src/',
                        verbose: true
                    });

i get an error that GIF is not defined so i'm assuming that i'm not settings the workersPath correctly. I've also tried / and js/

@spite
Copy link
Owner

spite commented Dec 9, 2016

If you have included CCapturer.all.min.js, or CCapturer.min.js and gif.js, and the workersPath points to where gif.worker.js is, it should work.

@jrogozen
Copy link
Author

jrogozen commented Dec 9, 2016

ah thanks. I added ccapture.all.min.js as a script tag and it worked

@spite spite closed this as completed Dec 18, 2016
@aferriss
Copy link

aferriss commented Mar 7, 2017

Just to chime in here, this isn't really a solved issue in the sense that if you want to use CCapture with npm you have to manually include the script tag before your bundle as @jrogozen indicates.

If you include CCapture as
var CCapture = require('ccapture.js');
and want to use the gif mode, CCapture will start to look for a GIF class but come up empty handed.
To fix this properly, I think you need to rebundle CCapture and define all the extra modules at the top as requires. On top of that it looks like gif.js was never intended to be used as a npm module, so some work would have to be done on that end as well.

@spite
Copy link
Owner

spite commented Mar 27, 2018

Redirected to #78

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants