Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <canvas id="canvas" width='1000' height='1000'></canvas>
- <body bgcolor="black" onmousemove="drawe();" onmousedown="drawe" onchange="drawe" ondoubleclick="drawe;">
- <button onclick="zoomin();">Stretch Out</button>
- <button onclick="zoomout();">Stretch In</button>
- <br>
- <video id="video" autoplay hidden>
- </video>
- <canvas id="canvas" width="1000" height="1000"style="opacity:0.0;fillColor:none;">
- <script>
- var ii=444;
- var video = document.getElementById("video");
- var c = document.getElementById("canvas");
- var ctx = c.getContext("2d");
- var canvas = document.getElementById('canvas');
- var context = canvas.getContext('2d');
- var video = document.getElementById('video');
- var mediaConfig = { video: true,audio:true};
- function zoomin(){
- ii+=5;
- }
- function zoomout(){
- ii-=5;
- }
- navigator.mediaDevices.getUserMedia(mediaConfig).then(function(stream) {
- video.src = this.window.URL.createObjectURL(stream);
- video.play();
- video.addEventListener("play", function() {i = window.setInterval(function() {
- canvas.style.opacity+=1.9;
- ctx.drawImage(video,0,500,ii,500)},1);
- ctx.draw();
- drawe();
- }, false);
- });
- </script>
- </center>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement