@UnstableApi
class FakePlayer : SimpleBasePlayer


A fake Player that uses SimpleBasePlayer's minimal number of default methods implementations to build upon to simulate realistic playback scenarios for testing.

Summary

Public constructors

FakePlayer(
    playbackState: @Player.State Int,
    playWhenReady: Boolean,
    playlist: List<SimpleBasePlayer.MediaItemData>,
    playbackSpeed: Float,
    bufferingDelayMs: Long
)

Public functions

Unit
addCommands(vararg commands: @Player.Command Int)

Add commands to those already available to the player.

Unit
removeCommands(vararg commands: @Player.Command Int)

Remove commands from those already available to the player.

Unit
renderFirstFrame(newlyRenderedFirstFrame: Boolean)

Sets 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.

Unit
setBufferedPositionMs(bufferedPositionMs: Long)

Sets the buffered content playback position in milliseconds.

Unit
setDuration(uid: String, durationMs: Long)

Sets the duration of the media item in the playlist, in milliseconds.

Unit

Sets the {@linkplain Player.State state} of the player.

Unit
setPosition(positionMs: Long)

Sets the current content playback position in milliseconds.

Unit

Sets the PositionSupplier for the current content playback position using extrapolation.

Unit
setSeekBackIncrementMs(seekBackIncrementMs: Long)

Sets the Player.seekBack increment in milliseconds.

Unit
setSeekForwardIncrementMs(seekForwardIncrementMs: Long)

Sets the Player.seekForward increment in milliseconds.

Unit
setVideoSize(videoSize: VideoSize)

Sets the current video size.

Protected functions

open SimpleBasePlayer.State

Returns the current State of the player.

open ListenableFuture<*>
handleClearVideoOutput(videoOutput: Any?)

Handles calls to clear the video output.

open ListenableFuture<*>

Handles calls to prepare.

open ListenableFuture<*>

Handles calls to release.

open ListenableFuture<*>
handleSeek(
    mediaItemIndex: Int,
    positionMs: Long,
    seekCommand: @Player.Command Int
)

Handles calls to seekTo and other seek operations (for example, seekToNext).

open ListenableFuture<*>
handleSetMediaItems(
    mediaItems: MutableList<MediaItem>,
    startIndex: Int,
    startPositionMs: Long
)

Handles calls to setMediaItem and setMediaItems.

open ListenableFuture<*>

Handles calls to setPlayWhenReady, play and pause.

open ListenableFuture<*>

Handles calls to setPlaybackParameters or setPlaybackSpeed.

open ListenableFuture<*>
handleSetRepeatMode(repeatMode: Int)

Handles calls to setRepeatMode.

open ListenableFuture<*>
handleSetShuffleModeEnabled(shuffleModeEnabled: Boolean)

Handles calls to setShuffleModeEnabled.

open ListenableFuture<*>
handleSetVideoOutput(videoOutput: Any)

Handles calls to set the video output.

open ListenableFuture<*>
handleSetVolume(
    volume: Float,
    volumeOperationType: @C.VolumeOperationType Int
)

Handles calls to setVolume.

open ListenableFuture<*>

Handles calls to stop.

Public properties

Boolean

Whether the player is released

Any?

Current video output

Inherited functions

From androidx.media3.common.BasePlayer
final Unit
addMediaItem(mediaItem: MediaItem)

Adds a media item to the end of the playlist.

final Unit
addMediaItem(index: Int, mediaItem: MediaItem)

Adds a media item at the given index of the playlist.

final Unit

Adds a list of media items to the end of the playlist.

final Boolean

Returns whether the player can be used to advertise a media session.

final Unit

Clears the playlist.

final Int

Returns an estimate of the percentage in the current content or ad up to which data is buffered, or 0 if no estimate is available.

final Long

If isPlayingAd returns true, returns the duration of the current content in milliseconds, or TIME_UNSET if the duration is not known.

final Long

Returns the offset of the current playback position from the live edge in milliseconds, or TIME_UNSET if the current MediaItemisn't live or the offset is unknown.

final Any?

Returns the current manifest.

final MediaItem?

Returns the currently playing MediaItem.

final Int

This function is deprecated.

Use getCurrentMediaItemIndex instead.

final MediaItem

Returns the MediaItem at the given index.

final Int

Returns the number of media items in the playlist.

final Int

Returns the index of the MediaItem that will be played if seekToNextMediaItem is called, which may depend on the current repeat mode and whether shuffle mode is enabled.

final Int

This function is deprecated.

Use getNextMediaItemIndex instead.

final Int

Returns the index of the MediaItem that will be played if seekToPreviousMediaItem is called, which may depend on the current repeat mode and whether shuffle mode is enabled.

final Int

This function is deprecated.

Use getPreviousMediaItemIndex instead.

final Boolean

Returns whether a next MediaItem exists, which may depend on the current repeat mode and whether shuffle mode is enabled.

final Boolean

Returns whether a previous media item exists, which may depend on the current repeat mode and whether shuffle mode is enabled.

final Boolean

Returns whether the provided Command is available.

final Boolean

Returns whether the current MediaItem is dynamic (may change when the Timeline is updated), or false if the Timeline is empty.

final Boolean

Returns whether the current MediaItem is live, or false if the Timeline is empty.

final Boolean

Returns whether the current MediaItem is seekable, or false if the Timeline is empty.

final Boolean

This function is deprecated.

Use isCurrentMediaItemDynamic instead.

final Boolean

This function is deprecated.

Use isCurrentMediaItemLive instead.

final Boolean

This function is deprecated.

Use isCurrentMediaItemSeekable instead.

final Boolean

Returns whether the player is playing, i.e. getCurrentPosition is advancing.

final Unit
moveMediaItem(currentIndex: Int, newIndex: Int)

Moves the media item at the current index to the new index.

final Unit

Pauses playback.

final Unit

Resumes playback as soon as getPlaybackState == STATE_READY.

final Unit

Removes the media item at the given index of the playlist.

final Unit
replaceMediaItem(index: Int, mediaItem: MediaItem)

Replaces the media item at the given index of the playlist.

final Unit

Seeks back in the current MediaItem by getSeekBackIncrement milliseconds.

final Unit

Seeks forward in the current MediaItem by getSeekForwardIncrement milliseconds.

final Unit
seekTo(positionMs: Long)

Seeks to a position specified in milliseconds in the current MediaItem.

final Unit
seekTo(mediaItemIndex: Int, positionMs: Long)

Seeks to a position specified in milliseconds in the specified MediaItem.

final Unit

Seeks to the default position associated with the current MediaItem.

final Unit
seekToDefaultPosition(mediaItemIndex: Int)

Seeks to the default position associated with the specified MediaItem.

final Unit

Seeks to a later position in the current or next MediaItem (if available).

final Unit

Seeks to the default position of the next MediaItem, which may depend on the current repeat mode and whether shuffle mode is enabled.

final Unit

Seeks to an earlier position in the current or previous MediaItem (if available).

final Unit

Seeks to the default position of the previous MediaItem, which may depend on the current repeat mode and whether shuffle mode is enabled.

final Unit
setMediaItem(mediaItem: MediaItem)

Clears the playlist, adds the specified MediaItem and resets the position to the default position.

final Unit
setMediaItem(mediaItem: MediaItem, resetPosition: Boolean)

Clears the playlist and adds the specified MediaItem.

final Unit
setMediaItem(mediaItem: MediaItem, startPositionMs: Long)

Clears the playlist and adds the specified MediaItem.

final Unit

Clears the playlist, adds the specified media items and resets the position to the default position.

final Unit

Changes the rate at which playback occurs.

From androidx.media3.common.SimpleBasePlayer
final Unit

Registers a listener to receive all events from the player.

final Unit
addMediaItems(index: Int, mediaItems: MutableList<MediaItem>)

Adds a list of media items at the given index of the playlist.

final Unit

Clears any Surface, SurfaceHolder, SurfaceView or TextureView currently set on the player.

final Unit

Clears the Surface onto which video is being rendered if it matches the one passed.

final Unit

Clears the SurfaceHolder that holds the Surface onto which video is being rendered if it matches the one passed.

final Unit

Clears the SurfaceView onto which video is being rendered if it matches the one passed.

final Unit

Clears the TextureView onto which video is being rendered if it matches the one passed.

final Unit

This function is deprecated.

Use decreaseDeviceVolume instead.

final Unit

Decreases the volume of the device.

final AudioAttributes

Returns the attributes for audio playback.

final Int

Returns the audio session identifier, or AUDIO_SESSION_ID_UNSET if not set.

final Player.Commands

Returns the player's currently available Commands.

final Long

Returns an estimate of the position in the current content or ad up to which data is buffered, in milliseconds.

final Long

If isPlayingAd returns true, returns an estimate of the content position in the current content up to which data is buffered, in milliseconds.

final Long

If isPlayingAd returns true, returns the content position that will be played once all ads in the ad group have finished playing, in milliseconds.

final Int

If isPlayingAd returns true, returns the index of the ad group in the period currently being played.

final Int

If isPlayingAd returns true, returns the index of the ad in its ad group.

final CueGroup

Returns the current CueGroup.

final Int

Returns the index of the current MediaItem in the timeline, or the prospective index if the current timeline is empty.

final Int

Returns the index of the period currently being played.

final Long

Returns the playback position in the current content or ad, in milliseconds, or the prospective position in milliseconds if the current timeline is empty.

final Timeline

Returns the current Timeline.

final Tracks

Returns the current tracks.

final DeviceInfo

Gets the device information.

final Int

Gets the current volume of the device.

final Long

Returns the duration of the current content or ad in milliseconds, or TIME_UNSET if the duration is not known.

final Long

Returns the maximum position for which seekToPrevious seeks to the previous MediaItem, in milliseconds.

final MediaMetadata

Returns the current combined MediaMetadata, or EMPTY if not supported.

open SimpleBasePlayer.MediaItemData

Returns the placeholder MediaItemData used for a new MediaItem added to the playlist.

open SimpleBasePlayer.State

Returns the placeholder state used while a player method is handled asynchronously.

final Boolean

Whether playback will proceed when getPlaybackState == STATE_READY.

final PlaybackParameters

Returns the currently active playback parameters.

final Int

Returns the current playback state of the player.

final Int

Returns the reason why playback is suppressed even though getPlayWhenReady is true, or PLAYBACK_SUPPRESSION_REASON_NONE if playback is not suppressed.

final PlaybackException?

Returns the error that caused playback to fail.

final MediaMetadata

Returns the playlist MediaMetadata, as set by setPlaylistMetadata, or EMPTY if not supported.

final Int

Returns the current RepeatMode used for playback.

final Long

Returns the seekBack increment.

final Long

Returns the seekForward increment.

final Boolean

Returns whether shuffling of media items is enabled.

final Size

Gets the size of the surface on which the video is rendered.

final Long

Returns an estimate of the total buffered duration from the current position, in milliseconds.

final TrackSelectionParameters

Returns the parameters constraining the track selection.

final VideoSize

Gets the size of the video.

final Float

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

open ListenableFuture<*>

Handles calls to addMediaItem and addMediaItems.

open ListenableFuture<*>

Handles calls to decreaseDeviceVolume and decreaseDeviceVolume.

open ListenableFuture<*>

Handles calls to increaseDeviceVolume and increaseDeviceVolume.

open ListenableFuture<*>
@ForOverride
handleMoveMediaItems(fromIndex: Int, toIndex: Int, newIndex: Int)

Handles calls to moveMediaItem and moveMediaItems.

open ListenableFuture<*>
@ForOverride
handleRemoveMediaItems(fromIndex: Int, toIndex: Int)

Handles calls to removeMediaItem and removeMediaItems.

open ListenableFuture<*>
@ForOverride
handleReplaceMediaItems(
    fromIndex: Int,
    toIndex: Int,
    mediaItems: MutableList<MediaItem>
)

Handles calls to replaceMediaItem and replaceMediaItems.

open ListenableFuture<*>
@ForOverride
handleSetAudioAttributes(
    audioAttributes: AudioAttributes,
    handleAudioFocus: Boolean
)

Handles calls to set the audio attributes.

open ListenableFuture<*>

Handles calls to setDeviceMuted and setDeviceMuted.

open ListenableFuture<*>
@ForOverride
handleSetDeviceVolume(
    deviceVolume: @IntRange(from = 0) Int,
    @C.VolumeFlags flags: Int
)

Handles calls to setDeviceVolume and setDeviceVolume.

open ListenableFuture<*>

Handles calls to setPlaylistMetadata.

open ListenableFuture<*>

Handles calls to setTrackSelectionParameters.

open ListenableFuture<*>
@ForOverride
handleSetVolume(volume: @FloatRange(from = 0, to = 1.0) Float)

This function is deprecated.

Use handleSetVolume instead.

final Unit

This function is deprecated.

Use increaseDeviceVolume instead.

final Unit

Increases the volume of the device.

Unit

Invalidates the current state.

final Boolean

Gets whether the device is muted or not.

final Boolean

Whether the player is currently loading the source.

final Boolean

Returns whether the player is currently playing an ad.

final Unit
moveMediaItems(fromIndex: Int, toIndex: Int, newIndex: Int)

Moves the media item range to the new index.

final Unit

Sets the audio volume to 0.

final Unit

Prepares the player.

final Unit

Releases the player.

final Unit

Unregister a listener registered through addListener.

final Unit
removeMediaItems(fromIndex: Int, toIndex: Int)

Removes a range of media items from the playlist.

final Unit
replaceMediaItems(
    fromIndex: Int,
    toIndex: Int,
    mediaItems: MutableList<MediaItem>
)

Replaces the media items at the given range of the playlist.

final Unit
seekTo(
    mediaItemIndex: Int,
    positionMs: Long,
    @Player.Command seekCommand: Int,
    isRepeatingCurrentItem: Boolean
)

Seeks to a position in the specified MediaItem.

final Unit
setAudioAttributes(
    audioAttributes: AudioAttributes,
    handleAudioFocus: Boolean
)

Sets the attributes for audio playback, used by the underlying audio track.

final Unit

This function is deprecated.

Use setDeviceMuted instead.

final Unit

Sets the mute state of the device.

final Unit

This function is deprecated.

Use setDeviceVolume instead.

final Unit
setDeviceVolume(volume: Int, @C.VolumeFlags flags: Int)

Sets the volume of the device with volume flags.

final Unit
setMediaItems(mediaItems: MutableList<MediaItem>, resetPosition: Boolean)

Clears the playlist and adds the specified media items.

final Unit
setMediaItems(
    mediaItems: MutableList<MediaItem>,
    startIndex: Int,
    startPositionMs: Long
)

Clears the playlist and adds the specified media items.

final Unit
setPlayWhenReady(playWhenReady: Boolean)

Sets whether playback should proceed when getPlaybackState == STATE_READY.

final Unit

Attempts to set the playback parameters.

final Unit

Sets the playlist MediaMetadata.

final Unit

Sets the RepeatMode to be used for playback.

final Unit
setShuffleModeEnabled(shuffleModeEnabled: Boolean)

Sets whether shuffling of media items is enabled.

final Unit

Sets the parameters constraining the track selection.

final Unit

Sets the Surface onto which video will be rendered.

final Unit

Sets the SurfaceHolder that holds the Surface onto which video will be rendered.

final Unit

Sets the SurfaceView onto which video will be rendered.

final Unit

Sets the TextureView onto which video will be rendered.

final Unit
setVolume(volume: Float)

Sets the audio volume, valid values are between 0 (silence) and 1 (unity gain, signal unchanged), inclusive.

final Unit

Stops playback without resetting the playlist.

final Unit

If the audio volume is 0, sets the audio volume to a non-zero value decided by the Player to be the most appropriate.

Unit

Throws an IllegalStateException if the the thread calling this method does not match the Looper thread that was specified upon construction of this instance.

Public constructors

FakePlayer

FakePlayer(
    playbackState: @Player.State Int = STATE_IDLE,
    playWhenReady: Boolean = false,
    playlist: List<SimpleBasePlayer.MediaItemData> = ImmutableList.of(),
    playbackSpeed: Float = 1.0f,
    bufferingDelayMs: Long = 100
)
Parameters
playbackState: @Player.State Int = STATE_IDLE

The initial playback state of the player.

playWhenReady: Boolean = false

Whether playback should start automatically when ready.

playlist: List<SimpleBasePlayer.MediaItemData> = ImmutableList.of()

The initial list of media items to play.

playbackSpeed: Float = 1.0f

The initial playback speed.

bufferingDelayMs: Long = 100

The time spent in Player#STATE_BUFFERING when preparing or seeking, in milliseconds. A value of zero will result in the player transitioning directly to Player#STATE_READY without entering Player#STATE_BUFFERING. Must not be negative.

Public functions

addCommands

fun addCommands(vararg commands: @Player.Command Int): Unit

Add commands to those already available to the player.

removeCommands

fun removeCommands(vararg commands: @Player.Command Int): Unit

Remove commands from those already available to the player.

renderFirstFrame

fun renderFirstFrame(newlyRenderedFirstFrame: Boolean): Unit

Sets 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.

setBufferedPositionMs

fun setBufferedPositionMs(bufferedPositionMs: Long): Unit

Sets the buffered content playback position in milliseconds.

Parameters
bufferedPositionMs: Long

The buffered content playback position in milliseconds.

setDuration

fun setDuration(uid: String, durationMs: Long): Unit

Sets the duration of the media item in the playlist, in milliseconds.

Parameters
uid: String

Unique id of the media item whose duration is being set.

durationMs: Long

The duration of the media item, in milliseconds, or {@link C#TIME_UNSET} if unknown.

setPlaybackState

fun setPlaybackState(playbackState: @Player.State Int): Unit

Sets the {@linkplain Player.State state} of the player.

If the playlist is empty, the state must be either Player.STATE_IDLE or Player.STATE_ENDED.

Parameters
playbackState: @Player.State Int

The Player.State of the player.

setPosition

fun setPosition(positionMs: Long): Unit

Sets the current content playback position in milliseconds.

Parameters
positionMs: Long

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

setPositionSupplierDrivenBy

fun setPositionSupplierDrivenBy(testScheduler: TestCoroutineScheduler): Unit

Sets the PositionSupplier for the current content playback position using extrapolation. Start and elapsed time are measured using the TestCoroutineScheduler, and playback speed is taken into account.

Note, that this approach only works

  • for a single media item (does not consider current item's duration and playlist length)

  • assuming the Player is playing (does not react to pauses and discontinuities)

  • assuming the playback speed does not change after the supplier is set

setSeekBackIncrementMs

fun setSeekBackIncrementMs(seekBackIncrementMs: Long): Unit

Sets the Player.seekBack increment in milliseconds.

Parameters
seekBackIncrementMs: Long

The Player.seekBack increment in milliseconds.

setSeekForwardIncrementMs

fun setSeekForwardIncrementMs(seekForwardIncrementMs: Long): Unit

Sets the Player.seekForward increment in milliseconds.

Parameters
seekForwardIncrementMs: Long

The Player.seekForward increment in milliseconds.

setVideoSize

fun setVideoSize(videoSize: VideoSize): Unit

Sets the current video size.

Parameters
videoSize: VideoSize

The current video size.

Protected functions

getState

protected open fun getState(): SimpleBasePlayer.State

Returns the current State of the player.

The State should include all available commands indicating which player methods are allowed to be called.

Note that this method won't be called while asynchronous handling of player methods is in progress. This means that the implementation doesn't need to handle state changes caused by these asynchronous operations until they are done and can return the currently known state directly. The placeholder state used while these asynchronous operations are in progress can be customized by overriding getPlaceholderState if required.

handleClearVideoOutput

protected open fun handleClearVideoOutput(videoOutput: Any?): ListenableFuture<*>

Handles calls to clear the video output.

Will only be called if COMMAND_SET_VIDEO_SURFACE is available.

Parameters
videoOutput: Any?

The video output to clear. If null any current output should be cleared. If non-null, the output should only be cleared if it matches the provided argument. This is either a Surface, SurfaceHolder, TextureView or SurfaceView.

Returns
ListenableFuture<*>

A ListenableFuture indicating the completion of all immediate State changes caused by this call.

handlePrepare

protected open fun handlePrepare(): ListenableFuture<*>

Handles calls to prepare.

Will only be called if COMMAND_PREPARE is available.

Returns
ListenableFuture<*>

A ListenableFuture indicating the completion of all immediate State changes caused by this call.

handleRelease

protected open fun handleRelease(): ListenableFuture<*>

Handles calls to release.

Will only be called if COMMAND_RELEASE is available.

Returns
ListenableFuture<*>

A ListenableFuture indicating the completion of all immediate State changes caused by this call.

handleSeek

protected open fun handleSeek(
    mediaItemIndex: Int,
    positionMs: Long,
    seekCommand: @Player.Command Int
): ListenableFuture<*>

Handles calls to seekTo and other seek operations (for example, seekToNext).

Will only be called if the appropriate Player.Command, for example COMMAND_SEEK_TO_MEDIA_ITEM or COMMAND_SEEK_TO_NEXT, is available.

Parameters
mediaItemIndex: Int

The media item index to seek to. If the original seek operation did not directly specify an index, this is the most likely implied index based on the available player state. If the implied action is to do nothing, this will be INDEX_UNSET.

positionMs: Long

The position in milliseconds to start playback from, or TIME_UNSET to start at the default position in the media item. If the original seek operation did not directly specify a position, this is the most likely implied position based on the available player state.

seekCommand: @Player.Command Int

The Player.Command used to trigger the seek.

Returns
ListenableFuture<*>

A ListenableFuture indicating the completion of all immediate State changes caused by this call.

handleSetMediaItems

protected open fun handleSetMediaItems(
    mediaItems: MutableList<MediaItem>,
    startIndex: Int,
    startPositionMs: Long
): ListenableFuture<*>

Handles calls to setMediaItem and setMediaItems.

Will only be called if COMMAND_SET_MEDIA_ITEM or COMMAND_CHANGE_MEDIA_ITEMS is available. If only COMMAND_SET_MEDIA_ITEM is available, the list of media items will always contain exactly one item.

Parameters
mediaItems: MutableList<MediaItem>

The media items to add.

startIndex: Int

The index at which to start playback from, or INDEX_UNSET to start at the default item.

startPositionMs: Long

The position in milliseconds to start playback from, or TIME_UNSET to start at the default position in the media item.

Returns
ListenableFuture<*>

A ListenableFuture indicating the completion of all immediate State changes caused by this call.

handleSetPlayWhenReady

protected open fun handleSetPlayWhenReady(playWhenReady: Boolean): ListenableFuture<*>

Handles calls to setPlayWhenReady, play and pause.

Will only be called if COMMAND_PLAY_PAUSE is available.

Parameters
playWhenReady: Boolean

The requested playWhenReady

Returns
ListenableFuture<*>

A ListenableFuture indicating the completion of all immediate State changes caused by this call.

handleSetPlaybackParameters

protected open fun handleSetPlaybackParameters(playbackParameters: PlaybackParameters): ListenableFuture<*>

Handles calls to setPlaybackParameters or setPlaybackSpeed.

Will only be called if COMMAND_SET_SPEED_AND_PITCH is available.

Parameters
playbackParameters: PlaybackParameters

The requested PlaybackParameters.

Returns
ListenableFuture<*>

A ListenableFuture indicating the completion of all immediate State changes caused by this call.

handleSetRepeatMode

protected open fun handleSetRepeatMode(repeatMode: Int): ListenableFuture<*>

Handles calls to setRepeatMode.

Will only be called if COMMAND_SET_REPEAT_MODE is available.

Parameters
repeatMode: Int

The requested RepeatMode.

Returns
ListenableFuture<*>

A ListenableFuture indicating the completion of all immediate State changes caused by this call.

handleSetShuffleModeEnabled

protected open fun handleSetShuffleModeEnabled(shuffleModeEnabled: Boolean): ListenableFuture<*>

Handles calls to setShuffleModeEnabled.

Will only be called if COMMAND_SET_SHUFFLE_MODE is available.

Parameters
shuffleModeEnabled: Boolean

Whether shuffle mode was requested to be enabled.

Returns
ListenableFuture<*>

A ListenableFuture indicating the completion of all immediate State changes caused by this call.

handleSetVideoOutput

protected open fun handleSetVideoOutput(videoOutput: Any): ListenableFuture<*>

Handles calls to set the video output.

Will only be called if COMMAND_SET_VIDEO_SURFACE is available.

Parameters
videoOutput: Any

The requested video output. This is either a Surface, SurfaceHolder, TextureView or SurfaceView.

Returns
ListenableFuture<*>

A ListenableFuture indicating the completion of all immediate State changes caused by this call.

handleSetVolume

protected open fun handleSetVolume(
    volume: Float,
    volumeOperationType: @C.VolumeOperationType Int
): ListenableFuture<*>

Handles calls to setVolume.

Will only be called if COMMAND_SET_VOLUME is available.

Parameters
volume: Float

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

volumeOperationType: @C.VolumeOperationType Int

The C.VolumeOperationType that corresponds to the original command for changing of the volume.

Returns
ListenableFuture<*>

A ListenableFuture indicating the completion of all immediate State changes caused by this call.

handleStop

protected open fun handleStop(): ListenableFuture<*>

Handles calls to stop.

Will only be called if COMMAND_STOP is available.

Returns
ListenableFuture<*>

A ListenableFuture indicating the completion of all immediate State changes caused by this call.

Public properties

released

var releasedBoolean

Whether the player is released

videoOutput

val videoOutputAny?

Current video output