# ZoomVideo.getDevices() Not working properly on every browser

**URL:** <https://devforum.zoom.us/t/zoomvideo-getdevices-not-working-properly-on-every-browser/103549>\
**Category:** Web\
**Created:** [February 9, 2024, 1:37pm UTC](https://devforum.zoom.us/t/zoomvideo-getdevices-not-working-properly-on-every-browser/103549 "2024-02-09T13:37:38Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![godwin.owonam](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/godwin.owonam/32/53602_2.png) [@godwin.owonam](https://devforum.zoom.us/u/godwin.owonam)\
**Post date:** [February 9, 2024, 1:37pm UTC](https://devforum.zoom.us/t/zoomvideo-getdevices-not-working-properly-on-every-browser/103549/1 "2024-02-09T13:37:38Z")

</div>

**Description**  
Hi, team.  
I have a preview screen that calls the ZoomVideo.getDevices() on mount, but this returns different results on different browsers. In the worst case, it does not return any devices at all.

Is there a reason this happens? And there is no error on the browser console.

Note: This happens even when the permissions are granted and no other applications are using the camera/audio devices.

**Which Web Video SDK version?**  
1.9.5.

**Video SDK Code Snippets**

```auto
const mountDevices: () => Promise<{
  mics: MediaDevice[];
  speakers: MediaDevice[];
  cameras: MediaDevice[];
}> = async () => {
  allDevices = await ZoomVideo.getDevices();
  const cameraDevices: Array<MediaDeviceInfo> = allDevices.filter((device) => {
    return device.kind === 'videoinput';
  });
  const micDevices: Array<MediaDeviceInfo> = allDevices.filter((device) => {
    return device.kind === 'audioinput';
  });
  const speakerDevices: Array<MediaDeviceInfo> = allDevices.filter((device) => {
    return device.kind === 'audiooutput';
  });
  return {
    mics: micDevices.map((item) => {
      return { label: item.label, deviceId: item.deviceId };
    }),
    speakers: speakerDevices.map((item) => {
      return { label: item.label, deviceId: item.deviceId };
    }),
    cameras: cameraDevices.map((item) => {
      return { label: item.label, deviceId: item.deviceId };
    })
  };
};

```

before component displays I use the code below to prepopulate the devices

```auto
useMount(() => {
    PREVIEW_VIDEO = document.getElementById('js-preview-video');
    mountDevices().then((devices) => {
      console.log('devicesdevicesdevicesdevices', devices);
      setMicList(devices.mics);
      setCameraList(devices.cameras);
      setSpeakerList(devices.speakers);
      if (devices.speakers.length > 0) {
        setActiveSpeaker(devices.speakers[0].deviceId);
        setActiveMicSpeaker(devices.speakers[0].deviceId);
      }
      if (devices.mics.length > 0) {
        setActiveMicrophone(devices.mics[0].deviceId);
      }

      if (devices.cameras.length > 0) {
        setActiveCamera(devices.cameras[0].deviceId);
      }
    });
  });

```

I would greatly appreciate you feedback. Thanks.

**Screenshots**  
Below screen shot is from Chromium browser, no devices loaded.

 ![image](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/7/7/77cc7722646470c2ced4b3bce9e3a5b5db2dd9ef.png)

---

<div class="post-metadata">

**Author:** ![vic.yang](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/vic.yang/32/24656_2.png) [@vic.yang](https://devforum.zoom.us/u/vic.yang)\
**Post date:** [February 11, 2024, 4:54am UTC](https://devforum.zoom.us/t/zoomvideo-getdevices-not-working-properly-on-every-browser/103549/2 "2024-02-11T04:54:16Z")

</div>

Hey @godwin.owonam

Thanks for your feedback.

It depends on the browser. Can you try this official WebRTC sample?

> **[Select audio and video sources](https://webrtc.github.io/samples/src/content/devices/input-output/)**
>
> WebRTC code samples

Thanks  
Vic

---

<div class="post-metadata">

**Author:** ![godwin.owonam](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/godwin.owonam/32/53602_2.png) [@godwin.owonam](https://devforum.zoom.us/u/godwin.owonam)\
**Post date:** [February 12, 2024, 4:40am UTC](https://devforum.zoom.us/t/zoomvideo-getdevices-not-working-properly-on-every-browser/103549/3 "2024-02-12T04:40:03Z")

</div>

Hi @vic.yang  
Thanks for your response. It appears this is the same thing that the `ZoomVideo.getDevices()` method is supposed to do. And the problem is not that it doesn’t work at all, but that it doesn’t work on some devices.

I have visited the site you shared. On my Android Mozilla Firefox browser, the speakers (audiooutput) devices are not listed but default and greyed out (disabled). But it works fine on my Desktop Firefox browser.

Any ideas why it is so?  
Also, I would prefer to know why nothing was returned with the Chromium browser by the Zoom Video SDK API because my project is based on that.

Or are you suggesting that I use the demo you shared instead of the SDK API?

---

<div class="post-metadata">

**Author:** ![godwin.owonam](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/godwin.owonam/32/53602_2.png) [@godwin.owonam](https://devforum.zoom.us/u/godwin.owonam)\
**Post date:** [February 12, 2024, 3:37pm UTC](https://devforum.zoom.us/t/zoomvideo-getdevices-not-working-properly-on-every-browser/103549/4 "2024-02-12T15:37:05Z")

</div>

Hi @vic.yang I have checked the demo you suggested, the issues are still the same. The browsers do not return the same results on the same device.

From Firefox: you can see that no audio output device is listed

 ![image](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/e/7/e7f61a5afcef52661ec8d0721beef9ffb6f260b9.jpeg)

From Chrome: You can see that the default audio output device is listed, although greyed-out.

 ![image](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/4/1/41aba630c9aec796b3b1ecba3850322f1736356d.jpeg)

Is there a solution that follows from the Zoom SDK API?

---

<div class="post-metadata">

**Author:** ![vic.yang](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/vic.yang/32/24656_2.png) [@vic.yang](https://devforum.zoom.us/u/vic.yang)\
**Post date:** [February 15, 2024, 2:22am UTC](https://devforum.zoom.us/t/zoomvideo-getdevices-not-working-properly-on-every-browser/103549/5 "2024-02-15T02:22:24Z")

</div>

Hey @godwin.owonam

This may be the limitation of the browser’s capabilities, which would require the browser vendor to implement.

Thanks  
Vic

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/6/1/614bdd549b610bbaa46ff934617683a02bdaa03c.png) [@system](https://devforum.zoom.us/u/system)\
**Post date:** [March 16, 2024, 12:22pm UTC](https://devforum.zoom.us/t/zoomvideo-getdevices-not-working-properly-on-every-browser/103549/6 "2024-03-16T12:22:30Z")

</div>

Closed on March 16, 2024, 12:22pm UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
