Skip to content

Fix bug multi-language audio tracks are greyed out and unselectable in v3.2.1 - #841

Open
independent-arg wants to merge 14 commits into
jely2002:mainfrom
independent-arg:fix-bug-audio-track-dropdown
Open

Fix bug multi-language audio tracks are greyed out and unselectable in v3.2.1#841
independent-arg wants to merge 14 commits into
jely2002:mainfrom
independent-arg:fix-bug-audio-track-dropdown

Conversation

@independent-arg

@independent-arg independent-arg commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Problem

When selecting a video resolution (e.g. 1080p), useMediaResolutionSelection.ts was passing selectedTrackIds.value?.audioTrackIds as availableTrackIds to buildTrackOptions.

Because individual video stream formats in yt-dlp metadata only reference the default audio track ID (e.g., lang:en|channels:2), buildTrackOptions flagged all other multi-language audio tracks (Spanish, French, German, etc.) as unavailable and rendered them with disabled: true. This prevented users from selecting non-default audio tracks across both "Video + Audio" and "Audio Only" modes.

#840
#826

test0

Fix

1. Stop restricting audio tracks by the selected video resolution.
In yt-dlp, multi-language audio streams can be freely combined with any video resolution format — the restriction was never correct to begin with. In src/composables/useMediaResolutionSelection.ts, audioTrackOptions now passes undefined as availableTrackIds to buildTrackOptions instead of selectedTrackIds.value?.audioTrackIds, so audio tracks are no longer disabled just because the currently selected format doesn't reference them.

2. Keep the "available in ..." hint on enabled tracks.
buildTrackOptions (src/helpers/resolutionSelection.ts) previously only attached the resolution/bitrate hint (e.g. "(Available in 130kbps, 49kbps)") or the unavailable suffix to disabled options — an enabled option always rendered with the bare label. Once audio tracks stopped being disabled, this hint disappeared entirely, including for tracks where it's genuinely useful info (verified against a real video with multiple audio-only bitrates).

buildTrackOptions now takes an additional alwaysShowResolutionHint parameter (default false, so existing video-track behavior is unchanged). useMediaResolutionSelection.ts passes true only for the audioTrackOptions call, so audio tracks keep showing where they're actually available even while enabled, without reintroducing the disabling bug. videoTrackOptions is untouched.

Tests

Unit tests in tests/unit/useMediaResolutionSelection.spec.ts were updated/added to verify:

  • Audio tracks stay enabled (disabled: false) regardless of the selected video resolution.
  • The resolution/bitrate hint still renders on enabled audio tracks when real per-format track data exists.
  • Video track restriction/label behavior is unchanged.

Verified manually on Linux and Windows.
test


Open with GitKraken

When you selected a video resolution (e.g., 1080p), selectedTrackIds.value retrieved that specific 1080p video format.In the YouTube / yt-dlp metadata structure, individual video formats only register the default audio track (for example, the English language 'lang:en|channels:2') within their audioTrackIds property.By passing that restricted array (['lang:en|channels:2']) to buildTrackOptions:The function checked whether each available track (Spanish, French, German, etc.) was present in that array.

Since they were not included in the 1080p video format, it marked disabled: true for all other audio tracks (<option disabled>).

As a result in the HTML, the browser/UI rendered all these tracks in gray, preventing the user from clicking or selecting any multi-language track other than the default one.
Added Spanish audio track option and updated tests to ensure all audio tracks remain active when a video resolution is selected.
@independent-arg
independent-arg marked this pull request as draft August 20, 2026 20:07
Added 'alwaysShowResolutionHint' parameter to control resolution hint visibility.
Removed unnecessary blank line for cleaner code.
@independent-arg
independent-arg marked this pull request as ready for review August 20, 2026 20:26
Added a test case to verify bitrate hints for audio tracks when a video resolution is selected.
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.

1 participant