Skip to content

Fix locale-dependent default device detection#1313

Closed
ghost wants to merge 1 commit intomainfrom
unknown repository
Closed

Fix locale-dependent default device detection#1313
ghost wants to merge 1 commit intomainfrom
unknown repository

Conversation

@ghost
Copy link
Copy Markdown

@ghost ghost commented Mar 21, 2026

Fixes #1194

The default device detection was checking label.startsWith('Default'), which only works when the browser is in English. On other locales Chrome translates the label (e.g. "Standard" in German, "Par defaut" in French), so the check would fail and the UI wouldn't show "default" as the active device.

Replaced with track.getSettings().deviceId === 'default', which checks the actual device ID instead of the human-readable label. This is locale-independent and directly checks what we care about.

Added a small isDefaultDevice() helper with a try/catch in case getSettings() isn't available (older browsers), in which case it falls back to false (same as the old behavior when the label didn't match).

The previous check used label.startsWith('Default') to detect if a
track is using the system default device, but this only works when
the browser locale is English. On other locales the label is
translated (e.g. 'Standard' in German).

Replaced with getSettings().deviceId === 'default' which is
locale-independent and directly checks what we actually care about.

Fixes #1194
@vercel
Copy link
Copy Markdown

vercel bot commented Mar 21, 2026

@ctonneslan is attempting to deploy a commit to the LiveKit Team on Vercel.

A member of the Team first needs to authorize it.

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 21, 2026

⚠️ No Changeset found

Latest commit: aa6c352

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@ghost ghost closed this by deleting the head repository Mar 26, 2026
This pull request was closed.
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.

Potential Issue with Locale-Sensitive Track Label Checks

0 participants