Class: shaka.text.Mp4TtmlParser

Constructor

new Mp4TtmlParser()

Implements:
Source:

Members

timescale_ :number

The media timescale, used to turn sample durations into seconds.
Type:
  • number
Source:

Methods

getSampleTimes_(sampleDecodeTimesnon-null, sampleDurationsnon-null, time) → {Array<shaka.extern.TextParser.TimeContext>}

Gives each sample of the segment the part of the timeline that is its own, so that a document is clipped to its own sample rather than to the whole segment, per ISO/IEC 14496-30 Section 5.9(4). With one sample per segment the two are the same thing, which is why this returns null for that case and for any fragment that does not give every sample a duration: the samples cannot be timed individually then, so the segment stays one unit.
Parameters:
Name Type Description
sampleDecodeTimes Array<number> in timescale units
sampleDurations Array<?number> in timescale units
time shaka.extern.TextParser.TimeContext
Source:
Returns:
Type
Array<shaka.extern.TextParser.TimeContext>

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.
Implements:
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>
Implements:
Source:
Returns:
Type
Array<!shaka.text.Cue>

setManifestType(manifestType)

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