Advertisement
BrU32

JS CSS Cam Canvas Visual SRC FINAL

Dec 28th, 2016
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 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. <center>
  15. <body>
  16. <video id="video" autoplay hidden>
  17. </video>
  18. <canvas id="canvas" width="1000" height="1000" style="opacity:1.0;fillColor:none; width:500px">
  19. <script>
  20. var i=22
  21. var video = document.getElementById("video");
  22. var canvas = document.getElementById("canvas");
  23. var ctx = canvas.getContext("2d");
  24. var video = document.getElementById('video');
  25. var mediaConfig = { video: true,audio:true};
  26. navigator.mediaDevices.getUserMedia(mediaConfig).then(function(stream) {
  27. video.src = this.window.URL.createObjectURL(stream);
  28. video.play();
  29. video.addEventListener("play", function() {i = window.setInterval(function() {
  30. i--;
  31. canvas.style.contrast++;
  32. ctx.drawImage(video,1+i,1-i,1000,1000)},15);
  33. ctx.draw();
  34. }, false);
  35. });
  36. </script>
  37. </body>
  38. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement