Class: shaka.text.VttTextParser

Constructor

new VttTextParser()

Constructs a VTT parser.
Implements:
Source:

Members

MPEG_TIMESCALE_ :number

Type:
  • number
Source:

manifestType_ :string

Type:
  • string
Source:

sequenceMode_ :boolean

Type:
  • boolean
Source:

Methods

getRegionById_(regionsnon-null, id) → {shaka.text.CueRegion}

Parameters:
Name Type Description
regions Array.<!shaka.text.CueRegion>
id string
Source:
Returns:
Type
shaka.text.CueRegion

parseCue_(textnon-null, timeOffset, regionsnon-null, stylesnon-null) → {shaka.text.Cue}

Parses a text block into a Cue object.
Parameters:
Name Type Description
text Array.<string>
timeOffset number
regions Array.<!shaka.text.CueRegion>
styles Map.<string, !shaka.text.Cue>
Source:
Returns:
Type
shaka.text.Cue

parseCueSetting(cuenon-null, word, regionsnon-null) → {boolean}

Parses a WebVTT setting from the given word.
Parameters:
Name Type Description
cue shaka.text.Cue
word string
regions Array.<!shaka.text.CueRegion>
Source:
Returns:
True on success.
Type
boolean

parsedLineValueAndInterpretation_(cuenon-null, word) → {boolean}

Parameters:
Name Type Description
cue shaka.text.Cue
word string
Source:
Returns:
Type
boolean

parseRegion_(text) → {shaka.text.CueRegion}

Parses a string into a Region object.
Parameters:
Name Type Description
text string
Source:
Returns:
Type
shaka.text.CueRegion

parseRegionSetting_(regionnon-null, word) → {boolean}

Parses a WebVTTRegion setting from the given word.
Parameters:
Name Type Description
region shaka.text.CueRegion
word string
Source:
Returns:
True on success.
Type
boolean

parseStyle_(textnon-null, stylesnon-null)

Parses a style block into a Cue object.
Parameters:
Name Type Description
text Array.<string>
styles Map.<string, !shaka.text.Cue>
Source:

setPositionAlign_(cuenon-null, align)

Parameters:
Name Type Description
cue shaka.text.Cue
align string
Source:

setTextAlign_(cuenon-null, align)

Parameters:
Name Type Description
cue shaka.text.Cue
align string
Source:

setVerticalWritingMode_(cuenon-null, value)

Parameters:
Name Type Description
cue shaka.text.Cue
value string
Source:

computeHlsSequenceModeOffset_(headerBlock, time) → {number}

Parameters:
Name Type Description
headerBlock string Contains X-TIMESTAMP-MAP.
time shaka.extern.TextParser.TimeContext
Source:
Returns:
Type
number

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:

setSequenceMode(sequenceMode)

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