components-js
components-js copied to clipboard
No device selected in some cases
Select which package(s) are affected
@livekit/components-react
Describe the bug
On some devices, LiveKit doesn't select audio device in PreJoin (nor inside call) even though LiveKit sees several audio devices. Camera is selected correctly. After joining call, the sound is transmitted correctly, but in MediaSelectDevice there is still nothing selected
const audioDevices = useMediaDevices({ kind: 'audioinput' })
console.log('audioDevices length:', audioDevices.length) // audioDevices length: 2
console.log(userChoices.audioDeviceId) // ''
console.log(userChoices.videoDeviceId) // 'abc123def...'
it happens on https://meet.livekit.io as well
Logs:
Reproduction
This happens in meet.livekit.io as well. It can be reproduced there. You can see a camera is selected correctly, but not the microphone
Devices where it happens:
- Chrome, Linux: Ubuntu 22.04.4 LTS
- Chrome, Android 13
Devices where it works correctly:
- any browser on MacOS & iOS
Logs
No response
System Info
Devices where we reproduced it:
* Chrome, Linux: Ubuntu 22.04.4 LTS
* Chrome, Android 13
Worked correctly on:
* multiple browsers, MacOS
* multiple browsers, iOS
Severity
blocking all usage of LiveKit
Additional Information
No response
would it be possible for you to check whether https://github.com/livekit/components-js/pull/952 fixes the issue for you?
@lukasIO same issue with latest build, audio device is showing as selected but its not really selected and require a re-selection for audio to be transmitted. I'm on iPhone 13pro iOS 18
I'm running into a similar issue where trying to change the microphone or camera on the prejoin screen doesn't update every time. No error is being thrown but it just doesn't update.
I think something is going wrong in the setActiveMediaDevice function.
thanks for your patience on this. We applied some changes recently to improve the situation with device handling across our SDKs. Feel free to open a new issue if you're still running into problems with this