Skip to content

Instantly share code, notes, and snippets.

@kylefritz
Last active December 30, 2015 04:29
Show Gist options
  • Save kylefritz/7776152 to your computer and use it in GitHub Desktop.
Save kylefritz/7776152 to your computer and use it in GitHub Desktop.
Boiler Room Baltimore Video Overlay
<style type="text/css">
img, video{
position: absolute;
width: 100%;
}
img{
z-index: 100;
width: 70%;
margin: 0 15%;
}
</style>
<img src="logo-white.png">
<video autoplay></video>
<script>
var errorCallback = function(e) {
console.log('Reeeejected!', e);
};
// Not showing vendor prefixes.
navigator.webkitGetUserMedia({video: true, audio: true}, function(localMediaStream) {
var video = document.querySelector('video');
video.src = window.URL.createObjectURL(localMediaStream);
// Note: onloadedmetadata doesn't fire in Chrome when using it with getUserMedia.
// See crbug.com/110938.
video.onloadedmetadata = function(e) {
// Ready to go. Do some stuff.
};
}, errorCallback);
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment