new VolumeBar(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
-
playerEvent :string
-
Call the update event for this Slider when this event happens on the player.
Methods
-
calculateDistance(event) → {number}
-
Calculate distance for slider
Parameters:
Name Type Description eventEventTarget~Event The event that caused this function to run.
Returns:
number -The current position of the Slider.
- postition.x for vertical `Slider`s - postition.y for horizontal `Slider`s- Inherited From:
-
checkMuted()
-
If the player is muted unmute it.
-
createEl() → {Element}
-
Create the
Component's DOM elementReturns:
Element -The element that was created.
- Overrides:
-
disable()
-
Disable controls for this slider if they are enabled
- Inherited From:
-
enable()
-
Enable controls for this slider if they are disabled
- Inherited From:
-
enabled() → {boolean}
-
Are controls are currently enabled for this slider or not.
Returns:
boolean -true if controls are enabled, false otherwise
- Inherited From:
-
getPercent() → {number}
-
Get percent of volume level
Returns:
number -Volume level percent as a decimal number.
-
handleBlur(event)
-
Handle a
blurevent on thisSlider.Parameters:
Name Type Description eventEventTarget~Event The
blurevent that caused this function to run.Listens to Events:
- event:blur
- Inherited From:
-
handleClick(event)
-
Listener for click events on slider, used to prevent clicks from bubbling up to parent elements like button menus.
Parameters:
Name Type Description eventObject Event that caused this object to run
- Inherited From:
-
handleFocus(event)
-
Handle a
focusevent on thisSlider.Parameters:
Name Type Description eventEventTarget~Event The
focusevent that caused this function to run.Listens to Events:
- event:focus
- Inherited From:
-
handleKeyPress(event)
-
Handle a
keydownevent on theSlider. Watches for left, rigth, up, and down arrow keys. This function will only be called when the slider has focus. See Slider#handleFocus and Slider#handleBlur.Parameters:
Name Type Description eventEventTarget~Event the
keydownevent that caused this function to run.Listens to Events:
- event:keydown
- Inherited From:
-
handleMouseDown(event)
-
Handle
mousedownortouchstartevents on theSlider.Parameters:
Name Type Description eventEventTarget~Event mousedownortouchstartevent that triggered this functionFires:
Listens to Events:
- event:mousedown
- event:touchstart
- Inherited From:
-
handleMouseMove(event)
-
Handle movement events on the VolumeMenuButton.
Parameters:
Name Type Description eventEventTarget~Event The event that caused this function to run.
Listens to Events:
- event:mousemove
- Overrides:
-
handleMouseUp(event)
-
Handle
mouseuportouchendevents on theSlider.Parameters:
Name Type Description eventEventTarget~Event mouseuportouchendevent that triggered this function.Fires:
Listens to Events:
- event:touchend
- event:mouseup
- Inherited From:
-
stepBack()
-
Decrease volume level for keyboard users
-
stepForward()
-
Increase volume level for keyboard users
-
update() → {number}
-
Update the progress bar of the
Slider.Returns:
number -The percentage of progress the progress bar represents as a number from 0 to 1.
- Inherited From:
-
updateARIAAttributes(eventopt)
-
Update ARIA accessibility attributes
Parameters:
Name Type Attributes Description eventEventTarget~Event <optional>
The
volumechangeevent that caused this function to run.Listens to Events:
-
vertical(boolopt) → {boolean}
-
Get/set if slider is horizontal for vertical
Parameters:
Name Type Attributes Description boolboolean <optional>
- true if slider is vertical,
- false is horizontal
Returns:
boolean -- true if slider is vertical, and getting
- false if the slider is horizontal, and getting
- Inherited From:
- true if slider is vertical,
Events
-
slideractive
-
Triggered when the slider is in an active state
Type:
- Inherited From:
-
sliderinactive
-
Triggered when the slider is no longer in an active state.
Type:
- Inherited From: