-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: fix preferred track selection on Safari (#5601)
Preferred track selection was implemented differently for MSE and native playback. In fact, native playback even had different implementations for audio and text. It leads to inconsistencies during track selection, i.e. if track language contains locale, but language preference not, on MSE we're looking for closest locale and on src= we're making direct string comparison which leads to different results. To unify that, both MSE and native will now use `StreamUtils.filterStreamsByLanguageAndRole()` to find matching track. This method is designed to use on `shaka.extern.Stream` but luckily it uses the very same fields as defined in `shaka.extern.Track` so we can use it without major changes. Moreover, using this more robust method also allows us to get rid of double-selection workaround used so far. Observe that we were first selecting track without preferred role and then with preferred role. Backported to v4.3.x
- Loading branch information
1 parent
8017636
commit a85174a
Showing
2 changed files
with
20 additions
and
67 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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