new TextTrackDisplay(player [, options] [, ready])
Creates an instance of this class.
Parameters:
Name | Type | Argument | Description |
---|---|---|---|
player |
Player | The |
|
options |
Object |
<optional> |
The key/value store of player options. |
ready |
Component~ReadyCallback |
<optional> |
The function to call when |
Extends
- Component
Methods
-
clearDisplay()
-
Clear all displayed TextTracks.
-
createEl()
-
Create the Component's DOM element.
Returns:
The element that was created.
- Type
- Element
-
getSafariStyle(overrides)
-
getSafariStyle
Parameters:
Name Type Description overrides
Object Returns:
style
- Type
- Object
-
getStyle(overrides)
-
getStyle
Parameters:
Name Type Description overrides
Object Returns:
style
- Type
- Object
-
preselectTrack()
-
Preselect a track following this precedence:
- matches the previously selected TextTrack's language and kind
- matches the previously selected TextTrack's language only
- is the first default captions track
- is the first default descriptions track
Listens to Events:
- Player#event:loadstart
-
removeStyles(styleName)
-
removeStyles
Parameters:
Name Type Description styleName
string Returns:
style Element
- Type
- Element
-
toggleDisplay()
-
Turn display of TextTrack's from the current state into the other state.
There are only two states:- 'shown'
- 'hidden'
Listens to Events:
- Player#event:loadstart
-
updateDisplay()
-
Update the displayed TextTrack when a either a Player#texttrackchange or
a Player#fullscreenchange is fired.Listens to Events:
- Player#event:texttrackchange
- Player#event:fullscreenchange
-
updateForTrack(track)
-
Add an Texttrack to to the Techs TextTrackList.
Parameters:
Name Type Description track
TextTrack Text track object to be added to the list.
-
writeStyles(styleName, cssText)
-
writeStyles
Parameters:
Name Type Description styleName
string cssText
string