how to access a webcam in real time by asp.net mvc

0

I'm trying to access a webcam via asp.net. When I use IIS Express it works, but when I upload the application the system does not access. could anyone help?

follow the code:

var video = document.getElementById('video');

    // Get access to the camera!
    if (navigator.mediaDevices && navigator.mediaDevices.getUserMedia) {
        // Not adding '{ audio: true }' since we only want video now
        navigator.mediaDevices.getUserMedia({ video: true }).then(function (stream) {
            video.src = window.URL.createObjectURL(stream);
            video.play();
        });
    }
<video id="video" width="640" height="480" autoplay></video>
<button id="snap">Snap Photo</button>
<canvas id="canvas" width="640" height="480"></canvas>
    
asked by anonymous 21.07.2018 / 00:00

0 answers