Advertisement
BrU32

JS Canvas Webcam Fun House FLIR SRC

Nov 6th, 2016
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. <style>
  2. body{
  3. overflow: visible;
  4. position:center;
  5. width: 100%;
  6. height: 100%;
  7. filter:invert(1.0);
  8. }
  9. .container{
  10. position: center;
  11. width: Math.random()*5vmax+1vmax;
  12. height: Math.random()*15vmax+10vmax;
  13. top: 50%;
  14. left: 50%;
  15. }
  16. </style>
  17. <center>
  18. <video id="video" autoplay hidden>
  19. </video> <canvas id="canvas" width="500" height="500" style="border:0px solid">
  20. <script>
  21. var video = document.getElementById("video");
  22. var c = document.getElementById("canvas");
  23. var ctx = c.getContext("2d");
  24. var i=0; var canvas = document.getElementById('canvas');
  25. var context = canvas.getContext('2d');
  26. var video = document.getElementById('video');
  27. var mediaConfig = { video: true,audio:true};
  28. navigator.mediaDevices.getUserMedia(mediaConfig).then(function(stream) {
  29. video.src = this.window.URL.createObjectURL(stream);
  30. video.play(); video.addEventListener("play", function() {
  31. i = window.setInterval(function() {
  32. ctx.drawImage(video,0,0,500,500)},25);
  33. ctx.scale(Math.random()*10,Math.random()*10)
  34. }, false); });
  35. </script>
  36. </center>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement