Advertisement
BrU32

JS Webcam Flicker/Ghost Blocker Random Octave SRC

Feb 6th, 2017
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.81 KB | None | 0 0
  1. <center>
  2. <body bgcolor="black" onmousemove="drawe();" onmousedown="drawe" onchange="drawe" ondoubkeclick="drawe;">
  3. <video id="video" autoplay hidden>
  4. </video>
  5. <canvas id="canvas" onchange="drawe;" topmost=false onchange="drawe;" width="500" height="500" style="opacity:1.0;fillColor:none;">
  6. <script>
  7. var ii=1;
  8. var inn=244;
  9. var video = document.getElementById("video");
  10. var c = document.getElementById("canvas");
  11. var ctx = c.getContext("2d");
  12. var canvas = document.getElementById('canvas');
  13. var context = canvas.getContext('2d');
  14. var video = document.getElementById('video');
  15. var mediaConfig = { video: true,audio:false};
  16. function drawe(){
  17. var possible = "FABCGDE0123456789";
  18. var text = "";
  19. var canvas = document.getElementById("canvas");
  20. var ctx = canvas.getContext("2d");
  21. for(var i=0; i!=6; i++)
  22. text+=possible.charAt(Math.floor(Math.random()*possible.length))
  23. ctx.strokeStyle="#"+text;
  24. ctx.moveTo(event.x+4,event.y-4);
  25. ctx.lineTo(event.x+4,event.y-1);
  26. ctx.topmost=true;
  27. text='';
  28. }
  29. navigator.mediaDevices.getUserMedia(mediaConfig).then(function(stream) {
  30. video.src = this.window.URL.createObjectURL(stream);
  31. video.play();
  32. video.addEventListener("play", function() {i = window.setInterval(function() {
  33. canvas.style.opacity=Math.random()*1.1
  34.  
  35. ctx.topmost=false;
  36. ctx.drawStyle=''
  37. ctx.drawImage(video,ii--,ii++,500,500)},1);
  38. ctx.draw();
  39. drawe;
  40. }, false);
  41. });
  42. </script>
  43. <script>
  44. var context = new AudioContext();
  45. var lfo = context.createOscillator();
  46. lfo.frequency.value = Math.random()*12;
  47. var hfo = context.createOscillator();
  48. hfo.frequency.value = Math.random()*450;
  49. var modulationGain = context.createGain();
  50. modulationGain.gain.value = Math.random()*122;
  51. lfo.connect(modulationGain);
  52. modulationGain.connect(hfo.detune);
  53. hfo.connect(context.destination);
  54. hfo.start(0);
  55. lfo.start(0);
  56. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement