Advertisement
BrU32

JS Webcam Riding The 3D White Light FX V1 SRC

Jan 31st, 2017
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1.  
  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="1000" height="1000" style="opacity:1.0;fillColor:none; width:500px">
  6. <script>
  7. var i=0;
  8. var video = document.getElementById("video");
  9. var canvas = document.getElementById("canvas");
  10. var ctx = canvas.getContext("2d");
  11. var video = document.getElementById('video');
  12. var mediaConfig = { video: true,audio:false};
  13. navigator.mediaDevices.getUserMedia(mediaConfig).then(function(stream) {
  14. video.src = this.window.URL.createObjectURL(stream);
  15. video.play();
  16. video.addEventListener("play", function() {i = window.setInterval(function() {
  17. ctx.shadowBlur = i;
  18. ctx.shadowOffsetX=i++;
  19. ctx.shadowOffsetY=i++;
  20. var rantColor=Math.floor(Math.random()*3);
  21.  
  22. ctx.shadowColor = "#FFFFFF";
  23. ctx.translate(1,-2)
  24. ctx.drawImage(video,i,i,i,i)},0.5);
  25. ctx.draw();
  26. },true);
  27. });
  28.  
  29. </script>
  30. </body>
  31. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement