- Version
- 1.0.0
- License
- MIT
- Requires
- DomSmith
- Source
- Spinner.js, line 13
Constructor
new Spinner(player, parent)
Members
private #config :Object
Holds the instance configuration for this component.
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
delay
|
number | optional | 1 | Delay (in seconds) after which the spinner animation is shown. Used to prevent superfluous showing when the stall period is very short. |
- Type
- Object
- Source
- Spinner.js, line 20
private #player :Player
Reference to the main player instance.
- Type
- Player
- Source
- Spinner.js, line 28
private #subscriptions :Array<number>
Holds tokens of subscriptions to player events, for later unsubscribe.
- Type
- Array<number>
- Source
- Spinner.js, line 34
private #dom :DomSmith
A DomSmith instance used to create the spinner DOM.
- Type
- DomSmith
- Source
- Spinner.js, line 40
private #state :string
Spinner state (i.e. "visible" or "hidden") is stored here. Used to prevent double triggering hide() or show().
- Type
- string
- Source
- Spinner.js, line 46
private #timeOutId :number
Holds the setTimeout id.
- Type
- number
- Source
- Spinner.js, line 52
Methods
private #show()
Shows the spinner after the configured delay, if not already visible.
- Listens
- media/stall/begin
- spinner/show
- Source
- Spinner.js, line 97
private #hide()
Hides the spinner, if not already hidden.
- Listens
- media/stall/end
- spinner/hide
- Source
- Spinner.js, line 117
destroy()
This method removes all events, subscriptions and DOM nodes created by this component.
- Source
- Spinner.js, line 135
Events
spinner/show
The Spinner component listens for this event to show the spinner.
- Listeners
- Spinner#show
- Source
- Spinner.js, line 146
spinner/hide
The Spinner component listens for this event to hide the spinner.
- Listeners
- Spinner#hide
- Source
- Spinner.js, line 151