Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <body bgcolor="black">
- <video id="video" autoplay hidden>
- </video>
- <canvas id="canvas" width="1000" height="1000" style="border:1px solid">
- <script>
- alert('Prsss Any Key To Pause!!')
- var i=1
- var ii=100
- var video = document.getElementById("video");
- var c = document.getElementById("canvas");
- var ctx = c.getContext("2d");
- var i=0;
- var canvas = document.getElementById('canvas');
- var context = canvas.getContext('2d');
- var video = document.getElementById('video');
- var mediaConfig = { video: true,audio:false};
- navigator.mediaDevices.getUserMedia(mediaConfig).then(function(stream) {
- video.src = this.window.URL.createObjectURL(stream);
- var store =video.src;
- video.play();
- video.addEventListener("play", function() {i = window.setInterval(function() {
- ctx.drawImage(video,Math.random()*Math.PI*i++,Math.random()*Math.PI*ii++,Math.random()*100,100)},35);
- }, false);
- window.onkeydown=function(){
- this.video.src=('');
- this.video.pause();
- alert('Click Any Place To Restart Webcam/Effect!!')
- }
- window.onmouseup=function(){
- this.video.src=(store);
- this.video.play();
- }
- });
- </script>
Add Comment
Please, Sign In to add comment