text: !function(){"use strict";function a(){console.log("Picture taken!"),f.drawImage(c,0,0,d,e),$("#image").attr("src",canvas.toDataURL("image/png"))}var b=!1,c=document.querySelector("#video"),d=500,e=0,f=document.querySelector("#canvas").getContext("2d");navigator.getMedia=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia,navigator.getMedia({video:!0,audio:!1},function(a){if(navigator.mozGetUserMedia)$("#video").mozSrcObject=a;else{var b=window.URL||window.webkitURL;$("#video").attr("src",b.createObjectURL(a))}c.play()},function(a){console.log("Dun dun dun! "+a)}),c.addEventListener("canplay",function(){b||(e=c.videoHeight/(c.videoWidth/d),$("#video").attr({width:d,height:e}),$("#canvas").attr({width:d,height:e}),f.translate(d,0),f.scale(-1,1),b=!0)},!1),$("#capture-button").hover(function(){$(this).addClass("hover"),$("#capture-button .fa").addClass("hover")},function(){$(this).removeClass("hover"),$("#capture-button .fa").removeClass("hover")}),$("#capture-button").click(function(){a()}),navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia||console.log("User media not supported.")}();