Constructor
new PlaybackRateMenuButton(player, optionsopt)
Creates an instance of this class.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
player |
Player | The |
|
options |
Object |
<optional> |
The key/value store of player options. |
Extends
Methods
-
buildCSSClass() → {string}
-
Builds the default DOM
className
.Returns:
string -The DOM
className
for this object.- Overrides:
-
createEl() → {Element}
-
Create the
Component
's DOM elementReturns:
Element -The element that was created.
- Overrides:
-
abstract createItems()
-
Create the list of menu items. Specific to each subclass.
- Inherited From:
-
createMenu() → {Menu}
-
Create the playback rate menu
- Overrides:
-
disable() → {MenuButton}
-
Disable the
MenuButton
. Don't allow it to be clicked.- Inherited From:
-
enable() → {MenuButton}
-
Enable the
MenuButton
. Allow it to be clicked.- Inherited From:
-
handleClick(eventopt)
-
This gets called when an
PlaybackRateMenuButton
is "clicked". See ClickableComponent for more detailed information on what a click can be.Parameters:
Name Type Attributes Description event
EventTarget~Event <optional>
The
keydown
,tap
, orclick
event that caused this function to be called.Listens to Events:
- event:tap
- event:click
- Overrides:
-
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 event
EventTarget~Event The
keydown
event that caused this function to be called.Listens to Events:
- event:keydown
- Inherited From:
-
handleSubmenuKeyPress(event)
-
Handle a
keydown
event on a sub-menu. The listener for this is added in the constructor.Parameters:
Name Type Description event
EventTarget~Event Key press event
Listens to Events:
- event:keydown
- Inherited From:
-
playbackRates() → {Array}
-
Get possible playback rates
Returns:
Array -All possible playback rates
-
playbackRateSupported() → {boolean}
-
Get whether playback rates is supported by the tech and an array of playback rates exists
Returns:
boolean -Whether changing playback rate is supported
-
pressButton()
-
Put the current
MenuButton
into a pressed state.- Inherited From:
-
unpressButton()
-
Take the current
MenuButton
out of a pressed state.- Inherited From:
-
update()
-
Update the menu based on the current state of its items.
- Inherited From:
-
updateARIAAttributes()
-
Updates ARIA accessibility attributes
-
updateLabel(eventopt)
-
Update button label when rate changed
Parameters:
Name Type Attributes Description event
EventTarget~Event <optional>
The event that caused this function to run.
Listens to Events:
- Player#event:ratechange
-
updateVisibility(eventopt)
-
Hide playback rate controls when they're no playback rate options to select
Parameters:
Name Type Attributes Description event
EventTarget~Event <optional>
The event that caused this function to run.
Listens to Events: