You need to sign in to do that
Don't have an account?
![Mariem Mejrissi Mariem Mejrissi](https://dfc-org-production.my.site.com/img/userprofile/default_profile_45_v2.png)
Error " Your browser does not support media devices"
Hi everyone,
My problem is that mediaSupport return false and the camera still not streaming. How can I fix that ?
startStreaming: function() {
const mediaSupport = 'mediaDevices' in navigator;
if (mediaSupport && null == this.camera.cameraStream) {
navigator.mediaDevices.getUserMedia({ audio: false, video: {facingMode: 'environment' } })
.then((mediaStream) => {
this.camera.cameraStream = mediaStream;
this.camera.stream.srcObject = mediaStream;
this.camera.stream.play();
})
.catch(function (err) {
console.error(err);
});
} else {
alert('Your browser does not support media devices.');
return;
}
},
My problem is that mediaSupport return false and the camera still not streaming. How can I fix that ?
startStreaming: function() {
const mediaSupport = 'mediaDevices' in navigator;
if (mediaSupport && null == this.camera.cameraStream) {
navigator.mediaDevices.getUserMedia({ audio: false, video: {facingMode: 'environment' } })
.then((mediaStream) => {
this.camera.cameraStream = mediaStream;
this.camera.stream.srcObject = mediaStream;
this.camera.stream.play();
})
.catch(function (err) {
console.error(err);
});
} else {
alert('Your browser does not support media devices.');
return;
}
},
Currently, navigator.mediaDevices isn't available in lightning. Kindly review below Idea link and vote for this feature.
https://trailblazer.salesforce.com/ideaView?id=0873A000000CLRbQAO
Reference:
https://salesforce.stackexchange.com/questions/318771/cant-get-mediadevice-property-from-navigator-in-lightning
Please mark as Best Answer if above information was helpful so that it can help others in the future.
Thanks,