i am trying to get video stream through camera, navigator.getuserMedia is not a function error comes.
in another simple page it works, but not in my specific major project
const video = document.getElementById('video')
function startVideo() {
navigator.getUserMedia(
{ video: {} },
stream => video.srcObject = stream,
err => console.error(err)
)
}
startVideo()
video tag:
<video id="video" width="100%" height="560" autoplay muted></video>
i expect video stream through camera
error:navigator.getUserMedia is not a function
at startVideo (script.js:3)
at script.js:9