Package com.bambuser.broadcaster
Enum PlayerState
- java.lang.Object
-
- java.lang.Enum<PlayerState>
-
- com.bambuser.broadcaster.PlayerState
-
- All Implemented Interfaces:
Serializable
,Comparable<PlayerState>
public enum PlayerState extends Enum<PlayerState>
ABroadcastPlayer
instance will always be in one of these states. See theonStateChange(state)
callback or thegetState()
method.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description BUFFERING
Playback is interrupted and the player is buffering data.CLOSED
This BroadcastPlayer instance has been closed and all system resources freed.COMPLETED
The player reached the end of the loaded broadcast successfully.CONSTRUCTION
The player instance is constructed and optional parameters can be set.ERROR
Playback failed, likely due to a network error.LOADING
The player is negotiating with the server about available formats, and should move on to buffering soon.PAUSED
The player is paused.PLAYING
The player is actively playing a stream.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static PlayerState
valueOf(String name)
Returns the enum constant of this type with the specified name.static PlayerState[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
CONSTRUCTION
public static final PlayerState CONSTRUCTION
The player instance is constructed and optional parameters can be set. CallBroadcastPlayer.load()
to transition toLOADING
.
-
LOADING
public static final PlayerState LOADING
The player is negotiating with the server about available formats, and should move on to buffering soon. If the broadcast is not immediately available (for example if the video needs to be converted to another format), the player will wait and continue automatically when the broadcast becomes available.
-
BUFFERING
public static final PlayerState BUFFERING
-
PLAYING
public static final PlayerState PLAYING
The player is actively playing a stream.
-
PAUSED
public static final PlayerState PAUSED
The player is paused. Usestart()
to resume playback.
-
COMPLETED
public static final PlayerState COMPLETED
The player reached the end of the loaded broadcast successfully. All buffered audio and video should now have finished playing. If the loaded broadcast is an archived broadcast, it is possible to replay usingstart()
. If the loaded broadcast was live, this is practically the final state. Useclose()
to free all system resources. If playback of the archived version is desired, useBroadcastPlayer(...)
to load the archived broadcast.
-
ERROR
public static final PlayerState ERROR
Playback failed, likely due to a network error. This is a final state. Useclose()
to free all system resources.
-
CLOSED
public static final PlayerState CLOSED
This BroadcastPlayer instance has been closed and all system resources freed. The instance should no longer be used.
-
-
Method Detail
-
values
public static PlayerState[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (PlayerState c : PlayerState.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static PlayerState valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
-