Class: shaka.media.VttTextParser

A TextEngine plugin that parses WebVTT files.

Parameters:
Name Type Attributes Description
data ArrayBuffer
offset number
segmentStartTime number <nullable>
segmentEndTime number <nullable>
useRelativeCueTimestamps boolean
Source:
Throws:
Returns:
Type
Array.<!TextTrackCue>

Methods

(private, static) parseCue_(textnon-null, offset, segmentStartTimenullable, useRelativeCueTimestamps) → (nullable) {TextTrackCue}

Parses a text block into a Cue object.
Parameters:
Name Type Attributes Description
text Array.<string>
offset number
segmentStartTime number <nullable>
useRelativeCueTimestamps boolean
Source:
Returns:
Type
TextTrackCue

(static) parseSetting(cuenon-null, word) → {boolean}

Parses a WebVTT setting from the given word.
Parameters:
Name Type Description
cue TextTrackCue
word string
Source:
Returns:
True on success.
Type
boolean

(private, static) parseTime_(parsernon-null) → (nullable) {number}

Parses a WebVTT time from the given parser.
Parameters:
Name Type Description
parser shaka.util.TextParser
Source:
Returns:
Type
number