-
-
Save kypflug/fdcccc85d859b0e60337 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function capturePhoto() | |
{ | |
var video = document.getElementById('videoTag'); | |
var canvas = document.getElementById('canvasTag'); | |
var videoWidth = video.videoWidth; | |
var videoHeight = video.videoHeight; | |
if (canvas.width !== videoWidth || canvas.height !== videoHeight) | |
{ | |
canvas.width = videoWidth; | |
canvas.height = videoHeight; | |
} | |
var ctx = canvas.getContext('2d'); | |
ctx.drawImage(video, 0, 0, video.videoWidth, video.videoHeight); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment