Created
August 30, 2015 13:53
-
-
Save ikr7/dc8c4d165ae730b55b8b 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> | |
<meta charset="UTF-8"> | |
<title>Broadcaster</title> | |
</head> | |
<body> | |
<video autoplay="autoplay"></video> | |
<canvas></canvas> | |
<script src="./main.js"></script> | |
</body> | |
</html> |
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
'use strict'; | |
navigator.getUserMedia = navigator.webkitGetUserMedia; | |
navigator.getUserMedia({ | |
video: true | |
}, function(stream){ | |
var video = document.querySelector('video'); | |
video.src = URL.createObjectURL(stream); | |
}, function(err){ | |
throw err; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment