Last active
December 30, 2015 04:29
-
-
Save kylefritz/7776152 to your computer and use it in GitHub Desktop.
Boiler Room Baltimore Video Overlay
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
<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