SimpleBasePlayer.State


class SimpleBasePlayer.State


An immutable state description of the player.

Summary

Nested types

A builder for State objects.

Public functions

SimpleBasePlayer.State.Builder!

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

Boolean
equals(o: Any?)
ImmutableList<SimpleBasePlayer.MediaItemData!>!

Returns the list of MediaItemData for the current playlist.

Int

Public properties

SimpleBasePlayer.PositionSupplier!

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

SimpleBasePlayer.PositionSupplier!

The PositionSupplier for the current ad playback position in milliseconds.

AudioAttributes!

The current AudioAttributes.

Int

The current audio session ID.

Player.Commands!

The available Commands.

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.

SimpleBasePlayer.PositionSupplier!

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

Int

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

Int

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

CueGroup!

The current cues.

Int

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

MediaMetadata!

The current combined MediaMetadata.

Tracks!

The current Tracks.

DeviceInfo!

The DeviceInfo.

@IntRange(from = 0) Int

The current device volume.

Long

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

Boolean

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

Boolean

Whether the device is muted.

Boolean

Whether the player is currently loading its source.

Long

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

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.

Boolean

Whether playback should proceed when ready and not suppressed.

Int

The last reason for changing playWhenReady.

PlaybackParameters!

The currently active PlaybackParameters.

Int

The state of the player.

Int

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

PlaybackException?

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

MediaMetadata!

The playlist MediaMetadata.

Int

The reason for the last position discontinuity.

Int

The RepeatMode used for playback.

Long

The seekBack increment in milliseconds.

Long

The seekForward increment in milliseconds.

Boolean

Whether shuffling of media items is enabled.

Size!

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

Metadata!

The most recent timed metadata.

Timeline!

The Timeline.

SimpleBasePlayer.PositionSupplier!

The PositionSupplier for the estimated total buffered duration in milliseconds.

TrackSelectionParameters!

The currently active TrackSelectionParameters.

@FloatRange(from = 0, to = 1.0) Float

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

VideoSize!

The current video size.

@FloatRange(from = 0, to = 1.0) Float

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

Public functions

buildUpon

fun buildUpon(): SimpleBasePlayer.State.Builder!

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

equals

fun equals(o: Any?): Boolean

getPlaylist

fun getPlaylist(): ImmutableList<SimpleBasePlayer.MediaItemData!>!

Returns the list of MediaItemData for the current playlist.

See also
setPlaylist

hashCode

fun hashCode(): Int

Public properties

adBufferedPositionMsSupplier

val adBufferedPositionMsSupplier: SimpleBasePlayer.PositionSupplier!

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

val adPositionMsSupplier: SimpleBasePlayer.PositionSupplier!

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

audioAttributes

val audioAttributes: AudioAttributes!

The current AudioAttributes.

audioSessionId

val audioSessionId: Int

The current audio session ID.

availableCommands

val availableCommands: Player.Commands!

The available Commands.

contentBufferedPositionMsSupplier

val contentBufferedPositionMsSupplier: 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.

contentPositionMsSupplier

val contentPositionMsSupplier: SimpleBasePlayer.PositionSupplier!

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

currentAdGroupIndex

val currentAdGroupIndex: Int

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

currentAdIndexInAdGroup

val currentAdIndexInAdGroup: Int

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

currentCues

val currentCues: CueGroup!

The current cues.

currentMediaItemIndex

val currentMediaItemIndex: Int

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

currentMetadata

val currentMetadata: MediaMetadata!

The current combined MediaMetadata.

currentTracks

val currentTracks: Tracks!

The current Tracks.

deviceInfo

val deviceInfo: DeviceInfo!

The DeviceInfo.

deviceVolume

val deviceVolume: @IntRange(from = 0) Int

The current device volume.

discontinuityPositionMs

val discontinuityPositionMs: Long

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

val hasPositionDiscontinuity: Boolean

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

isDeviceMuted

val isDeviceMuted: Boolean

Whether the device is muted.

isLoading

val isLoading: Boolean

Whether the player is currently loading its source.

maxSeekToPreviousPositionMs

val maxSeekToPreviousPositionMs: Long

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

newlyRenderedFirstFrame

val newlyRenderedFirstFrame: 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.

playWhenReady

val playWhenReady: Boolean

Whether playback should proceed when ready and not suppressed.

playWhenReadyChangeReason

@Player.PlayWhenReadyChangeReason
val playWhenReadyChangeReason: Int

The last reason for changing playWhenReady.

playbackParameters

val playbackParameters: PlaybackParameters!

The currently active PlaybackParameters.

playbackState

@Player.State
val playbackState: Int

The state of the player.

playbackSuppressionReason

@Player.PlaybackSuppressionReason
val playbackSuppressionReason: Int

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

playerError

val playerError: PlaybackException?

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

playlistMetadata

val playlistMetadata: MediaMetadata!

The playlist MediaMetadata.

positionDiscontinuityReason

@Player.DiscontinuityReason
val positionDiscontinuityReason: Int

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

repeatMode

@Player.RepeatMode
val repeatMode: Int

The RepeatMode used for playback.

seekBackIncrementMs

val seekBackIncrementMs: Long

The seekBack increment in milliseconds.

seekForwardIncrementMs

val seekForwardIncrementMs: Long

The seekForward increment in milliseconds.

shuffleModeEnabled

val shuffleModeEnabled: Boolean

Whether shuffling of media items is enabled.

surfaceSize

val surfaceSize: Size!

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

timedMetadata

val timedMetadata: Metadata!

The most recent timed metadata.

timeline

val timeline: Timeline!

The Timeline.

totalBufferedDurationMsSupplier

val totalBufferedDurationMsSupplier: SimpleBasePlayer.PositionSupplier!

The PositionSupplier for the estimated total buffered duration in milliseconds.

trackSelectionParameters

val trackSelectionParameters: TrackSelectionParameters!

The currently active TrackSelectionParameters.

unmuteVolume

val unmuteVolume: @FloatRange(from = 0, to = 1.0) Float

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

videoSize

val videoSize: VideoSize!

The current video size.

volume

val volume: @FloatRange(from = 0, to = 1.0) Float

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