Skip to content

Instantly share code, notes, and snippets.

@evitolins
Created June 23, 2015 05:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save evitolins/8c107569e7257bd5d541 to your computer and use it in GitHub Desktop.
Save evitolins/8c107569e7257bd5d541 to your computer and use it in GitHub Desktop.
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