1
2
3
4
5
6
7
function stopStream() {
if (window.stream) {
window.stream.getTracks().forEach(function (track) {
track.stop();
});
}
}
1
2
3
4
function gotStream(stream) {
window.stream = stream; // make stream available to console
videoElement.srcObject = stream;
}

转载请保持原始链接

原始链接: https://ru23.com/note/84de6d80.html