Skip to content Skip to sidebar Skip to footer

Navigator.mediadevices.enumeratedevices() Returns Empty Labels

Background The machine I am trying to implement this on contains multiple cameras, I want to select the camera in the code. (all machines have the same hardware) Issue I am trying

Solution 1:

navigator.mediaDevices.enumerateDevices() will return an empty label attribute value if the permission for accessing the mediadevice is not given. Try using it after getUserMedia.

(async () => {   
  await navigator.mediaDevices.getUserMedia({audio: true, video: true});   
  let devices = await navigator.mediaDevices.enumerateDevices();   
  console.log(devices); 
})();

Solution 2:

I resolved this issue by just putting my root ca to chrome. It means you should make chome browser recognizing your web server is trustworthy.

Post a Comment for "Navigator.mediadevices.enumeratedevices() Returns Empty Labels"