BrU32

JS Canvas Webcam Mass Mini Screen Flood Effect SRC V1

Sep 25th, 2016
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. <body bgcolor="black">
  2. <video id="video" autoplay hidden>
  3. </video>
  4. <canvas id="canvas" width="1000" height="1000" style="border:1px solid">
  5. <script>
  6. alert('Prsss Any Key To Pause!!')
  7. var i=1
  8. var ii=100
  9. var video = document.getElementById("video");
  10. var c = document.getElementById("canvas");
  11. var ctx = c.getContext("2d");
  12. var i=0;
  13. var canvas = document.getElementById('canvas');
  14. var context = canvas.getContext('2d');
  15. var video = document.getElementById('video');
  16. var mediaConfig = { video: true,audio:false};
  17. navigator.mediaDevices.getUserMedia(mediaConfig).then(function(stream) {
  18. video.src = this.window.URL.createObjectURL(stream);
  19. var store =video.src;
  20. video.play();
  21. video.addEventListener("play", function() {i = window.setInterval(function() {
  22. ctx.drawImage(video,Math.random()*Math.PI*i++,Math.random()*Math.PI*ii++,Math.random()*100,100)},35);
  23.  
  24. }, false);
  25. window.onkeydown=function(){
  26. this.video.src=('');
  27. this.video.pause();
  28. alert('Click Any Place To Restart Webcam/Effect!!')
  29.  
  30. }
  31. window.onmouseup=function(){
  32. this.video.src=(store);
  33. this.video.play();
  34.  
  35. }
  36. });
  37. </script>
Add Comment
Please, Sign In to add comment