Skip to content
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

fix: add explicit default device option to device selectors #1701

Merged
merged 4 commits into from
Feb 27, 2025

Conversation

myandrienko
Copy link
Contributor

@myandrienko myandrienko commented Feb 26, 2025

Overview

As far as we know, there's no reliable way to determine the system's default camera and microphone devices without querying them first-and we shouldn't query the user's media devices unless they're enabled. So we have no way of knowing which camera or microphone device is being used by the browser under the following conditions

  1. No device has been explicitly selected by the user (or the previously selected device is no longer available).
  2. No device was previously enabled by the user

Previously, in this case, we simply rendered a list of devices with no device selected. This was confusing and looked "broken".

Now we add an explicit "Default" option to the list instead. This option is purely cosmetic: if it's present, it's always selected, so selecting it does nothing; and if a different device is selected, this option disappears.

Screenshot 2025-02-26 at 16 26 02

Screenshot 2025-02-26 at 16 25 29

Implementation notes

This is implemented on the React SDK level, and the new useDeviceList hook is applied to device lists in all device selectors.

This hook is public API, documented here: https://github.com/GetStream/docs-content/pull/206

@myandrienko myandrienko changed the title add explicit default device option to device selectors fix: add explicit default device option to device selectors Feb 26, 2025
@oliverlaz oliverlaz merged commit 1b8e11b into main Feb 27, 2025
13 checks passed
@oliverlaz oliverlaz deleted the explicit-default-device branch February 27, 2025 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants