Advertisement
BrU32

JS Canvas SRC Slow Motion W\ FLIR

Dec 21st, 2016
231
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. <style>
  2. body{
  3. filter:invert(1800);
  4. filter:brightness:(3333);
  5. }
  6. </style>
  7. <video id="video" hidden>
  8. </video>
  9. <body bgcolor="white">
  10. <canvas id="canvas" width="5000" height="5000" style="border:32px solid">
  11. <script>
  12. var video = document.getElementById("video");
  13. var c = document.getElementById("canvas");
  14. var ctx = c.getContext("2d");
  15. var i=6;
  16. var rr=0;
  17. var canvas = document.getElementById('canvas');
  18. var context = canvas.getContext('2d');
  19. var video = document.getElementById('video');
  20. var mediaConfig = { video: true,audio:true};
  21. navigator.mediaDevices.getUserMedia(mediaConfig).then(function(stream) {
  22. video.src = this.window.URL.createObjectURL(stream);
  23. video.play();
  24. video.addEventListener("play", function() {i = window.setInterval(function() {
  25. ctx.drawImage(video,rr,rr++)},0.0001);
  26. if(rr>30){
  27. rr=+30;
  28. }else{
  29. rr=-30;
  30. }
  31. }, 0.0001);
  32. });
  33. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement