Created
October 18, 2013 09:26
-
-
Save bramus/7038963 to your computer and use it in GitHub Desktop.
getUserMedia with video element
This file contains hidden or 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
| // @url http://www.html5rocks.com/en/tutorials/getusermedia/intro/ | |
| window.URL = window.URL || window.webkitURL; | |
| navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia; | |
| if (navigator.getUserMedia) { | |
| navigator.getUserMedia({audio: true, video: true}, function(stream) { | |
| document.querySelector('video').src = window.URL.createObjectURL(stream); | |
| }, function(e) { | |
| console.log(e); | |
| }); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment