Interface: shaka.extern.TextParser

Methods

(export) 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
data Uint8Array The data that makes up the init segment.
Source:

(export) parseMedia(datanon-null, timeContext) → (non-null) {Array.<!shaka.extern.Cue>}

Parse a media segment and return the cues that make up the segment.
Parameters:
Name Type Description
data Uint8Array The next section of buffer.
timeContext shaka.extern.TextParser.TimeContext The time information that should be used to adjust the times values for each cue.
Source:
Returns:
Type
Array.<!shaka.extern.Cue>

Type Definitions

TimeContext

A collection of time offsets used to adjust text cue times.
Type:
  • {periodStart: number, segmentStart: ?number, segmentEnd: number}
Properties:
Name Type Attributes Description
periodStart number The absolute start time of the period in seconds.
segmentStart number <nullable>
The absolute start time of the segment in seconds. Null if the manifest does not provide this information, such as in HLS.
segmentEnd number The absolute end time of the segment in seconds.
Source: