- Version
- 1.0.0
- License
- MIT
- Requires
- DomSmith
- Source
- AirPlay.js, line 13
Constructor
new AirPlay(player, parent, optionsopt)
Creates an instance of the AirPlay component.
| Name | Type | Attributes | Description | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
player |
Player |
Reference to the VisionPlayer instance. |
|||||||||
parent |
Controller |
Reference to the parent instance. |
|||||||||
options |
Object | optional |
Additional options.
|
Members
private #config :Object
Configuration options for the AirPlay component.
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
showControllerButton
|
boolean | optional | true | Shows or hides the controller button. |
showMenuButton
|
boolean | optional | true | Shows or hides the menu button. |
- Type
- Object
- Source
- AirPlay.js, line 21
private #player :Player
Reference to the main player instance.
- Type
- Player
- Source
- AirPlay.js, line 30
private #subscriptions :Array<number>
Holds tokens of subscriptions to player events, for later unsubscribe.
- Type
- Array<number>
- Source
- AirPlay.js, line 36
private #apiKey :symbol
Secret key only known to the player instance and initialized components. Used to be able to restrict access to API methods in conjunction with secure mode.
- Type
- symbol
- Source
- AirPlay.js, line 43
private #buttonMenu :DomSmith
private #buttonController :DomSmith
private #currentSource :Media~metaData
Stores the currently active stream object used for AirPlay.
- Type
- Media~metaData
- Source
- AirPlay.js, line 61
private #remote :RemotePlayback
Reference to the native RemotePlayback API interface provided by the video element.
- Type
- RemotePlayback
- Source
- AirPlay.js, line 67
private #savedSrc :string
Saved stream source when replacing streams for restoring later.
- Type
- string
- Source
- AirPlay.js, line 73
private #callbackId :number
Stores the callback identifier used by RemotePlayback API to manage availability watches.
- Type
- number
- Source
- AirPlay.js, line 79
Methods
private #onMediaReady(metaData)
Called when Video is ready for playback. Sets up the remote (if available).
| Name | Type | Description |
|---|---|---|
metaData |
Media~metaData |
The currently selected metaData. |
- Listens
- media/ready
- Source
- AirPlay.js, line 167
private #updateRemoteState()
Called whenever the RemotePlayback state changes.
- Source
- AirPlay.js, line 207
private #showAirPlayMenu(event)
Shows the AirPlay menu (natively rendered by the OS). Tries to use the remote API if possible. If connected via the remote API, tries to switch to a non-AV1 stream if possible.
| Name | Type | Description |
|---|---|---|
event |
Event |
The original click event. |
- Source
- AirPlay.js, line 251
private #onAvailability(event)
Invoked when AirPlay availability changes.
| Name | Type | Description |
|---|---|---|
event |
Event |
The original WebKitPlaybackTargetAvailabilityEvent. |
- Listens
- event:webkitplaybacktargetavailabilitychanged
- Source
- AirPlay.js, line 299
private #onAirPlayStatusChanged()
Invoked when AirPlay status changes, i.e., the user has activated or deactivated AirPlay.
- Fires
- airplay/start
- airplay/stop
- Source
- AirPlay.js, line 328
destroy()
Removes all events, subscriptions, and DOM nodes created by this component.
- Source
- AirPlay.js, line 342
Events
airplay/start
This event is fired when AirPlay was started.
- Listeners
- PictureInPicture#disable
- VisualizerAmbient#stopLoop
- Source
- AirPlay.js, line 366
airplay/stop
This event is fired when AirPlay was stopped.
- Listeners
- PictureInPicture#enable
- VisualizerAmbient#startLoop
- Source
- AirPlay.js, line 371