Constructor
new Mp4VttParser()
- Implements:
- Source:
Members
-
(private, nullable) timescale_ :number
-
The current time scale used by the VTT parser.
Type:
- number
- Source:
Methods
-
(private, static) assembleCue_(payload, idnullable, settingsnullable, startTime, endTime) → {TextTrackCue}
-
Take the individual components that make a cue and create a vttc cue.
Parameters:
Name Type Attributes Description payloadstring idstring <nullable>
settingsstring <nullable>
startTimenumber endTimenumber - Source:
Returns:
- Type
- TextTrackCue
-
(private, static) parseTFHD_(flags, readernon-null) → (nullable) {number}
-
Parameters:
Name Type Description flagsnumber readershaka.util.DataViewReader - Source:
Returns:
the default_sample_duration field, if present- Type
- number
-
(private, static) parseTRUN_(version, flags, readernon-null) → (non-null) {Array.<shaka.media.Mp4VttParser.TimeSegment>}
-
Parameters:
Name Type Description versionnumber flagsnumber readershaka.util.DataViewReader - Source:
Returns:
- Type
- Array.<shaka.media.Mp4VttParser.TimeSegment>
-
(private, static) parseVTTC_(datanon-null, startTime, endTime) → {TextTrackCue}
-
Parses a vttc box into a cue.
Parameters:
Name Type Description dataArrayBuffer startTimenumber endTimenumber - Source:
Returns:
- Type
- TextTrackCue
-
parseInit(datanon-null)
-
Parse an initialization segment. Some formats do not have init segments so this won't always be called.
Parameters:
Name Type Description dataArrayBuffer The data that makes up the init segment. - Implements:
- Source:
-
parseMedia(datanon-null, timeContext) → (non-null) {Array.<!TextTrackCue>}
-
Parse a media segment and return the cues that make up the segment.
Parameters:
Name Type Description dataArrayBuffer The next section of buffer. timeContextshakaExtern.TextParser.TimeContext The time information that should be used to adjust the times values for each cue. - Implements:
- Source:
Returns:
- Type
- Array.<!TextTrackCue>
Type Definitions
-
TimeSegment
-
Type:
- {duration: ?number, timeOffset: ?number}
Properties:
Name Type Attributes Description durationnumber <nullable>
The length of the segment in timescale units. timeOffsetnumber <nullable>
The time since the start of the segment in timescale units. Time offset is based of the start of the segment. If this value is missing, the accumated durations preceeding this time segment will be used to create the start time. - Source: