MediaStream网络摄像头从div获取流

时间:2018-08-03 05:14:49

标签: javascript html5-video mediastream

我正在尝试关闭如下创建的视频

if (navigator.mediaDevices && navigator.mediaDevices.getUserMedia) {
                navigator.mediaDevices.getUserMedia({ video: true }).then(function (s) {
                    stream = s;
                    video.src = window.URL.createObjectURL(stream);
                    video.play();
                });
            }


//if i use
document.getElementById('video');

//the div look like these:
<video id="video" style="width:100%; height:100%;" autoplay="" src="blob:http://localhost:xxxx/4456960"></video>

主要问题是我无法访问视频流...如何停止/释放相机?

0 个答案:

没有答案