This message was deleted.
# helpdesk
s
This message was deleted.
s
Hi @witty-vr-13117 have you tried passing empty string to
room.switchActiveDevice
? e.g
room.switchActiveDevice('audioinput', '')
Note: You can also pass the deviceId which can be captured via
await Room.getLocalDevices('audioinput')
. Ref: https://github.com/livekit/client-sdk-js#device-management-apis
w
Hello @shy-sandwich-47644, yes i tried, on initial work perfectly but when you change the OS default mic. livekit doesnt effect it
s
Do you get the deviceId of "OS default mic" from
await Room.getLocalDevices('audioinput')
?
See in my experience, when I call getLocalDevices, it provide the list, and from that list we can pick the deviceId and use switchActiveDevice to change it in real-time.
w
livekit,Room.getLocalDevices remove the default devices. so i implement own logic for getDevices and i tired pass the
default
or
''
but didnt switch the device and your default device is a audiooutput. output works perfectly input not working real-time
s
That's interesting. As per internal implementation of getLocalDevices , it is also calling the
navigator.mediaDevices.enumerateDevices
at https://github.com/livekit/client-sdk-js/blob/main/src/room/DeviceManager.ts#L36, just adding the default at the top: https://github.com/livekit/client-sdk-js/blob/main/src/room/DeviceManager.ts#L68 I think that's the bug, if we call the
Room.getLocalDevices
without any input params, it will keep the first one and remove the other defaults.
@witty-vr-13117 can you try calling the function
Room.getLocalDevices
without any input params and see if it's matching the response of
navigator.mediaDevices.enumerateDevices
.
w
does not match
s
hmm, one
default
deviceId is missing from
Room.getLocalDevices
. cc: @dry-elephant-14928
d
ah, I see the problem, it's due to our filtering. Issue filed: https://github.com/livekit/client-sdk-js/issues/483
🙌 1