SimpleBasePlayer.State


protected final class SimpleBasePlayer.State


An immutable state description of the player.

Summary

Nested types

A builder for State objects.

Public fields

final SimpleBasePlayer.PositionSupplier

The PositionSupplier for the estimated position up to which the currently playing ad is buffered, in milliseconds.

final SimpleBasePlayer.PositionSupplier

The PositionSupplier for the current ad playback position in milliseconds.

final AudioAttributes

The current AudioAttributes.

final Player.Commands

The available Commands.

final SimpleBasePlayer.PositionSupplier

The PositionSupplier for the estimated position up to which the currently playing content is buffered, in milliseconds, or TIME_UNSET to indicate the default start position.

final SimpleBasePlayer.PositionSupplier

The PositionSupplier for the current content playback position in milliseconds, or TIME_UNSET to indicate the default start position.

final int

The current ad group index, or INDEX_UNSET if no ad is playing.

final int

The current ad index in the ad group, or INDEX_UNSET if no ad is playing.

final CueGroup

The current cues.

final int

The current media item index, or INDEX_UNSET to assume the default first item of the playlist is played.

final DeviceInfo

The DeviceInfo.

final @IntRange(from = 0) int

The current device volume.

final long

The position, in milliseconds, in the current content or ad from which playback continued after the discontinuity.

final boolean

Signals that a position discontinuity happened since the last update to the player.

final boolean

Whether the device is muted.

final boolean

Whether the player is currently loading its source.

final long

The maximum position for which seekToPrevious seeks to the previous item, in milliseconds.

final boolean

Whether a frame has been rendered for the first time since setting the surface, a rendering reset, or since the stream being rendered was changed.

final boolean

Whether playback should proceed when ready and not suppressed.

final int

The last reason for changing playWhenReady.

final PlaybackParameters

The currently active PlaybackParameters.

final int

The state of the player.

final int

The reason why playback is suppressed even if getPlayWhenReady is true.

final @Nullable PlaybackException

The last error that caused playback to fail, or null if there was no error.

final ImmutableList<SimpleBasePlayer.MediaItemData>

The media items in the playlist.

final MediaMetadata

The playlist MediaMetadata.

final int

The reason for the last position discontinuity.

final int

The RepeatMode used for playback.

final long

The seekBack increment in milliseconds.

final long

The seekForward increment in milliseconds.

final boolean

Whether shuffling of media items is enabled.

final Size

The size of the surface onto which the video is being rendered.

final Metadata

The most recent timed metadata.

final Timeline

The Timeline derived from the playlist.

final SimpleBasePlayer.PositionSupplier

The PositionSupplier for the estimated total buffered duration in milliseconds.

final TrackSelectionParameters

The currently active TrackSelectionParameters.

final VideoSize

The current video size.

final @FloatRange(from = 0, to = 1.0) float

The current audio volume, with 0 being silence and 1 being unity gain (signal unchanged).

Public methods

SimpleBasePlayer.State.Builder

Returns a Builder pre-populated with the current state values.

boolean
int

Public fields

adBufferedPositionMsSupplier

public final SimpleBasePlayer.PositionSupplier adBufferedPositionMsSupplier

The PositionSupplier for the estimated position up to which the currently playing ad is buffered, in milliseconds. The value is unused if no ad is playing.

adPositionMsSupplier

public final SimpleBasePlayer.PositionSupplier adPositionMsSupplier

The PositionSupplier for the current ad playback position in milliseconds. The value is unused if no ad is playing.

audioAttributes

public final AudioAttributes audioAttributes

The current AudioAttributes.

availableCommands

public final Player.Commands availableCommands

The available Commands.

contentBufferedPositionMsSupplier

public final SimpleBasePlayer.PositionSupplier contentBufferedPositionMsSupplier

The PositionSupplier for the estimated position up to which the currently playing content is buffered, in milliseconds, or TIME_UNSET to indicate the default start position.

contentPositionMsSupplier

public final SimpleBasePlayer.PositionSupplier contentPositionMsSupplier

The PositionSupplier for the current content playback position in milliseconds, or TIME_UNSET to indicate the default start position.

currentAdGroupIndex

public final int currentAdGroupIndex

The current ad group index, or INDEX_UNSET if no ad is playing.

currentAdIndexInAdGroup

public final int currentAdIndexInAdGroup

The current ad index in the ad group, or INDEX_UNSET if no ad is playing.

currentCues

public final CueGroup currentCues

The current cues.

currentMediaItemIndex

public final int currentMediaItemIndex

The current media item index, or INDEX_UNSET to assume the default first item of the playlist is played.

deviceInfo

public final DeviceInfo deviceInfo

The DeviceInfo.

deviceVolume

public final @IntRange(from = 0) int deviceVolume

The current device volume.

discontinuityPositionMs

public final long discontinuityPositionMs

The position, in milliseconds, in the current content or ad from which playback continued after the discontinuity. The value is unused if hasPositionDiscontinuity is false.

hasPositionDiscontinuity

public final boolean hasPositionDiscontinuity

Signals that a position discontinuity happened since the last update to the player.

isDeviceMuted

public final boolean isDeviceMuted

Whether the device is muted.

isLoading

public final boolean isLoading

Whether the player is currently loading its source.

maxSeekToPreviousPositionMs

public final long maxSeekToPreviousPositionMs

The maximum position for which seekToPrevious seeks to the previous item, in milliseconds.

newlyRenderedFirstFrame

public final boolean newlyRenderedFirstFrame

Whether a frame has been rendered for the first time since setting the surface, a rendering reset, or since the stream being rendered was changed.

playWhenReady

public final boolean playWhenReady

Whether playback should proceed when ready and not suppressed.

playWhenReadyChangeReason

@Player.PlayWhenReadyChangeReason
public final int playWhenReadyChangeReason

The last reason for changing playWhenReady.

playbackParameters

public final PlaybackParameters playbackParameters

The currently active PlaybackParameters.

playbackState

@Player.State
public final int playbackState

The state of the player.

playbackSuppressionReason

@Player.PlaybackSuppressionReason
public final int playbackSuppressionReason

The reason why playback is suppressed even if getPlayWhenReady is true.

playerError

public final @Nullable PlaybackException playerError

The last error that caused playback to fail, or null if there was no error.

playlist

public final ImmutableList<SimpleBasePlayer.MediaItemDataplaylist

The media items in the playlist.

playlistMetadata

public final MediaMetadata playlistMetadata

The playlist MediaMetadata.

positionDiscontinuityReason

@Player.DiscontinuityReason
public final int positionDiscontinuityReason

The reason for the last position discontinuity. The value is unused if hasPositionDiscontinuity is false.

repeatMode

@Player.RepeatMode
public final int repeatMode

The RepeatMode used for playback.

seekBackIncrementMs

public final long seekBackIncrementMs

The seekBack increment in milliseconds.

seekForwardIncrementMs

public final long seekForwardIncrementMs

The seekForward increment in milliseconds.

shuffleModeEnabled

public final boolean shuffleModeEnabled

Whether shuffling of media items is enabled.

surfaceSize

public final Size surfaceSize

The size of the surface onto which the video is being rendered.

timedMetadata

public final Metadata timedMetadata

The most recent timed metadata.

timeline

public final Timeline timeline

The Timeline derived from the playlist.

totalBufferedDurationMsSupplier

public final SimpleBasePlayer.PositionSupplier totalBufferedDurationMsSupplier

The PositionSupplier for the estimated total buffered duration in milliseconds.

trackSelectionParameters

public final TrackSelectionParameters trackSelectionParameters

The currently active TrackSelectionParameters.

videoSize

public final VideoSize videoSize

The current video size.

volume

public final @FloatRange(from = 0, to = 1.0) float volume

The current audio volume, with 0 being silence and 1 being unity gain (signal unchanged).

Public methods

buildUpon

public SimpleBasePlayer.State.Builder buildUpon()

Returns a Builder pre-populated with the current state values.

equals

public boolean equals(@Nullable Object o)

hashCode

public int hashCode()