﻿"use strict";function initCamera(){var n,t,i,r,u,f,e;return regeneratorRuntime.async(function(o){for(;;)switch(o.prev=o.next){case 0:return n=document.getElementById("video"),t=document.getElementById("canvas"),i=document.getElementById("snap"),r=document.querySelector("span#errorMsg"),u={audio:!1,video:{width:480,height:480}},o.prev=5,o.next=8,regeneratorRuntime.awrap(navigator.mediaDevices.getUserMedia(u));case 8:f=o.sent;handleSuccess(f);o.next=15;break;case 12:o.prev=12;o.t0=o["catch"](5);r.innerHTML="navigator.getUserMedia error:"+o.t0.toString();case 15:e=t.getContext("2d");i.addEventListener("click",function(){e.drawImage(n,0,0,480,480)});case 17:case"end":return o.stop()}},null,this,[[5,12]])}function handleSuccess(n){window.stream=n;video.srcObject=n}