Skip to content

Instantly share code, notes, and snippets.

@ssig33
Created September 25, 2012 06:04
Show Gist options
  • Select an option

  • Save ssig33/3780231 to your computer and use it in GitHub Desktop.

Select an option

Save ssig33/3780231 to your computer and use it in GitHub Desktop.
gyazo = function() {
var c, context, url, v;
c = document.querySelector('#canvas');
v = document.querySelector('#play');
context = c.getContext('2d');
c.width = v.videoWidth;
c.height = v.videoHeight;
context.drawImage(v, 0, 0);
data = c.toDataURL();
return $.post('/gyazo', {
data: data,
}).success(function(data) {
return window.open(data.url);
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment