Skip to content

fix(SUP-51711): Audio Description Language selection not working as expected in some browsers - #272

Merged
SivanA-Kaltura merged 1 commit into
masterfrom
sup-51711-2
May 5, 2026
Merged

fix(SUP-51711): Audio Description Language selection not working as expected in some browsers#272
SivanA-Kaltura merged 1 commit into
masterfrom
sup-51711-2

Conversation

@SivanA-Kaltura

@SivanA-Kaltura SivanA-Kaltura commented May 5, 2026

Copy link
Copy Markdown
Contributor

Description of the Changes

Continuation of #271
When changing audio track, use audio label (display name) to distinguish between audio tracks with the same language (short name)

Resolves SUP-51711

@SivanA-Kaltura
SivanA-Kaltura merged commit 507583f into master May 5, 2026
17 checks passed
MosheMaorKaltura added a commit that referenced this pull request May 27, 2026
…to prevent duplicate tracks from HD flavors (#273)

## Summary

- **SUP-51711 regression (FEC-14971)**: On entries with a single audio
AdaptationSet containing multiple bitrate Representations,
`getAudioTracks()` (introduced in PRs #271/#272) returns one entry per
Representation — producing 2 identical-looking `und` tracks in the audio
selector.
- **Fix**: Deduplicate `getAudioTracks()` output by `language::label`
key before returning. Tracks with the same user-visible properties
(language + label) are collapsed to one; the active track wins. This
preserves all distinct tracks (e.g. English + English AD) while
collapsing bitrate-only duplicates.
- **Null-safety**: `audioTrack.label ?? undefined` in
`selectAudioLanguage()` prevents passing `null` where Shaka expects
`string | undefined`.

## Root cause

`shaka.getAudioTracks()` deduplicates by `originalAudioId`. When an MPD
has one audio AdaptationSet with 2 bitrate Representations, each gets a
different `originalAudioId` → 2 entries for what is user-perceivably one
track. The old `getAudioLanguagesAndRoles()` approach deduped by
`(language, role)` and returned 1 — but also lost the second English
track in the SUP-51711 scenario (two `lang=en`, different roles).

## Test cases verified

- Entry `0_xvq22ps3` (single audio, 2 bitrate Representations): audio
selector now hidden (1 track → no selector). ✅
- Entry `0_e93m88sc` (English + English AD + 7 other languages): all 9
distinct tracks preserved. ✅

## Test plan

- [x] New unit tests: `_getAudioTracks deduplication` suite (2 cases) —
HD flavor dedup + AD track preservation
- [x] All 100 tests pass, 5 skipped (pre-existing)
- [x] Build passes (no new TypeScript errors)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: ravitshalem <31099969+ravitshalem@users.noreply.github.com>
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants