Last active
September 21, 2017 03:36
-
-
Save voltrevo/031d2feae691eb62c6b8e57ba860629f to your computer and use it in GitHub Desktop.
This file contains hidden or 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
'use strict'; | |
(async () => { | |
const stream = await navigator.mediaDevices.getUserMedia({ video: true, audio: true }); | |
const vid = document.createElement('video'); | |
vid.srcObject = stream; | |
document.body.appendChild(vid); | |
vid.style.position = 'absolute'; | |
vid.style.left = '0px'; | |
vid.style.top = '0px'; | |
vid.style.width = '100vw'; | |
vid.style.height = '100vh'; | |
vid.style.objectFit = 'cover'; | |
vid.style.transform = 'scaleX(-1)'; | |
await vid.play(); | |
})() | |
.catch(err => console.error(err)) | |
; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment