Class: ChaptersButton

ChaptersButton

The button component for toggling and selecting chapters Chapters act much differently than other text tracks Cues are navigation vs. other tracks of alternative languages


new ChaptersButton(player [, options] [, ready])

Creates an instance of this class.

Parameters:
Name Type Argument Description
player Player

The Player that this class should be attached to.

options Object <optional>

The key/value store of player options.

ready Component~ReadyCallback <optional>

The function to call when this function is ready.

Source:
control-bar/text-track-controls/chapters-button.js

Extends

Methods


buildCSSClass()

Builds the default DOM className.

Source:
control-bar/text-track-controls/chapters-button.js
Returns:

The DOM className for this object.

Type
string

createItems()

Create a menu item for each text track

Overrides:
Source:
control-bar/text-track-controls/chapters-button.js
Returns:

Array of menu items

Type
Array.<TextTrackMenuItem>

createMenu()

Create menu from chapter track

Source:
control-bar/text-track-controls/chapters-button.js
Returns:

New menu for the chapter buttons

Type
Menu

findChaptersTrack()

Find the track object that is currently in use by this ChaptersButton

Source:
control-bar/text-track-controls/chapters-button.js
Returns:

The current track or undefined if none was found.

Type
TextTrack | undefined

getMenuCaption()

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.

Source:
control-bar/text-track-controls/chapters-button.js
Returns:

The tracks current label or the localized track kind.

Type
string

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.

Source:
control-bar/text-track-controls/chapters-button.js

update( [event])

Update the menu based on the current state of its items.

Parameters:
Name Type Argument Description
event EventTarget~Event <optional>

An event that triggered this function to run.

Source:
control-bar/text-track-controls/chapters-button.js
Listens to Events: