Skip to content

Instantly share code, notes, and snippets.

@segphault
Created January 20, 2012 07:45
Show Gist options
  • Save segphault/1646026 to your computer and use it in GitHub Desktop.
Save segphault/1646026 to your computer and use it in GitHub Desktop.
Live video with getUserMedia
<html>
<head>
<title>HTML5 Webcam Test</title>
</head>
<body>
<h2>The Thing cannot be described&mdash;there is no language for such abysms of shrieking and immemorial lunacy, such eldritch contradictions of all matter, force, and cosmic order</h2>
<video id="live" autoplay></video>
<script type="text/javascript">
video = document.getElementById("live")
navigator.webkitGetUserMedia("video",
function(stream) {
video.src = window.webkitURL.createObjectURL(stream)
},
function(err) {
console.log("Unable to get video stream!")
}
)
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment