Pavlo1
(Pavlo)
June 18, 2025, 1:30pm
1
Description
It seems that the cameraList returned by stream.getCameraList does not update when the camera permission status changes to ‘granted’.
Steps to reproduce:
start the call without granting any permissions
change the camera permission to granted
call await navigator.mediaDevices.enumerateDevices() and get actual list of available devices
call mediaStream.getCameraList() , but get same empty list.
The same for already audio permissions granted.
Camera device id appears in list only after stream.startVideo()
Hope, screenshot help you.
P.S other devices list does not update as well on changes status
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)]
Hey @Pavlo1
Thanks for your feedback.
call mediaStream.getCameraList() , but get same empty list.
It’s by design. We will update the camera list after startVideo
is called and camera permission is granted. We will improve this behavior in a future version.
Thanks
Vic
@Pavlo1 Hi,
You can handle this by combining device and permission listeners, and updating the lists after connection:
navigator.mediaDevices.ondevicechange = async () => {
await updateDeviceLists();
};
async function bindPermissionListeners() {
const camPerm = await navigator.permissions.query({ name: 'camera' });
const micPerm = await navigator.permissions.query({ name: 'microphone' });
camPerm.onchange = async () => {
await updateDeviceLists();
};
micPerm.onchange = async () => {
await updateDeviceLists();
};
}
client.on('connection-change', (payload) => {
if (payload.state === 'Connected') {
setTimeout(() => {
updateDeviceLists();
}, 1000);
}
});
async function updateDeviceLists() {
const devices = await navigator.mediaDevices.enumerateDevices();
console.log(devices);
const stream = client.getMediaStream();
console.log(await stream.getCameraList());
console.log(await stream.getMicList());
console.log(await stream.getSpeakerList());
}
bindPermissionListeners();
updateDeviceLists();
Upgrading to Video SDK 2.2.0+ is also recommended.
Best,
Naeem Ahmed