Constructor
new Loop(player, parent)
Creates an instance of the Loop component.
| Name | Type | Description |
|---|---|---|
player |
Player |
Reference to the VisionPlayer instance. |
parent |
Controller |
The parent container to which the fullscreen button will be appended. |
Members
private #player :Player
private #parent :Controller
Reference to the parent instance.
- Type
- Controller
- Source
- Loop.js, line 24
private #subscriptions :Array<number>
Holds tokens of subscriptions to player events, for later unsubscribe.
private #dom :DomSmith
Methods
private #onMediaReady()
Sets up the component as soon as the media is available. Disables display if media is a live stream.
- Listens
- media/ready
- Source
- Loop.js, line 84
private #onLoopChange()
Handler which updates the loop control when the media loop state changes.
- Listens
- media/loop
- Source
- Loop.js, line 95
private #toggleLoop()
Invoked when the user clicks on the checkbox, toggles loop state between 'on' and 'off'.
private #enable()
Enables the loop button functionality. This method listens to canplay events in order to restore a usable state again when the player recovered from a media error (for example by loading another file).
- Listens
- media/canplay
- Source
- Loop.js, line 115
private #disable()
Disables the button functionality. This method listens to media error events which cause the button to be disabled.
- Listens
- media/error
- data/nomedia
- Source
- Loop.js, line 126