- Version
- 1.0.0
- License
- MIT
- Requires
- DomSmith
- sortElements
- Source
- Controller.js, line 14
Constructor
new Controller(player, parent, optionsopt)
Creates an instance of the Controller component.
Members
private #player :Player
Reference to the main player instance.
- Type
- Player
- Source
- Controller.js, line 20
private #subscriptions :Array<number>
Holds tokens of subscriptions to player events, for later unsubscribe.
- Type
- Array<number>
- Source
- Controller.js, line 26
private #dom :DomSmith
Reference to the DomSmith instance used to manage DOM elements.
- Type
- DomSmith
- Source
- Controller.js, line 32
private #rootEle :HTMLElement
Reference to the root player element.
- Type
- HTMLElement
- Source
- Controller.js, line 38
private #resizeId :number
Timeout ID for debounced resize logic.
- Type
- number
- Source
- Controller.js, line 44
Methods
private #sortButtons()
Sorts child nodes of a container according to data-sort logic.
- Listens
- dom/beforemount
- Source
- Controller.js, line 111
private #show()
As soon as the UI is shown, show the controller as well.
- Listens
- ui/show
- Source
- Controller.js, line 123
private #hide()
As soon as the UI is hidden, hide the controller as well.
- Listens
- ui/hide
- Source
- Controller.js, line 134
resize()
On resize, update the space the controller blocks at the bottom of the player viewport.
- Listens
- ui/resize
- Source
- Controller.js, line 145
getElement(area) → HTMLElement
Used by child components to retrieve a container element they can attach.
| Name | Type | Description |
|---|---|---|
area |
'left' | 'center' | 'right' |
Which logical area to retrieve. |
- Returns
-
A reference to the container DOM node.
- Type HTMLElement
- Source
- Controller.js, line 162
destroy()
This method removes all events, subscriptions and DOM nodes created by this component.
- Source
- Controller.js, line 171