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

I can't figure out how to setup the script on my site #57

Closed
amansinghchauhan opened this issue Aug 8, 2017 · 2 comments
Closed

I can't figure out how to setup the script on my site #57

amansinghchauhan opened this issue Aug 8, 2017 · 2 comments

Comments

@amansinghchauhan
Copy link

amansinghchauhan commented Aug 8, 2017

I created a new JS file with the following content:

$("#startRecording").click(function(event){
        capturer.start();

        render();

        capturer.stop();

        capturer.save();

    });


var capturer = new CCapture( {
    format: 'webm',
    name: 'aman',
    framerate: 60,
    verbose: true
} );

var canvas = $(".canvas");

function render(){
            requestAnimationFrame(render);
            animateImage();
            capturer.capture( canvas );
}

When I click on the start button, nothing happens and nothing is added in the console.

I am very sorry if it's a basic question but can you please tell me a workaround for this.

Thanks

@spite
Copy link
Owner

spite commented Aug 8, 2017

If i'm not mistaken, canvas is a jQuery object, and more probably an array of jQuery objects, since you're using a selector that matches all elements with class canvas. Try something like var canvas = $(".canvas").get(0), or whatever syntax jQuery uses to return the actual HTMLCanvasElement.

@amansinghchauhan
Copy link
Author

amansinghchauhan commented Aug 9, 2017 via email

@spite spite closed this as completed Feb 13, 2018
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

2 participants