From 2bf66b8340c79b18b0cb1169e1ec092e858f5084 Mon Sep 17 00:00:00 2001
From: Ms2ger If the media data is CORS-same-origin, run the steps to
- expose a media-resource-specific text track with the relevant data.
Cross-origin videos do not expose their subtitles, since that would allow attacks such as hostile sites reading subtitles from confidential videos on a user's @@ -39912,104 +39913,119 @@ interface VideoTrack { some legacy formats can be found in Sourcing In-band Media Resource Tracks from Media Containers into HTML. INBAND
-When a media resource contains data that the user agent recognizes and supports as - being equivalent to a text track, the user agent runs the steps to expose a - media-resource-specific text track with the relevant data, as follows.
+When a media resource contains data that the user agent recognizes + and supports as being equivalent to a text track, the user agent runs the steps to expose a + media-resource-specific text track with the relevant data.
+ +The steps to expose a media-resource-specific text track given + some relevant data data, + a media element element, and + a media resource resource are:
Associate the relevant data with a new text track and its corresponding new
- TextTrack
object. The text track is a media-resource-specific
- text track.
Let track be a new text track.
+ +This implicitly creates a corresponding new TextTrack
object.
Mark track as being a media-resource-specific text track.
Set the new text track's kind, Associate data with track.
Set track's kind, label, and language - based on the semantics of the relevant data, as defined by the relevant specification. If there - is no label in that data, then the label must be set to the - empty string.
Associate the text track list of cues with the rules for updating the - text track rendering appropriate for the format in question.
+Set track's list of cues's + rules for updating the text track rendering to the rules appropriate for the format + in question.
If the new text track's kind is If track's kind is
chapters
or metadata
, then set the text track in-band
- metadata track dispatch type as follows, based on the type of the media
- resource:
CodecID
element. WEBMCGCodecID
element. WEBMCGstsd
box of the
first stbl
box of the
first minf
box of the
- first mdia
box of the
- text track's trak
box in the
+ first mdia
box of
+ track's trak
box in the
first moov
box
of the file be the stsd box, if any.
If the file has no stsd box, or if the stsd box has neither a mett
box nor a metx
box, then the text track
- in-band metadata track dispatch type must be set to the empty string.
+ data-x="">mett box nor a metx
box, then set track's
+ in-band metadata track dispatch
+ type to the empty string.
- Otherwise, if the stsd box has a mett
box then the text
- track in-band metadata track dispatch type must be set to the concatenation of the
- string "mett
", a U+0020 SPACE character, and the value of the first mime_format
field of the first mett
box of the stsd
- box, or the empty string if that field is absent in that box.
+ Otherwise, if the stsd box has a mett
box then set
+ track's in-band
+ metadata track dispatch type to the concatenation of the string
+ "mett
", a U+0020 SPACE character, and the value of the first
+ mime_format
field of the first mett
box of the
+ stsd box, or the empty string if that field is absent in that box.
Otherwise, if the stsd box has no mett
box but has a metx
box then the text track in-band metadata track dispatch type
- must be set to the concatenation of the string "metx
", a U+0020 SPACE
- character, and the value of the first namespace
field of the first metx
box of the stsd box, or the empty string if that field is absent in
- that box.
+ data-x="">metx box then set track's in-band metadata track dispatch type to the concatenation of the
+ string "metx
", a U+0020 SPACE character, and the value of the first
+ namespace
field of the first metx
box of the
+ stsd box, or the empty string if that field is absent in that box.
MPEG4
Populate the new text track's list of - cues with the cues parsed so far, following the guidelines for exposing - cues, and begin updating it dynamically as necessary.
Populate track's list of cues + with the cues parsed so far, following the guidelines for exposing cues, and begin + updating it dynamically as necessary.
Set the new text track's readiness - state to loaded.
Set the new text track's mode to the - mode consistent with the user's preferences and the requirements of the relevant specification - for the data.
+Set track's mode to the mode consistent + with the user's preferences and the requirements of the relevant specification for the data.
For instance, if there are no other active subtitles, and this is a forced subtitle track (a subtitle track giving subtitles in the audio track's primary language, but @@ -40017,14 +40033,13 @@ interface VideoTrack { here.
Add the new text track to the media element's list of text - tracks.
Add track to element's list of text tracks.
Fire an event named addtrack
at the media element's addtrack
at element's textTracks
attribute's TextTrackList
object,
using TrackEvent
, with the track
- attribute initialized to the text track's TextTrack
object.
TextTrack
object.