Stream.getMicList() is returning an empty array, even when navigator.mediaDevices.enumerateDevice() returns several speakers and microphones
Browser Console Error
Logging out the result of
getMicList results in an empty array
Which Web Video SDK version?
Video SDK Code Snippets
map(stream => stream?.getMicList()),
tap(list => console.warn('mics', list))
Using rxJS to control access to the stream object, but it is populated and seems to be valid. I can call
startAudio on it just fine. Calling this first does not seem to resolve the issue
Tried starting audio first, or passing in the native device ID t o
Device (please complete the following information):
Latest Chrome and Brave browsers
Thanks for your feedback.
stream.getMicList() is almost the same as the
navigator.mediaDevices.enumerateDevice(), but it’s a synchronous function.
As you know, the label of the media devices is empty until permission is granted.
In Video SDK, in order to have a consistent return value, the
stream.getMicList() will return an empty array until the user starts video/audio or the devices change.
stream.switchMicrophone method to switch to the specific mic if you want.
Ok, I thought I tried that but apparently not the right way. Doing it again does show the microphones after I call
Is there a way to get the permission check without calling that? My goal was to provide a “join dialog” that also let the user pick their devices. The side-effect is that it enforces a user action before calling
startAudio on a refresh of the page which doesn’t work if I need it for the dropdown.
Obviously I could start the audio then mute it, but that seems like a bit of a workaround. It also doesn’t accomodate the lack of a user action without trying to lazy-load the dropdown (which then begs the question, how do I get the initial label).
Thanks for the quick reply!
We do provide an API
ZoomVideo.getDevices() to get the devices list. It can be called before joining the session.
Ah thanks. Looks like that has basically the same response as
enumerateDevice. The device IDs are the same as
getMicList so I’m guessing I just needed to start the audio before calling
stream.switchMicrophone (previously it said that I had an invalid device ID there.
I’ll keep testing but thanks for the quick help!
Thanks for sharing your solution.