SOURCE

console 命令行工具 X clear

                    
>
console
navigator.mediaDevices.getUserMedia({
    audio: true,
    video: {
        width: {min: 1024, ideal: 1280, max: 1920},
        height: {min: 576, ideal: 720, max: 1024},
        frameRate: {max: 30}
    }
}).then(
    stream => {
        // const video = document.querySelector('#video')
        video.srcObject = stream
        video.onloadedmetadata = () => {
            video.play()
        }
    }
)
<video id="video"></video>