-
(private, static) addNewLines_(elementnon-null, whitespaceTrim)
-
Insert \n where
tags are found
Parameters:
Name |
Type |
Description |
element |
Node
|
|
whitespaceTrim |
boolean
|
|
- Source:
-
(private, static) addStyle_(cuenon-null, cueElementnon-null, region, stylesnon-null)
-
Adds applicable style properties to a cue.
Parameters:
Name |
Type |
Description |
cue |
TextTrackCue
|
|
cueElement |
Element
|
|
region |
Element
|
|
styles |
Array.<!Element>
|
|
- Source:
-
(private, static) getElementFromCollection_(element, attributeName, collectionnon-null) → {Element}
-
Selects an item from |collection| whose id matches |attributeName|
from |element|.
Parameters:
Name |
Type |
Description |
element |
Element
|
|
attributeName |
string
|
|
collection |
Array.<Element>
|
|
- Source:
Returns:
-
Type
-
Element
-
(private, static) getInheritedAttribute_(elementnon-null, attributeName) → (nullable) {string}
-
Traverses upwards from a given node until a given attribute is found.
Parameters:
Name |
Type |
Description |
element |
Element
|
|
attributeName |
string
|
|
- Source:
Returns:
-
Type
-
string
-
(private, static) getLeafNodes_(element) → (non-null) {Array.<!Element>}
-
Gets leaf nodes of the xml node tree. Ignores the text, br elements
and the spans positioned inside paragraphs
Parameters:
Name |
Type |
Description |
element |
Element
|
|
- Source:
Returns:
-
Type
-
Array.<!Element>
-
(private, static) getStyleAttribute_(cueElementnon-null, region, stylesnon-null, attribute) → (nullable) {string}
-
Finds a specified attribute on either the original cue element or its
associated region and returns the value if the attribute was found.
Parameters:
Name |
Type |
Description |
cueElement |
Element
|
|
region |
Element
|
|
styles |
Array.<!Element>
|
|
attribute |
string
|
|
- Source:
Returns:
-
Type
-
string
-
(private, static) parseColonTimeWithFrames_(rateInfonon-null, text) → (nullable) {number}
-
Parses a TTML colon formatted time containing frames
Parameters:
- Source:
Returns:
-
Type
-
number
-
(private, static) parseCue_(cueElementnon-null, offset, rateInfonon-null, stylesnon-null, regionsnon-null, whitespaceTrim) → {TextTrackCue}
-
Parses an Element into a TextTrackCue or VTTCue.
Parameters:
- Source:
Returns:
-
Type
-
TextTrackCue
-
(private, static) parseFramesTime_(rateInfonon-null, text) → (nullable) {number}
-
Parses a TTML time in frame format
Parameters:
- Source:
Returns:
-
Type
-
number
-
(private, static) parseTickTime_(rateInfonon-null, text) → (nullable) {number}
-
Parses a TTML time in tick format
Parameters:
- Source:
Returns:
-
Type
-
number
-
(private, static) parseTime_(text, rateInfonon-null) → (nullable) {number}
-
Parses a TTML time from the given word.
Parameters:
- Source:
Returns:
-
Type
-
number
-
(private, static) parseTimeFromRegex_(regexnon-null, text) → (nullable) {number}
-
Parses a TTML time with a given regex. Expects regex to be some
sort of a time-matcher to match hours, minutes, seconds and milliseconds
Parameters:
Name |
Type |
Description |
regex |
RegExp
|
|
text |
string
|
|
- 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 |
ArrayBuffer
|
The data that makes up the init segment. |
- Implements:
- Source:
-
-
Parse a media segment and return the cues that make up the segment.
Parameters:
Name |
Type |
Description |
data |
ArrayBuffer
|
The next section of buffer. |
timeContext |
shakaExtern.TextParser.TimeContext
|
The time information that should be used to adjust the times values
for each cue. |
- Implements:
- Source:
Returns:
-
Type
-
Array.<!TextTrackCue>