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
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.- Inherited From:
 
 
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.- Overrides:
 
 - 
    
        
buildWrapperCSSClass() → {string}
 - 
    
    
Allow sub components to stack CSS class names for the wrapper element
Returns:
string -The constructed wrapper DOM
className- Overrides:
 
 - 
    
        
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
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()
 - 
    
    
Disable the
MenuButton. Don't allow it to be clicked.- 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:
 
 - 
    
        
handleBlur(event)
 - 
    
    
Called when a
MenuButtonloses focus. Turns off the listener forkeydownevents. Which Stopsthis.handleKeyPressfrom getting called.Parameters:
Name Type Description eventEventTarget~Event The
blurevent that caused this function to be called.Listens to Events:
- event:blur
 
- Inherited From:
 
 - 
    
        
handleClick(eventopt)
 - 
    
    
This gets called when an
PlaybackRateMenuButtonis "clicked". See ClickableComponent for more detailed information on what a click can be.Parameters:
Name Type Attributes Description eventEventTarget~Event <optional> 
The
keydown,tap, orclickevent that caused this function to be called.Listens to Events:
- event:tap
 - event:click
 
- Overrides:
 
 - 
    
        
handleFocus(event)
 - 
    
    
This gets called when a
MenuButtongains focus via afocusevent. Turns on listening forkeydownevents. When they happen it callsthis.handleKeyPress.Parameters:
Name Type Description eventEventTarget~Event The
focusevent that caused this function to be called.Listens to Events:
- event:focus
 
- Inherited From:
 
 - 
    
        
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.Listens to Events:
- event:keydown
 
- Inherited From:
 
 - 
    
        
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
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
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:
 
 - 
    
        
updateARIAAttributes()
 - 
    
    
Updates ARIA accessibility attributes
 - 
    
        
updateLabel(eventopt)
 - 
    
    
Update button label when rate changed
Parameters:
Name Type Attributes Description eventEventTarget~Event <optional> 
The event that caused this function to run.
Listens to Events:
 - 
    
        
updateVisibility(eventopt)
 - 
    
    
Hide playback rate controls when they're no playback rate options to select
Parameters:
Name Type Attributes Description eventEventTarget~Event <optional> 
The event that caused this function to run.
Listens to Events: