protected final class

SimpleBasePlayer.State

extends java.lang.Object

 java.lang.Object

↳androidx.media3.common.SimpleBasePlayer.State

Overview

An immutable state description of the player.

Summary

Fields
public final SimpleBasePlayer.PositionSupplieradBufferedPositionMsSupplier

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

public final SimpleBasePlayer.PositionSupplieradPositionMsSupplier

The SimpleBasePlayer.PositionSupplier for the current ad playback position in milliseconds.

public final AudioAttributesaudioAttributes

The current AudioAttributes.

public final Player.CommandsavailableCommands

The available .

public final SimpleBasePlayer.PositionSuppliercontentBufferedPositionMsSupplier

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

public final SimpleBasePlayer.PositionSuppliercontentPositionMsSupplier

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

public final intcurrentAdGroupIndex

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

public final intcurrentAdIndexInAdGroup

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

public final CueGroupcurrentCues

The current cues.

public final intcurrentMediaItemIndex

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

public final MediaMetadatacurrentMetadata

The current combined MediaMetadata.

public final TrackscurrentTracks

The current Tracks.

public final DeviceInfodeviceInfo

The DeviceInfo.

public final intdeviceVolume

The current device volume.

public final longdiscontinuityPositionMs

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

public final booleanhasPositionDiscontinuity

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

public final booleanisDeviceMuted

Whether the device is muted.

public final booleanisLoading

Whether the player is currently loading its source.

public final longmaxSeekToPreviousPositionMs

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

public final booleannewlyRenderedFirstFrame

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.

public final PlaybackParametersplaybackParameters

The currently active PlaybackParameters.

public final intplaybackState

The state of the player.

public final intplaybackSuppressionReason

The reason why playback is suppressed even if SimpleBasePlayer.getPlayWhenReady() is true.

public final PlaybackExceptionplayerError

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

public final MediaMetadataplaylistMetadata

The playlist MediaMetadata.

public final booleanplayWhenReady

Whether playback should proceed when ready and not suppressed.

public final intplayWhenReadyChangeReason

The last reason for changing SimpleBasePlayer.State.playWhenReady.

public final intpositionDiscontinuityReason

The reason for the last position discontinuity.

public final intrepeatMode

The used for playback.

public final longseekBackIncrementMs

The Player.seekBack() increment in milliseconds.

public final longseekForwardIncrementMs

The Player.seekForward() increment in milliseconds.

public final booleanshuffleModeEnabled

Whether shuffling of media items is enabled.

public final SizesurfaceSize

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

public final MetadatatimedMetadata

The most recent timed metadata.

public final Timelinetimeline

The Timeline.

public final SimpleBasePlayer.PositionSuppliertotalBufferedDurationMsSupplier

The SimpleBasePlayer.PositionSupplier for the estimated total buffered duration in milliseconds.

public final TrackSelectionParameterstrackSelectionParameters

The currently active TrackSelectionParameters.

public final VideoSizevideoSize

The current video size.

public final floatvolume

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

Methods
public SimpleBasePlayer.State.BuilderbuildUpon()

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

public booleanequals(java.lang.Object o)

public <any>getPlaylist()

Returns the list of SimpleBasePlayer.MediaItemData for the current playlist.

public inthashCode()

from java.lang.Objectclone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait

Fields

public final Player.Commands availableCommands

The available .

public final boolean playWhenReady

Whether playback should proceed when ready and not suppressed.

public final int playWhenReadyChangeReason

The last reason for changing SimpleBasePlayer.State.playWhenReady.

public final int playbackState

The state of the player.

public final int playbackSuppressionReason

The reason why playback is suppressed even if SimpleBasePlayer.getPlayWhenReady() is true.

public final PlaybackException playerError

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

public final int repeatMode

The used for playback.

public final boolean shuffleModeEnabled

Whether shuffling of media items is enabled.

public final boolean isLoading

Whether the player is currently loading its source.

public final long seekBackIncrementMs

The Player.seekBack() increment in milliseconds.

public final long seekForwardIncrementMs

The Player.seekForward() increment in milliseconds.

public final long maxSeekToPreviousPositionMs

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

public final PlaybackParameters playbackParameters

The currently active PlaybackParameters.

public final TrackSelectionParameters trackSelectionParameters

The currently active TrackSelectionParameters.

public final AudioAttributes audioAttributes

The current AudioAttributes.

public final float volume

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

public final VideoSize videoSize

The current video size.

public final CueGroup currentCues

The current cues.

public final DeviceInfo deviceInfo

The DeviceInfo.

public final int deviceVolume

The current device volume.

public final boolean isDeviceMuted

Whether the device is muted.

public final Size surfaceSize

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

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.

public final Metadata timedMetadata

The most recent timed metadata.

public final Timeline timeline

The Timeline.

public final Tracks currentTracks

The current Tracks.

public final MediaMetadata currentMetadata

The current combined MediaMetadata.

public final MediaMetadata playlistMetadata

The playlist MediaMetadata.

public final int currentMediaItemIndex

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

public final int currentAdGroupIndex

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

public final int currentAdIndexInAdGroup

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

public final SimpleBasePlayer.PositionSupplier contentPositionMsSupplier

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

public final SimpleBasePlayer.PositionSupplier adPositionMsSupplier

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

public final SimpleBasePlayer.PositionSupplier contentBufferedPositionMsSupplier

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

public final SimpleBasePlayer.PositionSupplier adBufferedPositionMsSupplier

The SimpleBasePlayer.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.

public final SimpleBasePlayer.PositionSupplier totalBufferedDurationMsSupplier

The SimpleBasePlayer.PositionSupplier for the estimated total buffered duration in milliseconds.

public final boolean hasPositionDiscontinuity

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

public final int positionDiscontinuityReason

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

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 SimpleBasePlayer.State.hasPositionDiscontinuity is false.

Methods

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

public <any> getPlaylist()

Returns the list of SimpleBasePlayer.MediaItemData for the current playlist.

See also: SimpleBasePlayer.State.Builder.setPlaylist(List)

public boolean equals(java.lang.Object o)

public int hashCode()