public class PlayerRequest extends Object
To use this class the player has to meet a few criteria:
Identification playerID;
Playlist playlist;
List<ResourceModel> resources = PlayerRequest.createPlayerRequest(playlist, player, this) //create a new PlayerRequest
.map(PlayerRequest::resourcesForExisting) //creates the resources needed to add to the event
.orElseGet(ArrayList::new);
Modifier | Constructor and Description |
---|---|
protected |
PlayerRequest(TrackInfo trackInfo,
Playlist playlist,
boolean permanent,
Identification player,
Capabilities capabilities,
Context context,
Identifiable identifiable)
internal Constructor
|
protected |
PlayerRequest(TrackInfo trackInfo,
Playlist playlist,
boolean permanent,
Identification player,
Capabilities capabilities,
Context context,
Identifiable identifiable,
Volume volume)
internal Constructor
|
Modifier and Type | Method and Description |
---|---|
static Optional<PlayerRequest> |
createPlayerRequest(boolean permanent,
Identification player,
AddOnModule source)
creates a new PlayerRequest.
|
static Optional<PlayerRequest> |
createPlayerRequest(Playlist playlist,
boolean permanent,
Identification player,
AddOnModule source)
creates a new PlayerRequest.
|
static Optional<PlayerRequest> |
createPlayerRequest(Playlist playlist,
Identification player,
AddOnModule source)
creates a new PlayerRequest.
|
static Optional<PlayerRequest> |
createPlayerRequest(TrackInfo trackInfo,
boolean permanent,
Identification player,
AddOnModule source)
creates a new PlayerRequest.
|
static Optional<PlayerRequest> |
createPlayerRequest(TrackInfo trackInfo,
Identification player,
AddOnModule source)
creates a new PlayerRequest.
|
List<ResourceModel> |
resourcesForExisting()
returns a List of Resources that can be added to an already existing event.
|
boolean |
setVolume(Volume volume)
sets the Volume if the Player supports it.
|
PlayerRequest |
trySetVolume(Volume volume)
tries to set the Volume of the PlayerRequest.
|
protected PlayerRequest(TrackInfo trackInfo, Playlist playlist, boolean permanent, Identification player, Capabilities capabilities, Context context, Identifiable identifiable)
trackInfo
- the trackInfoplaylist
- the playlistpermanent
- whether the Request is permanentplayer
- the playercapabilities
- the capabilitiescontext
- the contextidentifiable
- the identifiableprotected PlayerRequest(TrackInfo trackInfo, Playlist playlist, boolean permanent, Identification player, Capabilities capabilities, Context context, Identifiable identifiable, Volume volume)
trackInfo
- the trackInfoplaylist
- the playlistpermanent
- whether the Request is permanentplayer
- the playercapabilities
- the capabilitiescontext
- the Contextidentifiable
- the identifiablevolume
- the Volume to set topublic boolean setVolume(Volume volume)
volume
- the Volume to set topublic PlayerRequest trySetVolume(Volume volume)
if the Player supports the Change of the Volume, it will create a new PlayerRequest and return it, if not it returns this.
volume
- the Volume to set topublic List<ResourceModel> resourcesForExisting()
This causes the Addon to block the Event in the OutputPlugin lifecycle of the Event.
public static Optional<PlayerRequest> createPlayerRequest(boolean permanent, Identification player, AddOnModule source)
For this method to return a non-empty Optional the following criteria must be met:
permanent
- true means the player can play indefinitely, but only if no one is currently using audio as
permanent. It will also not block. false is limited to 10 minutes playback, but will block.player
- the player to targetsource
- the addOnModule used for Context etc.public static Optional<PlayerRequest> createPlayerRequest(TrackInfo trackInfo, Identification player, AddOnModule source)
the resulting PlayerRequest is not permanent, which means that it will mute all other sound but is limited to
10 minutes.
For this method to return a non-empty Optional the following criteria must be met:
trackInfo
- the trackInfo to pass with the requestplayer
- the player to targetsource
- the addOnModule used for Context etc.public static Optional<PlayerRequest> createPlayerRequest(TrackInfo trackInfo, boolean permanent, Identification player, AddOnModule source)
For this method to return a non-empty Optional the following criteria must be met:
trackInfo
- the trackInfo to pass with the requestpermanent
- true means the player can play indefinitely, but only if no one is currently using audio as
permanent. It will also not block. false is limited to 10 minutes playback, but will block.player
- the player to targetsource
- the addOnModule used for Context etc.public static Optional<PlayerRequest> createPlayerRequest(Playlist playlist, Identification player, AddOnModule source)
the resulting PlayerRequest is not permanent, which means that it will mute all other sound but is limited to
10 minutes.
For this method to return a non-empty Optional the following criteria must be met:
playlist
- the playlist to pass with the requestplayer
- the player to targetsource
- the addOnModule used for Context etc.public static Optional<PlayerRequest> createPlayerRequest(Playlist playlist, boolean permanent, Identification player, AddOnModule source)
For this method to return a non-empty Optional the following criteria must be met:
playlist
- the playlist to pass with the requestpermanent
- true means the player can play indefinitely, but only if no one is currently using audio as
permanent. It will also not block. false is limited to 10 minutes playback, but will block.player
- the player to targetsource
- the addOnModule used for Context etc.Copyright © 2016. All rights reserved.