📅  最后修改于: 2022-03-11 14:59:38.292000             🧑  作者: Mango
document.getElementById("startButton").addEventListener("click", function() {
navigator.mediaDevices.getUserMedia({
video: {
width: 1920,
height: 1024,
frameRate: 15
}
}).then(stream => videoElement.srcObject = stream)
.catch(err => log(err.name + ": " + err.message));
}, false);