YAACC - UPNP Client and Server
Loading...
Searching...
No Matches
de.yaacc.player.PlayerService Class Reference
Inheritance diagram for de.yaacc.player.PlayerService:
Inheritance graph
Collaboration diagram for de.yaacc.player.PlayerService:
Collaboration graph

Classes

class  PlayerServiceBinder
 

Public Member Functions

void onCreate ()
 
void registerMediaSession (MediaSession mediaSession)
 Register MediaSession from LocalMediaSessionPlayer.
 
void unregisterMediaSession (MediaSession mediaSession)
 Unregister MediaSession when player is destroyed.
 
void addPlayer (Player player)
 
void removePlayer (Player player)
 
void addPlayerListChangeListener (PlayerListChangeNotifier.Listener listener)
 Registers a listener that is told when a player is added to or removed from the active players.
 
void removePlayerListChangeListener (PlayerListChangeNotifier.Listener listener)
 
long getPlayerCreationSequence (Player player)
 Creation sequence of an active player: higher means added later.
 
void onDestroy ()
 
IBinder onBind (Intent intent)
 
MediaSession onGetSession (MediaSession.ControllerInfo controllerInfo)
 
Collection< Player > getPlayer ()
 
int onStartCommand (Intent intent, int flags, int startId)
 
HandlerThread getPlayerHandlerThread ()
 
Player getPlayer (int playerId)
 
List< Player > createPlayer (UpnpClient upnpClient, List< PlayableItem > items)
 Creates a player for the given content.
 
List< Player > createPlayerFor (UpnpClient upnpClient, List< PlayableItem > items, java.util.Collection< Device<?, ?, ?> > devices)
 Creates one player per given receiver for the items; the other receivers are not touched (add to playlist uses this for the chosen receivers that have no player yet).
 
List< Player > createQueuePlayers (UpnpClient upnpClient, PickedQueue.Result queue, java.util.Collection< Device<?, ?, ?> > devices)
 Creates the players of a picked queue: for each non-empty type (audio, video, image) one player per receiver, every player with its own items.
 
List< Player > createPlayerForLocalDevice (UpnpClient upnpClient, List< PlayableItem > items)
 Creates a player for the local device only (used by renderer service)
 
boolean onUnbind (Intent intent)
 
Player attachOpenHomePlayer (UpnpClient upnpClient, Device<?, ?, ?> device)
 Gives an OpenHome device that plays already a player that shows its playlist (see OpenHomePlayer#attach()).
 
Collection< Player > getCurrentPlayers ()
 returns all current players
 
Player getCurrentPlayerById (Integer id)
 
List< Player > getCurrentPlayersOfType (Class<?> typeClazz)
 returns all current players of the given type.
 
Player getFirstCurrentPlayerOfType (Class typeClazz)
 returns the first current player of the given type.
 
Class getPlayerClassForMimeType (String mimeType)
 Returns the class of a player for the given mime type.
 
void shutdown (Player player)
 Kills the given Player.
 
void shutdown ()
 Kill all Players.
 

Detailed Description

Author
Tobias Schoene (tobexyz)

Member Function Documentation

◆ addPlayerListChangeListener()

void de.yaacc.player.PlayerService.addPlayerListChangeListener ( PlayerListChangeNotifier.Listener listener)

Registers a listener that is told when a player is added to or removed from the active players.

Callbacks are delivered on the main thread, at most once per player for each direction. Registering the same listener twice has no effect.

The service keeps a strong reference to the listener until removePlayerListChangeListener is called, so callers tied to a view or fragment must unregister when it goes away. A notification queued before unregistering is not delivered to that listener.

Referenced by de.yaacc.upnp.UpnpClient.addPlayerListChangeListener().

Here is the caller graph for this function:

◆ attachOpenHomePlayer()

Player de.yaacc.player.PlayerService.attachOpenHomePlayer ( UpnpClient upnpClient,
Device<?, ?, ?> device )

Gives an OpenHome device that plays already a player that shows its playlist (see OpenHomePlayer#attach()).

Returns
the player of the device: the one it has, else a new one

Referenced by de.yaacc.upnp.UpnpClient.attachOpenHomePlayer().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ createPlayer()

List< Player > de.yaacc.player.PlayerService.createPlayer ( UpnpClient upnpClient,
List< PlayableItem > items )

Creates a player for the given content.

Based on the configuration settings in the upnpClient the player may be a player to play on a remote device.

Parameters
upnpClientthe upnpClient
itemsthe items to be played
Returns
the player

Referenced by de.yaacc.player.PlayerService.createPlayerFor(), de.yaacc.player.PlayerService.createPlayerForLocalDevice(), and de.yaacc.upnp.UpnpClient.initializePlayers().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ createQueuePlayers()

List< Player > de.yaacc.player.PlayerService.createQueuePlayers ( UpnpClient upnpClient,
PickedQueue.Result queue,
java.util.Collection< Device<?, ?, ?> > devices )

Creates the players of a picked queue: for each non-empty type (audio, video, image) one player per receiver, every player with its own items.

This phone plays audio and images straight from the picked content: uris; every other player gets placeholder items whose files are shared just in time (current and next item) for exactly its receiver and released again. The players are not started.

Referenced by de.yaacc.player.PlayerService.createQueuePlayers(), and de.yaacc.upnp.UpnpClient.initializeQueuePlayers().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getCurrentPlayers()

Collection< Player > de.yaacc.player.PlayerService.getCurrentPlayers ( )

returns all current players

Returns
the currentPlayer

Referenced by de.yaacc.upnp.UpnpClient.getCurrentPlayers().

Here is the caller graph for this function:

◆ getCurrentPlayersOfType()

List< Player > de.yaacc.player.PlayerService.getCurrentPlayersOfType ( Class<?> typeClazz)

returns all current players of the given type.

Parameters
typeClazzthe requested type
Returns
the currentPlayer

Referenced by de.yaacc.player.PlayerService.attachOpenHomePlayer(), and de.yaacc.upnp.UpnpClient.getCurrentPlayers().

Here is the caller graph for this function:

◆ getFirstCurrentPlayerOfType()

Player de.yaacc.player.PlayerService.getFirstCurrentPlayerOfType ( Class typeClazz)

returns the first current player of the given type.

Parameters
typeClazzthe requested type
Returns
the currentPlayer

◆ getPlayerClassForMimeType()

Class de.yaacc.player.PlayerService.getPlayerClassForMimeType ( String mimeType)

Returns the class of a player for the given mime type.

Parameters
mimeTypethe mime type
Returns
the player class

Referenced by de.yaacc.upnp.UpnpClient.getCurrentPlayers().

Here is the caller graph for this function:

◆ getPlayerCreationSequence()

long de.yaacc.player.PlayerService.getPlayerCreationSequence ( Player player)

Creation sequence of an active player: higher means added later.

Player ids can't tell that (AVTransportPlayer ids are random, local ids are fixed per type).

Returns
the sequence (> 0), or 0 if the player is not active

Referenced by de.yaacc.upnp.UpnpClient.getPlayerCreationSequence().

Here is the caller graph for this function:

◆ registerMediaSession()

void de.yaacc.player.PlayerService.registerMediaSession ( MediaSession mediaSession)

Register MediaSession from LocalMediaSessionPlayer.

Called when player connects to service.

◆ shutdown()

void de.yaacc.player.PlayerService.shutdown ( Player player)

Kills the given Player.

Parameters
playerthe player to shutdown

Referenced by de.yaacc.player.AbstractPlayer.exit(), de.yaacc.player.LocalImagePlayer.exit(), and de.yaacc.upnp.UpnpClient.shutdown().

Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this class was generated from the following file: