Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
HTML5 Video->Canvas
var v = document.getElementsByTagName('video')[0];
var c = document.createElement('canvas');
var ctx = c.getContext('2d');
c.width = v.videoWidth;
c.height = v.videoHeight;
var clock = setInterval(function () {ctx.drawImage(v, 0, 0);}, 0);
document.body.appendChild(c);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.