Advertisement
BrU32

JS Canvas Webcam Tall Mirror SRC

Sep 25th, 2016
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. <center>
  2. <video id="video" autoplay hidden>
  3. </video> <canvas id="canvas" width="500" height="500" style="border:0px solid">
  4. <script>
  5. var video = document.getElementById("video");
  6. var c = document.getElementById("canvas");
  7. var ctx = c.getContext("2d");
  8. var i=0; var canvas = document.getElementById('canvas');
  9. var context = canvas.getContext('2d');
  10. var video = document.getElementById('video');
  11. var mediaConfig = { video: true,audio:true};
  12. navigator.mediaDevices.getUserMedia(mediaConfig).then(function(stream) {
  13. video.src = this.window.URL.createObjectURL(stream);
  14. video.play(); video.addEventListener("play", function() {
  15. i = window.setInterval(function() {
  16. ctx.drawImage(video,0,0,500,500)},25);
  17. ctx.scale(1,10)
  18. }, false); });
  19. </script>
  20. </center>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement