Enum PlaybackState

java.lang.Object
java.lang.Enum<PlaybackState>
com.castlabs.android.player.state.PlaybackState
All Implemented Interfaces:
Serializable, Comparable<PlaybackState>

public enum PlaybackState extends Enum<PlaybackState>
Playback states shared across castLabs player SDKs.

This model provides a common state machine for applications using different castLabs players. Its states and transitions have the same meaning across those players. It is separate from the legacy Android-specific PlayerController.State model. Read the current state with PlayerController.getPlaybackState().

A state described as transient is an intermediate step. It remains the current state until the player confirms the next step, so it is not necessarily short-lived.

  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description
    Playback is waiting for more media data.
    Playback or a seek reached the end of the content.
    Playback stopped because of a fatal error.
    No content is loaded or being opened.
    An open request was accepted and content information is being loaded.
    Playback can continue but is stably paused.
    The player is moving toward a stable paused state.
    Playback was requested but the playback position is not moving yet.
    The playback position is moving.
    The content track information is available and can be queried.
    An accepted change of playback position is being completed.
    Content and its playback resources are being unloaded.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the enum constant of this type with the specified name.
    static PlaybackState[]
    Returns an array containing the constants of this enum type, in the order they are declared.

    Methods inherited from class java.lang.Enum

    compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • Idle

      public static final PlaybackState Idle
      No content is loaded or being opened. This is the initial state.
    • Stopping

      public static final PlaybackState Stopping
      Content and its playback resources are being unloaded.

      This is a transient state that normally ends in Idle.

    • Opening

      public static final PlaybackState Opening
      An open request was accepted and content information is being loaded.

      This is a transient state that normally ends in Ready.

    • Error

      public static final PlaybackState Error
      Playback stopped because of a fatal error.

      This is a transient state in the Android implementation. A fatal error automatically releases the player, producing Error -> Stopping -> Idle.

    • Ready

      public static final PlaybackState Ready
      The content track information is available and can be queried.

      This is a transient milestone before the current data state is reported.

    • Seeking

      public static final PlaybackState Seeking
      An accepted change of playback position is being completed.

      This is a transient state while the seek result is being determined.

    • Buffering

      public static final PlaybackState Buffering
      Playback is waiting for more media data.

      This is a transient state, but it can last as long as the required data is unavailable.

    • Play

      public static final PlaybackState Play
      Playback was requested but the playback position is not moving yet.

      This is a transient state that normally ends in Playing.

    • Playing

      public static final PlaybackState Playing
      The playback position is moving.
    • Pausing

      public static final PlaybackState Pausing
      The player is moving toward a stable paused state.

      This is a transient state that normally ends in Paused.

    • Paused

      public static final PlaybackState Paused
      Playback can continue but is stably paused.
    • Ended

      public static final PlaybackState Ended
      Playback or a seek reached the end of the content.
  • Method Details

    • values

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

      public static PlaybackState 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 name
      NullPointerException - if the argument is null