Advertisement
Guest User

Untitled

a guest
Aug 20th, 2017
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. 'use strict';
  2.  
  3. (async () => {
  4. const stream = await navigator.mediaDevices.getUserMedia({ video: true, audio: true });
  5. const vid = document.createElement('video');
  6. vid.srcObject = stream;
  7. document.body.appendChild(vid);
  8. vid.style.position = 'absolute';
  9. vid.style.left = '0px';
  10. vid.style.top = '0px';
  11. vid.style.width = '100vw';
  12. vid.style.height = '100vh';
  13. vid.style.objectFit = 'cover';
  14. vid.style.transform = 'scaleX(-1)';
  15. await vid.play();
  16. })()
  17. .catch(err => console.error(err))
  18. ;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement