Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DASH: implement forced-subtitles #1187

Merged
merged 3 commits into from
Dec 8, 2022
Merged

DASH: implement forced-subtitles #1187

merged 3 commits into from
Dec 8, 2022

Conversation

peaBerberian
Copy link
Collaborator

This PR implements DASH forced-subtitles that are subtitles defined for when no other subtitle track is selected.

The idea is often to implement "Forced Narrative Subtitles" which allows to provide clarifications on different element in the screen. You can read more information on it here for example: https://partnerhelp.netflixstudios.com/hc/en-us/articles/217558918-Understanding-Forced-Narrative-Subtitles

With this PR, those text tracks will now have a forced attribute set to true in the various APIs where it is inspectable (getAvailableTextTracks, getTextTrack and the events textTrackChange and availableTextTracksChange).

Moreover, they are used as default text tracks, instead of no text track, when no set preference match the current choice, following a specific rule:

  • If there's a language associated to this forced subtitles, it is only set if this is the same language than for the used audio track.
  • If no forced subtitle is found associated to the language of the current audio track but a language-less forced subtitles track exists, then that one
  • In any other case, no subtitles are chosen by default.

This algorithm was chosen after pondering what the most logical would be. It is imperfect however (setting forced subtitles by default even if it is in a different language than the audio track could be preferred for example) and as such it may be changed in the future.
Though in any case, that track can be manually set by setTextTrack or preferences, which thus can be used for more precize settings.

@peaBerberian peaBerberian added DASH Relative to the DASH streaming protocol Subtitles Relative to subtitles labels Nov 30, 2022
@peaBerberian peaBerberian added this to the 3.30.0 milestone Nov 30, 2022
@peaBerberian peaBerberian force-pushed the feat/forced-subtitles branch 3 times, most recently from 912a522 to b415839 Compare December 6, 2022 14:33
@peaBerberian peaBerberian merged commit 516cccd into next Dec 8, 2022
peaBerberian added a commit that referenced this pull request Dec 8, 2022
peaBerberian added a commit that referenced this pull request Dec 15, 2022
peaBerberian added a commit that referenced this pull request Dec 21, 2022
peaBerberian added a commit that referenced this pull request Jan 31, 2023
peaBerberian added a commit that referenced this pull request Feb 8, 2023
peaBerberian added a commit that referenced this pull request Feb 9, 2023
@peaBerberian peaBerberian mentioned this pull request Feb 21, 2023
@peaBerberian peaBerberian mentioned this pull request Jun 13, 2023
@peaBerberian peaBerberian deleted the feat/forced-subtitles branch July 6, 2023 12:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DASH Relative to the DASH streaming protocol Subtitles Relative to subtitles
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant