Camera active device

Description
Trying to set the active camera after calling getCameraList() doesn’t work correctly, and here’s why:

For example, calling await navigator.mediaDevices.enumerateDevices() returns 7 devices — but only one of them is an actual camera.

After I ran the following:

console.log(mediaStream.getCameraList());
console.log(mediaStream.getActiveCamera());

I got

[
    {
        "deviceId": "118240c701de42a642fcce139b4a0a5c6c761cbe3acccc7b508195842bdb4365",
        "label": "Integrated Webcam"
    }
]

'default'

Is this expected behavior? Should I write workaround to set active camera correctly?

zoom/videosdk 2.1.10

Device:

  • Device: [Dell Inc. XPS 15 9520]
  • OS: [Ubuntu 22.04.5 LTS]
  • Browser: [Google Chrome Version 136.0.7103.59 (Official Build) (64-bit)]
1 Like

Hey @Pavlo1

Thanks for your feedback.

enumerateDevices returns all available media devices, including microphones, audio output devices, and cameras. Devices with kind equal to videoinput are cameras.

As for why getActiveCamera() returns 'default', it’s because mediaStream.startVideo() hasn’t been called yet. Without starting the video, the SDK hasn’t actually accessed the active camera, so it falls back to returning the default value 'default'.

Thanks
Vic

1 Like