new TextTrackButton(player [, options])
Creates an instance of this class.
Parameters:
| Name | Type | Argument | Default | Description |
|---|---|---|---|---|
player |
Player | The |
||
options |
Object |
<optional> |
{} | The key/value store of player options. |
- Source:
- control-bar/text-track-controls/text-track-button.js
Extends
Members
-
<protected> hideThreshold_ :Number
-
Hide the menu if the number of items is less than or equal to this threshold. This defaults to 0 and whenever we add items which can be hidden to the menu we'll increment it. We list it here because every time we run
createMenuwe need to reset the value.Type:
- Number
- Inherited From:
- Overrides:
- Source:
- menu/menu-button.js
Methods
-
buildCSSClass()
-
Builds the default DOM
className.- Inherited From:
- Source:
- menu/menu-button.js
Returns:
The DOM
classNamefor this object.- Type
- string
-
createEl()
-
Create the
MenuButtonss DOM element.- Inherited From:
- Source:
- menu/menu-button.js
Returns:
The element that gets created.
- Type
- Element
-
createItems( [items])
-
Create a menu item for each text track
Parameters:
Name Type Argument Default Description itemsArray.<TextTrackMenuItem> <optional>
[] Existing array of items to use during creation
- Overrides:
- Source:
- control-bar/text-track-controls/text-track-button.js
Returns:
Array of menu items that were created
- Type
- Array.<TextTrackMenuItem>
-
createMenu()
-
Create the menu and add all items to it.
- Inherited From:
- Source:
- menu/menu-button.js
Returns:
The constructed menu
- Type
- Menu
-
disable()
-
Disable the
MenuButton. Don't allow it to be clicked.- Inherited From:
- Source:
- menu/menu-button.js
Returns:
Returns itself; method can be chained.
- Type
- MenuButton
-
enable()
-
Enable the
MenuButton. Allow it to be clicked.- Inherited From:
- Source:
- menu/menu-button.js
Returns:
Returns itself; method can be chained.
- Type
- MenuButton
-
handleClick(event)
-
Handle a click on a
MenuButton. See ClickableComponent#handleClick for instances where this is called.Parameters:
Name Type Description eventEventTarget~Event The
keydown,tap, orclickevent that caused this function to be called.- Inherited From:
- Source:
- menu/menu-button.js
Listens to Events:
- event:tap
- event:click
-
handleKeyPress(event)
-
Handle tab, escape, down arrow, and up arrow keys for
MenuButton. See ClickableComponent#handleKeyPress for instances where this is called.Parameters:
Name Type Description eventEventTarget~Event The
keydownevent that caused this function to be called.- Inherited From:
- Source:
- menu/menu-button.js
Listens to Events:
- event:keydown
-
handleSubmenuKeyPress(event)
-
Handle a
keydownevent on a sub-menu. The listener for this is added in the constructor.Parameters:
Name Type Description eventEventTarget~Event Key press event
- Inherited From:
- Source:
- menu/menu-button.js
Listens to Events:
- event:keydown
-
pressButton()
-
Put the current
MenuButtoninto a pressed state.- Inherited From:
- Source:
- menu/menu-button.js
-
unpressButton()
-
Take the current
MenuButtonout of a pressed state.- Inherited From:
- Source:
- menu/menu-button.js
-
update()
-
Update the menu based on the current state of its items.
- Inherited From:
- Source:
- menu/menu-button.js