I have this camera app I'm making, and I have this camera code that starts a camera here it is.
var video = document.getElementById('video');
// Get access to the camera
if(navigator.mediaDevices && navigator.mediaDevices.getUserMedia) {
navigator.mediaDevices.getUserMedia({ video: true }).then(function(stream) {
video.srcObject = stream;
video.play();
});
}
The problem is, I am unable to stop it. So how do you stop it in javascript the navigator getUserMedia camera access?