new SeekBar(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 event
EventTarget~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:
-
createEl() → {Element}
-
Create the
Component
's DOM elementReturns:
Element -The element that was created.
- Overrides:
-
getPercent() → {number}
-
Get the percentage of media played so far.
Returns:
number -The percentage of media played so far (0 to 1).
-
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 -
handleBlur(event)
-
Handle a
blur
event on thisSlider
.Parameters:
Name Type Description event
EventTarget~Event The
blur
event 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 event
Object Event that caused this object to run
- Inherited From:
-
handleFocus(event)
-
Handle a
focus
event on thisSlider
.Parameters:
Name Type Description event
EventTarget~Event The
focus
event that caused this function to run.Listens to Events:
- event:focus
- Inherited From:
-
handleKeyPress(event)
-
Called when this SeekBar has focus and a key gets pressed down. By default it will call
this.handleAction
when the key is space or enter.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)
-
Update the seek bar's UI.
Parameters:
Name Type Attributes Description event
EventTarget~Event <optional>
The
timeupdate
orended
event that caused this to run.Listens to Events:
- 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:
- 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: