Advertisement
BrU32

JS Canvas Shooting Webcam/Star FX SRC

Dec 5th, 2016
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. <center>
  2. <canvas id="canvas" width='1000' height='1000'></canvas>
  3.  
  4. <body bgcolor="black" onload="setInterval(drawe(),33);" onmousedown="drawe" onchange="drawe" ondoubleclick="drawe;">
  5. <video id="video" autoplay hidden>
  6. </video>
  7. <canvas id="canvas" width="1000" height="1000"style="opacity:0.0;fillColor:none;">
  8. <script>
  9. var ii=1;
  10.  
  11. var video = document.getElementById("video");
  12. var c = document.getElementById("canvas");
  13. var ctx = c.getContext("2d");
  14. var canvas = document.getElementById('canvas');
  15. var context = canvas.getContext('2d');
  16. var video = document.getElementById('video');
  17. var mediaConfig = { video: true,audio:false};
  18. function drawe(){
  19. }
  20. navigator.mediaDevices.getUserMedia(mediaConfig).then(function(stream) {
  21. video.src = this.window.URL.createObjectURL(stream);
  22. video.play();
  23. ii-=50;
  24. video.addEventListener("play", function() {i = window.setInterval(function() {
  25. canvas.style.opacity=1.0
  26. ctx.drawImage(video,88+ii++,23,Math.random()*34,2/4)},0.00000001);
  27. ctx.rotate(Math.random()*2/2)
  28. ctx.draw();
  29. drawe();
  30. }, false);
  31. });
  32. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement