function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Mariem MejrissiMariem Mejrissi 

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;
        }
    },
 
VinayVinay (Salesforce Developers) 
Hi Mariem,

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,