Advertisement
BrU32

JS Webcam Canvas Super Doper V2 Src

Nov 22nd, 2016
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.68 KB | None | 0 0
  1. <canvas id="canvas" width='1000' height='1000'></canvas>
  2. <body bgcolor="black" onmousemove="drawe();" onmousedown="drawe" onchange="drawe" ondoubleclick="drawe;">
  3.  
  4. <br>
  5. <video id="video" autoplay hidden>
  6. </video>
  7. <canvas id="canvas" width="1000" height="1000"style="opacity:0.0;fillColor:none;">
  8. <script>
  9. var ii=444;
  10. var video = document.getElementById("video");
  11. var c = document.getElementById("canvas");
  12. var ctx = c.getContext("2d");
  13. var canvas = document.getElementById('canvas');
  14. var context = canvas.getContext('2d');
  15. var video = document.getElementById('video');
  16. var mediaConfig = { video: true,audio:false};
  17. function zoomin(){
  18. ii+=5;
  19. }
  20. function zoomout(){
  21. ii-=5;
  22. }
  23. navigator.mediaDevices.getUserMedia(mediaConfig).then(function(stream) {
  24. video.src = this.window.URL.createObjectURL(stream);
  25. video.play();
  26. video.addEventListener("play", function() {i = window.setInterval(function() {
  27. canvas.style.opacity+=1233.9;
  28. ctx.drawImage(video,ii++,Math.random()*500,ii-1,Math.random()*ii++)},1);
  29. ctx.draw();
  30. drawe();
  31. }, false);
  32. });
  33. </script>
  34. </center>
  35. function PauseIt(mp3){
  36. var aud=document.getElementById("aud");
  37. aud.playbackRate=1.0;
  38. aud.volume=1.0;
  39. aud.pause();
  40. }
  41. function MuteIt(){
  42. var aud=document.getElementById("aud");
  43. aud.volume=.0;
  44. }
  45. function UnMuteIt(){
  46. var aud=document.getElementById("aud");
  47. aud.volume=1.0;
  48. }
  49. function PlayIt(mp3){
  50. mp3=prompt("Enter URL:");
  51. var aud=document.getElementById("aud");
  52. aud.src=mp3;
  53. aud.playbackRate=1.0;
  54. aud.volume=1.0;
  55. aud.play();
  56. }
  57.  
  58. function StopIt(){
  59. var aud=document.getElementById("aud");
  60. aud.src='';
  61. aud.playbackRate=1.0;
  62. aud.volume=1.0;
  63. aud.play();
  64. }
  65. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement