new ChaptersButton(player, optionsopt, readyopt)
Creates an instance of this class.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
player |
Player | The |
|
options |
Object |
<optional> |
The key/value store of player options. |
ready |
Component~ReadyCallback |
<optional> |
The function to call when this function is ready. |
Extends
Methods
-
buildCSSClass() → {string}
-
Builds the default DOM
className
.Returns:
string -The DOM
className
for this object. -
createItems() → {Array.<TextTrackMenuItem>}
-
Create a menu item for each text track
- Overrides:
-
createMenu() → {Menu}
-
Create menu from chapter track
-
findChaptersTrack() → {TextTrack|undefined}
-
Find the track object that is currently in use by this ChaptersButton
-
getMenuCaption() → {string}
-
Get the caption for the ChaptersButton based on the track label. This will also use the current tracks localized kind as a fallback if a label does not exist.
Returns:
string -The tracks current label or the localized track kind.
-
setTrack(track)
-
Set the currently selected track for the chapters button.
Parameters:
Name Type Description track
TextTrack The new track to select. Nothing will change if this is the currently selected track.
-
update(eventopt)
-
Update the menu based on the current state of its items.
Parameters:
Name Type Attributes Description event
EventTarget~Event <optional>
An event that triggered this function to run.
Listens to Events: