Interface: shaka.extern.TextParser

Methods

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:

parseMedia(datanon-null, timeContext, urinullable, imagesnon-null) → {Array.<!shaka.text.Cue>}

Parse a media segment and return the cues that make up the segment.
Parameters:
Name Type Attributes 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.
uri string | undefined <nullable>
The media uri.
images Array.<string>
Source:
Returns:
Type
Array.<!shaka.text.Cue>

setManifestType(manifestType)

Notifies the manifest type.
Parameters:
Name Type Description
manifestType string
Source:

setSequenceMode(sequenceMode)

Notifies the stream if the manifest is in sequence mode or not.
Parameters:
Name Type Description
sequenceMode boolean
Source:

Type Definitions

ModifyCueCallback

A callback used for editing cues before appending. Provides the cue, the URI of the captions file the cue was parsed from, and the time context that was used when generating that cue. You can edit the cue object passed in.
Type:
  • function(!shaka.text.Cue, ?string, !shaka.extern.TextParser.TimeContext)
Source:

TimeContext

A collection of time offsets used to adjust text cue times.
Type:
  • {periodStart: number, segmentStart: number, segmentEnd: number, vttOffset: number}
Properties:
Name Type Description
periodStart number The absolute start time of the period in seconds.
segmentStart number The absolute start time of the segment in seconds.
segmentEnd number The absolute end time of the segment in seconds.
vttOffset number The start time relative to either segment or period start depending on segmentRelativeVttTiming configuration.
Source: