Created
August 13, 2015 07:42
-
-
Save ToshihiroGoto/ce4f3d591df143fa8d31 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
var initializeVideoStream = function(stream) { | |
var video = document.getElementById('videoTag'); | |
if (typeof (video.srcObject) !== 'undefined') { | |
video.srcObject = stream; | |
} | |
else { | |
video.src = URL.createObjectURL(stream); | |
} | |
// 止まっている場合は強制的に再生 | |
if (video.paused) video.play(); | |
}; | |
navigator.getUserMedia({ video: true }, initializeVideoStream, getUserMediaError); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment