Detect forced subtitles on Safari in directfile (and label)#1239
Merged
peaBerberian merged 1 commit intomasterfrom Apr 11, 2023
Merged
Detect forced subtitles on Safari in directfile (and label)#1239peaBerberian merged 1 commit intomasterfrom
peaBerberian merged 1 commit intomasterfrom
Conversation
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 a `TextTrack` 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 a `TextTrack` was not actually translated to its resulting "label" property through the `getAvailableTextTracks` and `getTextTrack` API. I fixed that.
7e2a2a1 to
a050d85
Compare
peaBerberian
commented
Apr 4, 2023
| forced? : boolean | undefined; | ||
| label? : string | undefined; | ||
| forced : boolean | undefined; | ||
| label : string | undefined; |
Collaborator
Author
There was a problem hiding this comment.
Doing this just makes it more easy to catch issues (? meaning the absence of a field, whereas | undefined meaning that it has to be set explicitely to undefined)
Merged
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.
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
kindattribute of aTextTrackto"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
@kindto"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
labelof aTextTrackwas not actually translated to its resulting "label" property through thegetAvailableTextTracksandgetTextTrackAPI. I fixed that.