Class: VolumeBar

VolumeBar

The bar that contains the volume level and can be clicked on to adjust the level


new VolumeBar(player [, options])

Creates an instance of this class.

Parameters:
Name Type Argument Description
player Player

The Player that this class should be attached to.

options Object <optional>

The key/value store of player options.

Source:
control-bar/volume-control/volume-bar.js

Extends

Members


playerEvent :string

Call the update event for this Slider when this event happens on the player.

Type:
  • string
Source:
control-bar/volume-control/volume-bar.js

Methods


calculateDistance(event)

Calculate distance for slider

Parameters:
Name Type Description
event EventTarget~Event

The event that caused this function to run.

Inherited From:
Source:
slider/slider.js
Returns:

The current position of the Slider.

    - postition.x for vertical `Slider`s
    - postition.y for horizontal `Slider`s
Type
number

checkMuted()

If the player is muted unmute it.

Source:
control-bar/volume-control/volume-bar.js

createEl()

Create the Component's DOM element

Overrides:
Source:
control-bar/volume-control/volume-bar.js
Returns:

The element that was created.

Type
Element

getPercent()

Get percent of volume level

Source:
control-bar/volume-control/volume-bar.js
Returns:

Volume level percent as a decimal number.

Type
number

handleBlur(event)

Handle a blur event on this Slider.

Parameters:
Name Type Description
event EventTarget~Event

The blur event that caused this function to run.

Inherited From:
Source:
slider/slider.js
Listens to Events:
  • event:blur

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
event Object

Event that caused this object to run

Inherited From:
Source:
slider/slider.js

handleFocus(event)

Handle a focus event on this Slider.

Parameters:
Name Type Description
event EventTarget~Event

The focus event that caused this function to run.

Inherited From:
Source:
slider/slider.js
Listens to Events:
  • event:focus

handleKeyPress(event)

Handle a keydown event on the Slider. 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
event EventTarget~Event

the keydown event that caused this function to run.

Inherited From:
Source:
slider/slider.js
Listens to Events:
  • event:keydown

handleMouseDown(event)

Handle mousedown or touchstart events on the Slider.

Parameters:
Name Type Description
event EventTarget~Event

mousedown or touchstart event that triggered this function

Inherited From:
Source:
slider/slider.js
Fires:
Listens to Events:
  • event:mousedown
  • event:touchstart

handleMouseMove(event)

Handle movement events on the VolumeMenuButton.

Parameters:
Name Type Description
event EventTarget~Event

The event that caused this function to run.

Overrides:
Source:
control-bar/volume-control/volume-bar.js
Listens to Events:
  • event:mousemove

handleMouseUp(event)

Handle mouseup or touchend events on the Slider.

Parameters:
Name Type Description
event EventTarget~Event

mouseup or touchend event that triggered this function.

Inherited From:
Source:
slider/slider.js
Fires:
Listens to Events:
  • event:touchend
  • event:mouseup

stepBack()

Decrease volume level for keyboard users

Source:
control-bar/volume-control/volume-bar.js

stepForward()

Increase volume level for keyboard users

Source:
control-bar/volume-control/volume-bar.js

update()

Update the progress bar of the Slider.

Inherited From:
Source:
slider/slider.js

updateARIAAttributes( [event])

Update ARIA accessibility attributes

Parameters:
Name Type Argument Description
event EventTarget~Event <optional>

The volumechange event that caused this function to run.

Source:
control-bar/volume-control/volume-bar.js
Listens to Events:

vertical( [bool])

Get/set if slider is horizontal for vertical

Parameters:
Name Type Argument Description
bool boolean <optional>
  • true if slider is vertical,
     - false is horizontal
Inherited From:
Source:
slider/slider.js
Returns:
  • true if slider is vertical, and getting
      - false is horizontal, and getting
      - a reference to this object when setting
Type
boolean | Slider

Events


slideractive

Triggered when the slider is in an active state

Type: EventTarget~Event
Inherited From:
Source:
slider/slider.js

sliderinactive

Triggered when the slider is no longer in an active state.

Type: EventTarget~Event
Inherited From:
Source:
slider/slider.js