Advertisement
BrU32

JS Canvas Webcam Little Green Men With Strobe FX SRC

Jan 25th, 2017
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. <style>
  2. body{
  3.  
  4. filter:contrast(12);
  5.  
  6. }
  7. canvas{
  8.  
  9. filter:invert(3350%);
  10.  
  11.  
  12. }
  13. </style>
  14. <canvas id="canvas" width='1000' height='1000'></canvas>
  15.  
  16. <body bgcolor="black" onmousemove="drawe();" onmousedown="drawe" onchange="drawe" ondoubleclick="drawe;">
  17. <video id="video" autoplay hidden>
  18. </video>
  19. <canvas id="canvas" width="1000" height="1000"style="opacity:0.0;fillColor:none;">
  20. <script>
  21. var ii=100;
  22.  
  23. var video = document.getElementById("video");
  24. var c = document.getElementById("canvas");
  25. var ctx = c.getContext("2d");
  26. var canvas = document.getElementById('canvas');
  27. var context = canvas.getContext('2d');
  28. var video = document.getElementById('video');
  29. var mediaConfig = { video: true,audio:true};
  30. function drawe(){
  31. }
  32. navigator.mediaDevices.getUserMedia(mediaConfig).then(function(stream) {
  33. video.src = this.window.URL.createObjectURL(stream);
  34. video.play();
  35. ii+=50;
  36. video.addEventListener("play", function() {i = window.setInterval(function() {
  37. canvas.style.opacity=Math.random()*0.9;
  38. ctx.drawImage(video,ii+Math.random()*500,ii+Math.random()*500,Math.random()*ii-2,Math.random()*ii-1)},0.1);
  39.  
  40. drawe();
  41. }, false);
  42. });
  43. </script>
  44. </center>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement