Package com.google.android.exoplayer2
Class SimpleBasePlayer.State
- java.lang.Object
-
- com.google.android.exoplayer2.SimpleBasePlayer.State
-
- Enclosing class:
- SimpleBasePlayer
protected static final class SimpleBasePlayer.State extends Object
An immutable state description of the player.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSimpleBasePlayer.State.BuilderA builder forSimpleBasePlayer.Stateobjects.
-
Field Summary
Fields Modifier and Type Field Description SimpleBasePlayer.PositionSupplieradBufferedPositionMsSupplierTheSimpleBasePlayer.PositionSupplierfor the estimated position up to which the currently playing ad is buffered, in milliseconds.SimpleBasePlayer.PositionSupplieradPositionMsSupplierTheSimpleBasePlayer.PositionSupplierfor the current ad playback position in milliseconds.AudioAttributesaudioAttributesThe currentAudioAttributes.Player.CommandsavailableCommandsThe availablePlayer.Commands.SimpleBasePlayer.PositionSuppliercontentBufferedPositionMsSupplierTheSimpleBasePlayer.PositionSupplierfor the estimated position up to which the currently playing content is buffered, in milliseconds, orC.TIME_UNSETto indicate the default start position.SimpleBasePlayer.PositionSuppliercontentPositionMsSupplierTheSimpleBasePlayer.PositionSupplierfor the current content playback position in milliseconds, orC.TIME_UNSETto indicate the default start position.intcurrentAdGroupIndexThe current ad group index, orC.INDEX_UNSETif no ad is playing.intcurrentAdIndexInAdGroupThe current ad index in the ad group, orC.INDEX_UNSETif no ad is playing.CueGroupcurrentCuesThe current cues.intcurrentMediaItemIndexThe current media item index, orC.INDEX_UNSETto assume the default first item of the playlist is played.DeviceInfodeviceInfoTheDeviceInfo.intdeviceVolumeThe current device volume.longdiscontinuityPositionMsThe position, in milliseconds, in the current content or ad from which playback continued after the discontinuity.booleanhasPositionDiscontinuitySignals that a position discontinuity happened since the last update to the player.booleanisDeviceMutedWhether the device is muted.booleanisLoadingWhether the player is currently loading its source.longmaxSeekToPreviousPositionMsThe maximum position for whichBasePlayer.seekToPrevious()seeks to the previous item, in milliseconds.booleannewlyRenderedFirstFrameWhether a frame has been rendered for the first time since setting the surface, a rendering reset, or since the stream being rendered was changed.PlaybackParametersplaybackParametersThe currently activePlaybackParameters.@com.google.android.exoplayer2.Player.State intplaybackStateThe state of the player.@com.google.android.exoplayer2.Player.PlaybackSuppressionReason intplaybackSuppressionReasonThe reason why playback is suppressed even ifSimpleBasePlayer.getPlayWhenReady()is true.PlaybackExceptionplayerErrorThe last error that caused playback to fail, or null if there was no error.ImmutableList<SimpleBasePlayer.MediaItemData>playlistThe media items in the playlist.MediaMetadataplaylistMetadataThe playlistMediaMetadata.booleanplayWhenReadyWhether playback should proceed when ready and not suppressed.@com.google.android.exoplayer2.Player.PlayWhenReadyChangeReason intplayWhenReadyChangeReasonThe last reason for changingplayWhenReady.@com.google.android.exoplayer2.Player.DiscontinuityReason intpositionDiscontinuityReasonThe reason for the last position discontinuity.@com.google.android.exoplayer2.Player.RepeatMode intrepeatModeThePlayer.RepeatModeused for playback.longseekBackIncrementMsThePlayer.seekBack()increment in milliseconds.longseekForwardIncrementMsThePlayer.seekForward()increment in milliseconds.booleanshuffleModeEnabledWhether shuffling of media items is enabled.SizesurfaceSizeThe size of the surface onto which the video is being rendered.MetadatatimedMetadataThe most recent timed metadata.TimelinetimelineSimpleBasePlayer.PositionSuppliertotalBufferedDurationMsSupplierTheSimpleBasePlayer.PositionSupplierfor the estimated total buffered duration in milliseconds.TrackSelectionParameterstrackSelectionParametersThe currently activeTrackSelectionParameters.VideoSizevideoSizeThe current video size.floatvolumeThe current audio volume, with 0 being silence and 1 being unity gain (signal unchanged).
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SimpleBasePlayer.State.BuilderbuildUpon()Returns aSimpleBasePlayer.State.Builderpre-populated with the current state values.booleanequals(Object o)inthashCode()
-
-
-
Field Detail
-
availableCommands
public final Player.Commands availableCommands
The availablePlayer.Commands.
-
playWhenReady
public final boolean playWhenReady
Whether playback should proceed when ready and not suppressed.
-
playWhenReadyChangeReason
@PlayWhenReadyChangeReason public final @com.google.android.exoplayer2.Player.PlayWhenReadyChangeReason int playWhenReadyChangeReason
The last reason for changingplayWhenReady.
-
playbackState
@State public final @com.google.android.exoplayer2.Player.State int playbackState
The state of the player.
-
playbackSuppressionReason
@PlaybackSuppressionReason public final @com.google.android.exoplayer2.Player.PlaybackSuppressionReason int playbackSuppressionReason
The reason why playback is suppressed even ifSimpleBasePlayer.getPlayWhenReady()is true.
-
playerError
@Nullable public final PlaybackException playerError
The last error that caused playback to fail, or null if there was no error.
-
repeatMode
@RepeatMode public final @com.google.android.exoplayer2.Player.RepeatMode int repeatMode
ThePlayer.RepeatModeused for playback.
-
shuffleModeEnabled
public final boolean shuffleModeEnabled
Whether shuffling of media items is enabled.
-
isLoading
public final boolean isLoading
Whether the player is currently loading its source.
-
seekBackIncrementMs
public final long seekBackIncrementMs
ThePlayer.seekBack()increment in milliseconds.
-
seekForwardIncrementMs
public final long seekForwardIncrementMs
ThePlayer.seekForward()increment in milliseconds.
-
maxSeekToPreviousPositionMs
public final long maxSeekToPreviousPositionMs
The maximum position for whichBasePlayer.seekToPrevious()seeks to the previous item, in milliseconds.
-
playbackParameters
public final PlaybackParameters playbackParameters
The currently activePlaybackParameters.
-
trackSelectionParameters
public final TrackSelectionParameters trackSelectionParameters
The currently activeTrackSelectionParameters.
-
audioAttributes
public final AudioAttributes audioAttributes
The currentAudioAttributes.
-
volume
@FloatRange(from=0.0, to=1.0) public final float volumeThe current audio volume, with 0 being silence and 1 being unity gain (signal unchanged).
-
videoSize
public final VideoSize videoSize
The current video size.
-
deviceInfo
public final DeviceInfo deviceInfo
TheDeviceInfo.
-
deviceVolume
@IntRange(from=0L) public final int deviceVolume
The current device volume.
-
isDeviceMuted
public final boolean isDeviceMuted
Whether the device is muted.
-
surfaceSize
public final Size surfaceSize
The size of the surface onto which the video is being rendered.
-
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.
-
timedMetadata
public final Metadata timedMetadata
The most recent timed metadata.
-
playlist
public final ImmutableList<SimpleBasePlayer.MediaItemData> playlist
The media items in the playlist.
-
timeline
public final Timeline timeline
-
playlistMetadata
public final MediaMetadata playlistMetadata
The playlistMediaMetadata.
-
currentMediaItemIndex
public final int currentMediaItemIndex
The current media item index, orC.INDEX_UNSETto assume the default first item of the playlist is played.
-
currentAdGroupIndex
public final int currentAdGroupIndex
The current ad group index, orC.INDEX_UNSETif no ad is playing.
-
currentAdIndexInAdGroup
public final int currentAdIndexInAdGroup
The current ad index in the ad group, orC.INDEX_UNSETif no ad is playing.
-
contentPositionMsSupplier
public final SimpleBasePlayer.PositionSupplier contentPositionMsSupplier
TheSimpleBasePlayer.PositionSupplierfor the current content playback position in milliseconds, orC.TIME_UNSETto indicate the default start position.
-
adPositionMsSupplier
public final SimpleBasePlayer.PositionSupplier adPositionMsSupplier
TheSimpleBasePlayer.PositionSupplierfor the current ad playback position in milliseconds. The value is unused if no ad is playing.
-
contentBufferedPositionMsSupplier
public final SimpleBasePlayer.PositionSupplier contentBufferedPositionMsSupplier
TheSimpleBasePlayer.PositionSupplierfor the estimated position up to which the currently playing content is buffered, in milliseconds, orC.TIME_UNSETto indicate the default start position.
-
adBufferedPositionMsSupplier
public final SimpleBasePlayer.PositionSupplier adBufferedPositionMsSupplier
TheSimpleBasePlayer.PositionSupplierfor the estimated position up to which the currently playing ad is buffered, in milliseconds. The value is unused if no ad is playing.
-
totalBufferedDurationMsSupplier
public final SimpleBasePlayer.PositionSupplier totalBufferedDurationMsSupplier
TheSimpleBasePlayer.PositionSupplierfor the estimated total buffered duration in milliseconds.
-
hasPositionDiscontinuity
public final boolean hasPositionDiscontinuity
Signals that a position discontinuity happened since the last update to the player.
-
positionDiscontinuityReason
@DiscontinuityReason public final @com.google.android.exoplayer2.Player.DiscontinuityReason int positionDiscontinuityReason
The reason for the last position discontinuity. The value is unused ifhasPositionDiscontinuityisfalse.
-
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 ifhasPositionDiscontinuityisfalse.
-
-
Method Detail
-
buildUpon
public SimpleBasePlayer.State.Builder buildUpon()
Returns aSimpleBasePlayer.State.Builderpre-populated with the current state values.
-
-