<reponame>masayay/maiface<filename>static/js/getUserMedia.js<gh_stars>0// Get camera video(16:9)
const constraints = {
    audio: false,
    video: 
    {
        width: {min: 640, ideal: 1280, max: 1920},
        height: {min: 480, ideal: 720, max: 1080}
    }
};

// Get User Camera Device
navigator.mediaDevices.getUserMedia(constraints)
    .then(stream => {
        document.getElementById("myVideo").srcObject = stream;
        console.log("Got local user video");
 
    })
    .catch(err => {
        console.log('navigator.getUserMedia error: ', err);
        alert("Camera Connection error!");
    });

