fix(SUP-51711): Audio Description Language selection not working as expected in some browsers - #271
Merged
Conversation
5 tasks
There was a problem hiding this comment.
Pull request overview
This PR updates the Dash adapter’s audio track discovery to better support Audio Description track selection across browsers and to move toward Shaka v5-compatible APIs.
Changes:
- Switch audio track enumeration from
getAudioLanguagesAndRoles()togetAudioTracks(). - Change how audio track ids/kinds are derived (including accessibility-based
kindclassification). - Keep using
getVariantTracks()to infer accessibility purpose (with a TODO for Shaka v5).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
roeedean
requested changes
May 1, 2026
ravitshalem
reviewed
May 4, 2026
ravitshalem
previously approved these changes
May 4, 2026
roeedean
previously approved these changes
May 4, 2026
roeedean
approved these changes
May 4, 2026
ravitshalem
approved these changes
May 4, 2026
SivanA-Kaltura
added a commit
to kaltura/playkit-js
that referenced
this pull request
May 4, 2026
…xpected in some browsers (#875) ### Description of the Changes Use label to compare audio flavor and track, fallback to flavorId if label comparison fails. This is needed because dash provides us limited information for comparison. Related PR: kaltura/playkit-js-dash#271 Resolves [SUP-51711](https://kaltura.atlassian.net/browse/SUP-51711) ### CheckLists - [ ] changes have been done against master branch, and PR does not conflict - [ ] new unit / functional tests have been added (whenever applicable) - [ ] test are passing in local environment - [ ] Travis tests are passing (or test results are not worse than on master branch :)) - [ ] Docs have been updated [SUP-51711]: https://kaltura.atlassian.net/browse/SUP-51711?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
SivanA-Kaltura
added a commit
that referenced
this pull request
May 5, 2026
…xpected in some browsers (#272) ### 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](https://kaltura.atlassian.net/browse/SUP-51711) [SUP-51711]: https://kaltura.atlassian.net/browse/SUP-51711?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
3 tasks
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of the Changes
Related PR:
kaltura/playkit-js#875
Resolves SUP-51711