Skip to content

Instantly share code, notes, and snippets.

@tonyjcamp
Created March 10, 2012 06:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tonyjcamp/2010552 to your computer and use it in GitHub Desktop.
Save tonyjcamp/2010552 to your computer and use it in GitHub Desktop.
getUserMedia example DOM
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=0.5">
<title>Oh hai.</title>
</head>
<body>
<video id="video" width="640" height="480" autoplay>
<!-- Here you can set some default video up if the camera API no worky -->
<source src="default.webm" type="video/webm;" codecs="vp8, vorbis">
<source src="default.mp4" type="video/mp4;" codecs="avc1.42E01E, mp4a.40.2">
</video>
<button id="take">Take Picture</button>
<!-- NEEDS THE DAMN WIDTH AND HEIGHT SET ON THE ELEMENT IF YOU NO HAS, PICTURE LUK FUNY-->
<!-- SCALES IMPROPERLY WITHOUT WIDTH AND HEIGHT ON ELEMENT. CSS NO HELPY -->
<canvas id="snapshot" width="640" height="480"></canvas>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment