Skip to content

Instantly share code, notes, and snippets.

@sindresorhus
Forked from 140bytes/LICENSE.txt
Created June 4, 2012 12:14
Show Gist options
  • Star 23 You must be signed in to star a gist
  • Fork 6 You must be signed in to fork a gist
  • Save sindresorhus/2867981 to your computer and use it in GitHub Desktop.
Save sindresorhus/2867981 to your computer and use it in GitHub Desktop.
Photo Booth (140byt.es)

Photo Booth (140byt.es)

109 bytes

Currently requires Chrome Canary

Working prefixed version (121 bytes):

Just copy paste into Dev Tools in Chrome Canary and hit enter:

!function f(a){a?document.write('<video src='+webkitURL.createObjectURL(a)+'>'):navigator.webkitGetUserMedia({video:1},f)}()

screenshot

function f(a){
a?
document.write('<video src='+URL.createObjectURL(a)+'>'):
navigator.getUserMedia({video:1},f)
}
function f(a){a?document.write('<video src='+URL.createObjectURL(a)+'>'):navigator.getUserMedia({video:1},f)}
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2012 Sindre Sorhus <http://sindresorhus.com>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. You just DO WHAT THE FUCK YOU WANT TO.
{
"name": "photoBooth",
"description": "Photo Booth with JS",
"keywords": [
"photo",
"camera",
"webcam",
"getusermedia",
"html",
"webrtc"
]
}
<script>
!function f(a){a?document.write('<video src='+webkitURL.createObjectURL(a)+'>'):navigator.webkitGetUserMedia({video:1},f)}()
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment