Answers for "how to add a camera in html"

3

how to add a camera in html

<video autoplay></video>

    <script>
    const constraints = {
      video: true,
    };
    
    const video = document.querySelector("video");
    
    navigator.mediaDevices.getUserMedia(constraints).then((stream) => {
      video.srcObject = stream;
    });
    </script>
Posted by: Guest on December-18-2020

Code answers related to "how to add a camera in html"

Browse Popular Code Answers by Language