Advertisement
BrU32

JS Canvas Webcam FLIR Photo Webcam Back N Forth Switch FX V1

Feb 1st, 2017
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. <style>
  2. body{
  3. filter:invert(180%);
  4. }
  5. </style>
  6. <center>
  7. <body onmousemove="setInterval(Load_Img('https://api.audiotool.com/track/dj_bru_-_acid_step/2/cover/128.jpg?showDefault=true'),34)" background-color="white">
  8. <video id="video" autoplay hidden>
  9. </video>
  10. <canvas id="canvas" width="500" height="500" style="drawColor:#FFFFFF">
  11. <script>
  12. var video = document.getElementById("video");
  13. var c = document.getElementById("canvas");
  14. var ctx = c.getContext("2d");
  15. var i=0;
  16. var mediaConfig = { video:true,audio:false};
  17. navigator.mediaDevices.getUserMedia(mediaConfig).then(function(stream) {
  18. video.src = this.window.URL.createObjectURL(stream);
  19. video.play();
  20. video.addEventListener("play", function() {i = window.setInterval(function() {
  21. ctx.drawImage(video,0,0,500,500)},100);
  22. }, false);
  23. });
  24.  
  25. function Load_Img(path){
  26. var h,w;
  27. h=('500');
  28. w=('500')
  29. var canvas = document.getElementById("canvas");
  30. var ctx = canvas.getContext("2d");
  31. var img = new Image();
  32. img.src=(path);
  33. ctx.drawImage(img, 1, 1,h,w);
  34.  
  35. }
  36. </script>
  37.  
  38. </body>
  39. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement