java.lang.Object | |
↳ | com.neomades.media.PlayerManager |
A manager of many players.
This class provides a default main PlayerManager
thanks to the
getDefaultManager()
method. The returned instance contains all
created Player
in the application.
Note : the addPlayer(Player)
method is useless for this
instance, because the main manager will automatically have all the created
players.
Instead of using the Main Manager
, you could use a specific
player manager which contains a group of players.
The addPlayer(Player)
method will insert a player into a group.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
PlayerManager()
Creates a new player manager.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
void |
addPlayer(Player player)
Adds a player to the manager.
| ||||||||||
static PlayerManager |
getDefaultManager()
Returns the default manager that contains all created players.
| ||||||||||
int |
getMainVolume()
Returns the main volume level between 0 and 100.
| ||||||||||
boolean |
isMainMuted()
Returns if the manager has muted all players.
| ||||||||||
void |
pauseAll()
Pauses all the players.
| ||||||||||
void |
playAll()
Starts or resumes in parallel all the players.
| ||||||||||
void |
releaseAll()
Releases all the players.
| ||||||||||
void |
setMainMuted(boolean muted)
Set the main mute state for a group of players.
| ||||||||||
void |
setMainVolume(int volume)
Set the main volume for a group of players.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Creates a new player manager.
Adds a player to the manager.
player | the player to add |
---|
Returns the default manager that contains all created players.
To create and manage a specific group of players, another manager could be
created with the constructor : PlayerManager()
.
But this main manager continues to contain all created players.
Returns the main volume level between 0 and 100.
Returns if the manager has muted all players.
Pauses all the players.
Starts or resumes in parallel all the players.
Releases all the players.
The PlayerManager
is no longer available after calling this method.
Set the main mute state for a group of players.
If the mainMute is false, each track has a mute state. Otherwise, all the tracks are muted.
muted | true to mute all players |
---|
Set the main volume for a group of players.
The real volume of each track depends on two volume levels (the track volume and the main volume).
realVolume = mainVolume x trackVolume
By default, the mainVolume
and trackVolume
are
equal to 100.
If the volume given in parameter is less than zero, the volume will be 0. For values greater than 100 volume will be 100.
volume | level between 0 and 100 |
---|