Constructor
(export) new VttTextParser()
- Implements:
- Source:
Members
(private, static, constant) MPEG_TIMESCALE_ :number
Type:
- number
- Source:
Methods
(private, static) getRegionById_(regionsnon-null, id) → (nullable) {shaka.text.CueRegion}
Parameters:
Name | Type | Description |
---|---|---|
regions |
Array.<!shaka.text.CueRegion> | |
id |
string |
- Source:
Returns:
- Type
- shaka.text.CueRegion
(private, static) parseCue_(textnon-null, timeOffset, regionsnon-null) → {shaka.text.Cue}
Parses a text block into a Cue object.
Parameters:
Name | Type | Description |
---|---|---|
text |
Array.<string> | |
timeOffset |
number | |
regions |
Array.<!shaka.extern.CueRegion> |
- Source:
Returns:
- Type
- shaka.text.Cue
(static) 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
(private, static) parsedLineValueAndInterpretation_(cuenon-null, word) → {boolean}
Parameters:
Name | Type | Description |
---|---|---|
cue |
shaka.text.Cue | |
word |
string |
- Source:
Returns:
- Type
- boolean
(private, static) parseRegion_(text) → (non-null) {shaka.extern.CueRegion}
Parses a string into a Region object.
Parameters:
Name | Type | Description |
---|---|---|
text |
string |
- Source:
Returns:
(private, static) 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
(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
(private, static) setPositionAlign_(cuenon-null, align)
Parameters:
Name | Type | Description |
---|---|---|
cue |
shaka.text.Cue | |
align |
string |
- Source:
(private, static) setTextAlign_(cuenon-null, align)
Parameters:
Name | Type | Description |
---|---|---|
cue |
shaka.text.Cue | |
align |
string |
- Source:
(private, static) setVerticalWritingMode_(cuenon-null, value)
Parameters:
Name | Type | Description |
---|---|---|
cue |
shaka.text.Cue | |
value |
string |
- Source:
(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. |
- Implements:
- 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. |
- Implements:
- Source:
Throws:
Returns:
- Type
- Array.<!shaka.extern.Cue>