-
-
Save anonymous/0d9ad88e1d1193254dab to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
navigator.getMedia = ( navigator.getUserMedia || | |
navigator.webkitGetUserMedia || | |
navigator.mozGetUserMedia || | |
navigator.msGetUserMedia); | |
function mycallbackExpectedFailure(err) { | |
console.log(err); | |
} | |
navigator.getMedia ( | |
// constraints | |
{ | |
video: true, | |
audio: true | |
}, | |
// successCallback | |
function(localMediaStream) { | |
var video = document.querySelector('video'); | |
video.src = window.URL.createObjectURL(localMediaStream); | |
video.onloadedmetadata = function(e) { | |
// Do something with the video here. | |
}; | |
}, mycallbackExpectedFailure | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment