Enum Class PlayerState

java.lang.Object
java.lang.Enum<PlayerState>
com.bambuser.broadcaster.PlayerState
All Implemented Interfaces:
Serializable, Comparable<PlayerState>, java.lang.constant.Constable

public enum PlayerState extends Enum<PlayerState>
A BroadcastPlayer instance will always be in one of these states. See the onStateChange(state) callback or the getState() method.
  • Enum Constant Details

    • CONSTRUCTION

      public static final PlayerState CONSTRUCTION
      The player instance is constructed and optional parameters can be set. Call BroadcastPlayer.load() to transition to LOADING.
    • 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
      Playback is interrupted and the player is buffering data. This intermittent state can be considered a sub-state of PLAYING, as the player is not considered PAUSED. It can occur at the beginning and in the middle of playback, and the player should normally transition to PLAYING automatically.
    • PLAYING

      public static final PlayerState PLAYING
      The player is actively playing a stream.
    • PAUSED

      public static final PlayerState PAUSED
      The player is paused. Use start() 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 using start(). If the loaded broadcast was live, this is practically the final state. Use close() to free all system resources. If playback of the archived version is desired, use BroadcastPlayer(...) to load the archived broadcast.
    • ERROR

      public static final PlayerState ERROR
      Playback failed, likely due to a network error. This is a final state. Use close() 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 Details

    • values

      public static PlayerState[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static PlayerState valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified name
      NullPointerException - if the argument is null