Last active
January 4, 2017 16:00
-
-
Save shockwaves/68b240238eeff68205ddfa5ef9264f51 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<style> | |
html, body, video { | |
width: 100%; | |
height: 100%; | |
margin: 0; | |
padding: 0; | |
} | |
</style> | |
</head> | |
<body> | |
<video autoplay="true" id="video"></video> | |
<script> | |
var video = document.querySelector("#video"); | |
navigator.getUserMedia = navigator.getUserMedia | |
|| navigator.webkitGetUserMedia | |
|| navigator.mozGetUserMedia | |
|| navigator.msGetUserMedia | |
|| navigator.oGetUserMedia; | |
if (navigator.getUserMedia) { | |
navigator.getUserMedia({video: true}, function(stream) { | |
video.src = window.URL.createObjectURL(stream); | |
}, function() {}); | |
} | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment