After checking the provided link, I am unsure if Safari 15 supports getUserMedia. I attempted to use it to access the camera on Safari 15, and although it asked for permission, it did not display anything after granting access. The link indicates that Safari 15 supports getUserMedia/Stream API, but does not support Navigator API: getUserMedia. Below is my code - should I refer to getUserMedia/Stream API or Navigator API: getUserMedia in this case?
navigator.mediaDevices
.getUserMedia(constraints)
.then(function (stream) {
track = stream.getTracks()[0];
cameraView.srcObject = stream;
})
.catch(function (error) {
console.error("Oops. Something is broken.", error);
});
HTML
<video id="camera--view" autoplay></video>