Detect forced subtitles on Safari in directfile (and label) #1239
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.
This update only concerns directfile contents, especially when playing HLS contents on safari.
As of now, no real standard exists to indicate through an HTML Text Track object whether that track represents "forced" subtitles.
There's been some proposal since 2013
(https://lists.whatwg.org/pipermail/whatwg-whatwg.org/2013-April/039374.html) to add the possibility to set the
kind
attribute of aTextTrack
to"forced"
but nothing has yet materialized in what is now the WHATWG HTML standard.There's some very interesting discussion more "recently" in a whatwg Github issue here: whatwg/html#4472 (note: I'm more aligned with Nigel Megitt opinions on those things) but again it did not really materialize into something yet.
Yet Webkit, and by extension Safari, decided to add support (maybe in 2013? https://bugs.webkit.org/show_bug.cgi?id=114460) relying on the
@kind
to"forced"
proposal.Because it exists and it's better than nothing, I decided to add support for directfile contents (as other types of content don't need this, we already know whether a forced track is forced thanks to the Manifest) to Safari's way of doing it, considering it shouldn't break anything else.
I also saw that the
label
of aTextTrack
was not actually translated to its resulting "label" property through thegetAvailableTextTracks
andgetTextTrack
API. I fixed that.