Class PlaybackStateChange

java.lang.Object
com.castlabs.android.player.state.PlaybackStateChange

public final class PlaybackStateChange extends Object
Details about a change in the playback state model shared across castLabs player SDKs.

A change has no reason when the shared state model does not define one for that transition. In that case, getReason() returns null.

  • Field Details

    • KEY_CURRENT_POSITION_MS

      public static final String KEY_CURRENT_POSITION_MS
      Seek source position in milliseconds.
      See Also:
    • KEY_TARGET_POSITION_MS

      public static final String KEY_TARGET_POSITION_MS
      Seek target position in milliseconds.
      See Also:
  • Method Details

    • getPreviousState

      @NonNull public PlaybackState getPreviousState()
      Returns the state before this change.
      Returns:
      previous state
    • getCurrentState

      @NonNull public PlaybackState getCurrentState()
      Returns the state after this change.
      Returns:
      current state
    • getReason

      @Nullable public PlaybackStateTransitionReason getReason()
      Returns why the state changed, when a reason is available.
      Returns:
      transition reason, or null when no reason applies
    • getMetadata

      @NonNull public Bundle getMetadata()
      Returns a copy of the extra data for this state change.
      Returns:
      non-null state change data