Skip to content

Instantly share code, notes, and snippets.

@k-kinzal
Created August 11, 2012 11:47
Show Gist options
  • Save k-kinzal/3324014 to your computer and use it in GitHub Desktop.
Save k-kinzal/3324014 to your computer and use it in GitHub Desktop.
Use media.js
// get permission
navigator.webkitGetUserMedia({video:true}, function(stream) {
// allow permission
// call capture
capture(stream, function(blob) {
// get blob and blob to image src
//-- Webkit browser is window.webkitURL.createObjectURL
document.querySelector('img').src = window.webkitURL.createObjectURL(blob);
});
}, function(e) {
// permission denied or not connect device
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment