new TextTrackButton(player, optionsopt)
Creates an instance of this class.
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
player |
Player | The |
||
options |
Object |
<optional> |
{} | The key/value store of player options. |
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.- Overrides:
Methods
-
blur()
-
Remove the focus from the actual button, not this element
- Inherited From:
-
buildCSSClass() → {string}
-
Builds the default DOM
className.Returns:
string -The DOM
classNamefor this object.- Inherited From:
-
buildWrapperCSSClass() → {string}
-
Allow sub components to stack CSS class names for the wrapper element
Returns:
string -The constructed wrapper DOM
className- Inherited From:
-
controlText(textopt, elopt) → {string}
-
Get or set the localized control text that will be used for accessibility.
NOTE: This will come from the internal
menuButton_element.Parameters:
Name Type Attributes Default Description textstring <optional>
Control text for element.
elElement <optional>
this.menuButton_.el() Element to set the title on.
Returns:
string -- The control text when getting
- Inherited From:
-
createEl() → {Element}
-
Create the
MenuButtonss DOM element.Returns:
Element -The element that gets created.
- Inherited From:
-
createItems(itemsopt) → {Array.<TextTrackMenuItem>}
-
Create a menu item for each text track
Parameters:
Name Type Attributes Default Description itemsArray.<TextTrackMenuItem> <optional>
[] Existing array of items to use during creation
- Overrides:
-
createMenu() → {Menu}
-
Create the menu and add all items to it.
- Inherited From:
-
disable()
-
Disable the
MenuButton. Don't allow it to be clicked.- Inherited From:
-
dispose()
-
Dispose of the
menu-buttonand all child components.- Inherited From:
-
enable()
-
Enable the
MenuButton. Allow it to be clicked.- Inherited From:
-
focus()
-
Set the focus to the actual button, not to this element
- Inherited From:
-
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.Listens to Events:
- event:tap
- event:click
- Inherited From:
-
handleKeyDown(event)
-
Handle tab, escape, down arrow, and up arrow keys for
MenuButton. See ClickableComponent#handleKeyDown for instances where this is called.Parameters:
Name Type Description eventEventTarget~Event The
keydownevent that caused this function to be called.Listens to Events:
- event:keydown
- Inherited From:
-
handleMenuKeyUp(event)
-
Handle a
keyupevent on aMenuButton. The listener for this is added in the constructor.Parameters:
Name Type Description eventEventTarget~Event Key press event
Listens to Events:
- event:keyup
- Inherited From:
-
handleMouseLeave(event)
-
Handle
mouseleaveforMenuButton.Parameters:
Name Type Description eventEventTarget~Event The
mouseleaveevent that caused this function to be called.Listens to Events:
- event:mouseleave
- Inherited From:
-
handleSubmenuKeyDown(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
Listens to Events:
- event:keydown
- Inherited From:
-
handleSubmenuKeyPress(event)
-
This method name now delegates to
handleSubmenuKeyDown. This means anyone callinghandleSubmenuKeyPresswill not see their method calls stop working.Parameters:
Name Type Description eventEventTarget~Event The event that caused this function to be called.
- Inherited From:
-
pressButton()
-
Put the current
MenuButtoninto a pressed state.- Inherited From:
-
unpressButton()
-
Take the current
MenuButtonout of a pressed state.- Inherited From:
-
update()
-
Update the menu based on the current state of its items.
- Inherited From: