BrU32

JS Webcam/Mic Canvas SRC V3 Super Abstracted SRC

Sep 15th, 2016
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. <center>
  2. <body bgcolor="black">
  3. <video id="video" width="500" height="500" autoplay></video>
  4. <canvas id="canvas" width="500" height="500"></canvas>
  5. </center>
  6. <script>
  7. var canvas = document.getElementById('canvas');
  8. var context = canvas.getContext('2d');
  9. var video = document.getElementById('video');
  10. var mediaConfig = { video: true,audio:true};
  11. navigator.mediaDevices.getUserMedia(mediaConfig).then(function(stream) {
  12. video.src = window.URL.createObjectURL(stream);
  13. video.play();
  14. });
  15. </script>
Advertisement
Add Comment
Please, Sign In to add comment