Playback
Direct Subclass:
There should be one instance of Playback per page
This class is in charge of handling the playback of the active player it receives the commands from its Host and communicates the accordingly to the player.
It's also the responsible for exposing all the getters necessary to conform the Payload message.
By default all properties of Payload are extracted from the this.activePlayer although it is expected that this functionality is overridden by the providers.
Constructor Summary
Public Constructor | ||
public |
Create a new instance |
Member Summary
Public Members | ||
public |
The current player being shown by the MPRIS2 interface |
|
public |
A dictionary of any controls extracted from the DOM |
Method Summary
Public Methods | ||
public |
Check current page for 'next' functionality |
|
public |
Check current page for 'previous' functionality |
|
public |
getIdentity(): null | string Get the identity of playback, by default it is the site's domain |
|
public |
Get the loop status of playback |
|
public |
getPosition(): null | number COMMAND Get active player's position |
|
public |
Get the rate of playback |
|
public |
One of PlaybackStatus.PLAYING or PlaybackStatus.PAUSED |
|
public |
Get the volume of playback |
|
public |
Get if the playback is shuffling between tracks |
|
public |
next() Go to next media This should be implemented per provider |
|
public |
pause() COMMAND Pause active player |
|
public |
play() COMMAND Start to play active player |
|
public |
previous() Go to previous This should be implemented per provider |
|
public |
COMMAND Seek activePlayer to offset |
|
public |
setActivePlayer(player: Player) Set the current active player |
|
public |
setLoopStatus(status: LoopStatus) By default we don't support playlist looping (LoopStatus.PLAYLIST) so we force LoopStatus.TRACK loop if any loop other than LoopStatus.NONE is specified |
|
public |
setPosition(id: string, position: number) COMMAND Set current position of active player |
|
public |
Set the rate of playback. |
|
public |
setShuffle(isShuffle: boolean) Set the shuffle between tracks of playback |
|
public |
Set the volume of playback |
|
public |
stop() COMMAND Stop active player |
|
public |
COMMAND Toggle the fullscreen state |
|
public |
COMMAND Toggle between play and pause |
Public Constructors
Public Members
Public Methods
public getIdentity(): null | string source
Get the identity of playback, by default it is the site's domain
public seek(offset: number) source
COMMAND Seek activePlayer to offset
Params:
Name | Type | Attribute | Description |
offset | number |
public setActivePlayer(player: Player) source
Set the current active player
Params:
Name | Type | Attribute | Description |
player | Player |
public setLoopStatus(status: LoopStatus) source
By default we don't support playlist looping (LoopStatus.PLAYLIST) so we force LoopStatus.TRACK loop if any loop other than LoopStatus.NONE is specified
Params:
Name | Type | Attribute | Description |
status | LoopStatus |
public setPosition(id: string, position: number) source
COMMAND Set current position of active player
public setRate(rate: number) source
Set the rate of playback.
Params:
Name | Type | Attribute | Description |
rate | number |
Example:
playback.setRate(1.5);
public setShuffle(isShuffle: boolean) source
Set the shuffle between tracks of playback
Params:
Name | Type | Attribute | Description |
isShuffle | boolean |