mirror of
https://github.com/shaka-project/shaka-player.git
synced 2026-06-24 17:35:10 +03:00
5717432206
## Summary - Adds a `customTrackLabel` callback to the UI configuration that allows overriding track labels for both audio and text tracks - The callback receives the default label (or `null` if the language was unrecognized), the track object, and a type string (`'audio'` or `'text'`) - Returning a string overrides the label; returning falsy keeps the default behavior Fixes #9821 ## Example usage ```javascript ui.configure({ customTrackLabel: (defaultLabel, track, type) => { if (track.language === 'fx') return 'Sound Effects'; return null; // use default } }); ``` ## Test plan - Added integration tests verifying label override, null for unrecognized languages, type argument, and fallback behavior - Tests pass in both compiled and uncompiled modes ## AI Disclosure As highlighted in the new `AGENT-ATTRIBUTION.md`, I've added Claude as a co-author of the commit as I made use of it during this PR. Signed-off-by: F1 MultiViewer <f1multiviewer@gmail.com> Co-authored-by: Claude <noreply@anthropic.com>