SeekBar(player, optionsopt)

Seek bar and container for the progress bars. Uses PlayProgressBar as its bar.

new SeekBar(player, optionsopt)

Creates an instance of this class.

Parameters:
Name Type Attributes Description
player Player

The Player that this class should be attached to.

options Object <optional>

The key/value store of player options.

Extends

Methods

calculateDistance(event) → {number}

Calculate distance for slider

Parameters:
Name Type Description
event EventTarget~Event

The event that caused this function to run.

Returns:
number -

The current position of the Slider.

    - position.x for vertical `Slider`s
    - position.y for horizontal `Slider`s
Inherited From:

createEl() → {Element}

Create the Component's DOM element

Returns:
Element -

The element that was created.

Overrides:

disable()

Disable controls for this slider if they are enabled

Overrides:

enable()

Enable controls for this slider if they are disabled

Overrides:

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 the percentage of media played so far.

Returns:
number -

The percentage of media played so far (0 to 1).

getProgress() → {number}

Get the percentage of the bar that should be filled but clamped and rounded.

Returns:
number -

percentage filled that the slider is

Inherited From:

handleAction(event)

Toggles the playback state of the player This gets called when enter or space is used on the seekbar

Parameters:
Name Type Description
event EventTarget~Event

The keydown event that caused this function to be called

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:

handleKeyDown(event)

Called when this SeekBar has focus and a key gets pressed down. Supports the following keys:

Space or Enter key fire a click event Home key moves to start of the timeline End key moves to end of the timeline Digit "0" through "9" keys move to 0%, 10% ... 80%, 90% of the timeline PageDown key moves back a larger step than ArrowDown PageUp key moves forward a large step

Parameters:
Name Type Description
event EventTarget~Event

The keydown event that caused this function to be called.

Listens to Events:
  • event:keydown
Overrides:

handleMouseDown(event)

Handle mouse down on seek bar

Parameters:
Name Type Description
event EventTarget~Event

The mousedown event that caused this to run.

Listens to Events:
  • event:mousedown
Overrides:

handleMouseMove(event)

Handle mouse move on seek bar

Parameters:
Name Type Description
event EventTarget~Event

The mousemove event that caused this to run.

Listens to Events:
  • event:mousemove
Overrides:

handleMouseUp(event)

Handle mouse up on seek bar

Parameters:
Name Type Description
event EventTarget~Event

The mouseup event that caused this to run.

Listens to Events:
  • event:mouseup
Overrides:

stepBack()

Move more quickly rewind for keyboard-only users

stepForward()

Move more quickly fast forward for keyboard-only users

update(eventopt) → {number}

This function updates the play progress bar and accessibility attributes to whatever is passed in.

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

The timeupdate or ended event that caused this to run.

Listens to Events:
Returns:
number -

The current percent at a number from 0-1

Overrides:

vertical(boolopt) → {boolean}

Get/set if slider is horizontal for vertical

Parameters:
Name Type Attributes Description
bool boolean <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:

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: