-
Notifications
You must be signed in to change notification settings - Fork 95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Don't fall back as eagerly to unselected devices #2802
Conversation
Somewhere around version 131 or 132, Firefox has started being more paranoid about media device fingerprinting, and will not even give you the IDs of available devices until you've requested a media stream. Instead you only get a single audio input and video input each with the empty string as their device ID, representing the system's default device. We can recognize this case and avoid resetting the device selection.
src/livekit/MediaDevicesContext.tsx
Outdated
// Otherwise, fall back to the first available device. | ||
devId = | ||
available.some((d) => d.deviceId === selectedId) || | ||
available.every((d) => d.deviceId === "") | ||
? selectedId | ||
: available.at(0)?.deviceId; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is the fallback happening?
If all devices are ""
we would still end up using selectedId. What if that is not available? If the browser is paranoid but also the mic has been disconnected?
Where do we catch that?
// Worst case it is not available and the browser will gracefully fall | ||
// back to some other device for us when requesting the media stream. | ||
// Otherwise, select the first available device. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉
Somewhere around version 131 or 132, Firefox has started being more paranoid about media device fingerprinting, and will not even give you the IDs of available devices until you've requested a media stream. Instead you only get a single audio input and video input each with the empty string as their device ID, representing the system's default device. We can recognize this case and avoid resetting the device selection.
Closes #2770