Stay organized with collections Save and categorize content based on your preferences.

ForwardingPlayer

@UnstableApi
class ForwardingPlayer : Player


A Player that forwards operations to another Player. Applications can use this class to suppress or modify specific operations, by overriding the respective methods.

Summary

Public constructors

Creates a new instance that forwards all operations to player.

Public functions

Unit

Calls addListener on the delegate.

Unit
addMediaItem(mediaItem: MediaItem!)

Calls addMediaItem on the delegate.

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

Calls addMediaItem on the delegate.

Unit
addMediaItems(index: Int, mediaItems: (Mutable)List<MediaItem!>!)

Calls addMediaItems on the delegate.

Unit

Calls addMediaItems on the delegate.

Boolean

Calls canAdvertiseSession on the delegate and returns the result.

Unit

Calls clearMediaItems on the delegate.

Unit

Calls clearVideoSurface on the delegate.

Unit

Calls clearVideoSurface on the delegate.

Unit

Calls clearVideoSurfaceHolder on the delegate.

Unit

Calls clearVideoSurfaceView on the delegate.

Unit

Calls clearVideoTextureView on the delegate.

Unit

Calls decreaseDeviceVolume on the delegate.

Looper!

Calls getApplicationLooper on the delegate and returns the result.

AudioAttributes!

Calls getAudioAttributes on the delegate and returns the result.

Player.Commands!

Calls getAvailableCommands on the delegate and returns the result.

Int

Calls getBufferedPercentage on the delegate and returns the result.

Long

Calls getBufferedPosition on the delegate and returns the result.

Long

Calls getContentBufferedPosition on the delegate and returns the result.

Long

Calls getContentDuration on the delegate and returns the result.

Long

Calls getContentPosition on the delegate and returns the result.

Int

Calls getCurrentAdGroupIndex on the delegate and returns the result.

Int

Calls getCurrentAdIndexInAdGroup on the delegate and returns the result.

CueGroup!

Calls getCurrentCues on the delegate and returns the result.

Long

Calls getCurrentLiveOffset on the delegate and returns the result.

Any?

Calls getCurrentManifest on the delegate and returns the result.

MediaItem?

Calls getCurrentMediaItem on the delegate and returns the result.

Int

Calls getCurrentMediaItemIndex on the delegate and returns the result.

Int

Calls getCurrentPeriodIndex on the delegate and returns the result.

Long

Calls getCurrentPosition on the delegate and returns the result.

Timeline!

Calls getCurrentTimeline on the delegate and returns the result.

Tracks!

Calls getCurrentTracks on the delegate and returns the result.

Int

This function is deprecated.

Use getCurrentMediaItemIndex instead.

DeviceInfo!

Calls getDeviceInfo on the delegate and returns the result.

Int

Calls getDeviceVolume on the delegate and returns the result.

Long

Calls getDuration on the delegate and returns the result.

Long

Calls getMaxSeekToPreviousPosition on the delegate and returns the result.

MediaItem!

Calls getMediaItemAt on the delegate and returns the result.

Int

Calls getMediaItemCount on the delegate and returns the result.

MediaMetadata!

Calls getMediaMetadata on the delegate and returns the result.

Int

Calls getNextMediaItemIndex on the delegate and returns the result.

Int

This function is deprecated.

Use getNextMediaItemIndex instead.

Boolean

Calls getPlayWhenReady on the delegate and returns the result.

PlaybackParameters!

Calls getPlaybackParameters on the delegate and returns the result.

Int

Calls getPlaybackState on the delegate and returns the result.

Int

Calls getPlaybackSuppressionReason on the delegate and returns the result.

PlaybackException?

Calls getPlayerError on the delegate and returns the result.

MediaMetadata!

Calls getPlaylistMetadata on the delegate and returns the result.

Int

Calls getPreviousMediaItemIndex on the delegate and returns the result.

Int

This function is deprecated.

Use getPreviousMediaItemIndex instead.

Int

Calls getRepeatMode on the delegate and returns the result.

Long

Calls getSeekBackIncrement on the delegate and returns the result.

Long

Calls getSeekForwardIncrement on the delegate and returns the result.

Boolean

Calls getShuffleModeEnabled on the delegate and returns the result.

Size!

Calls getSurfaceSize on the delegate and returns the result.

Long

Calls getTotalBufferedDuration on the delegate and returns the result.

TrackSelectionParameters!

Calls getTrackSelectionParameters on the delegate and returns the result.

VideoSize!

Calls getVideoSize on the delegate and returns the result.

Float

Calls getVolume on the delegate and returns the result.

Player!

Returns the Player to which operations are forwarded.

Boolean

This function is deprecated.

Use hasNextMediaItem instead.

Boolean

Calls hasNextMediaItem on the delegate and returns the result.

Boolean

This function is deprecated.

Use hasNextMediaItem instead.

Boolean

This function is deprecated.

Use hasPreviousMediaItem instead.

Boolean

Calls hasPreviousMediaItem on the delegate and returns the result.

Boolean

This function is deprecated.

Use hasPreviousMediaItem instead.

Unit

Calls increaseDeviceVolume on the delegate.

Boolean

Calls isCommandAvailable on the delegate and returns the result.

Boolean

Calls isCurrentMediaItemDynamic on the delegate and returns the result.

Boolean

Calls isCurrentMediaItemLive on the delegate and returns the result.

Boolean

Calls isCurrentMediaItemSeekable on the delegate and returns the result.

Boolean

This function is deprecated.

Use isCurrentMediaItemDynamic instead.

Boolean

This function is deprecated.

Use isCurrentMediaItemLive instead.

Boolean

This function is deprecated.

Use isCurrentMediaItemSeekable instead.

Boolean

Calls isDeviceMuted on the delegate and returns the result.

Boolean

Calls isLoading on the delegate and returns the result.

Boolean

Calls isPlaying on the delegate and returns the result.

Boolean

Calls isPlayingAd on the delegate and returns the result.

Unit
moveMediaItem(currentIndex: Int, newIndex: Int)

Calls moveMediaItem on the delegate.

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

Calls moveMediaItems on the delegate.

Unit

This function is deprecated.

Use seekToNextMediaItem instead.

Unit

Calls pause on the delegate.

Unit

Calls play on the delegate.

Unit

Calls prepare on the delegate.

Unit

This function is deprecated.

Use seekToPreviousMediaItem instead.

Unit

Calls release on the delegate.

Unit

Calls removeListener on the delegate.

Unit

Calls removeMediaItem on the delegate.

Unit
removeMediaItems(fromIndex: Int, toIndex: Int)

Calls removeMediaItems on the delegate.

Unit

Calls seekBack on the delegate.

Unit

Calls seekForward on the delegate.

Unit
seekTo(mediaItemIndex: Int, positionMs: Long)

Calls seekTo on the delegate.

Unit
seekTo(positionMs: Long)

Calls seekTo on the delegate.

Unit

Calls seekToDefaultPosition on the delegate.

Unit
seekToDefaultPosition(mediaItemIndex: Int)

Calls seekToDefaultPosition on the delegate.

Unit

Calls seekToNext on the delegate.

Unit

Calls seekToNextMediaItem on the delegate.

Unit

This function is deprecated.

Use seekToNextMediaItem instead.

Unit

Calls seekToPrevious on the delegate.

Unit

Calls seekToPreviousMediaItem on the delegate.

Unit

This function is deprecated.

Use seekToPreviousMediaItem instead.

Unit

Calls setDeviceMuted on the delegate.

Unit

Calls setDeviceVolume on the delegate.

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

Calls setMediaItem on the delegate.

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

Calls setMediaItem on the delegate.

Unit
setMediaItem(mediaItem: MediaItem!)

Calls setMediaItem on the delegate.

Unit
setMediaItems(
    mediaItems: (Mutable)List<MediaItem!>!,
    resetPosition: Boolean
)

Calls setMediaItems ()} on the delegate.

Unit
setMediaItems(
    mediaItems: (Mutable)List<MediaItem!>!,
    startIndex: Int,
    startPositionMs: Long
)

Calls setMediaItems on the delegate.

Unit

Calls setMediaItems on the delegate.

Unit
setPlayWhenReady(playWhenReady: Boolean)

Calls setPlayWhenReady on the delegate.

Unit

Calls setPlaybackParameters on the delegate.

Unit

Calls setPlaybackSpeed on the delegate.

Unit

Calls setPlaylistMetadata on the delegate.

Unit

Calls setRepeatMode on the delegate.

Unit
setShuffleModeEnabled(shuffleModeEnabled: Boolean)

Calls setShuffleModeEnabled on the delegate.

Unit

Calls setTrackSelectionParameters on the delegate.

Unit

Calls setVideoSurface on the delegate.

Unit

Calls setVideoSurfaceHolder on the delegate.

Unit

Calls setVideoSurfaceView on the delegate.

Unit

Calls setVideoTextureView on the delegate.

Unit
setVolume(volume: Float)

Calls setVolume on the delegate.

Unit

Calls stop on the delegate.

Unit
stop(reset: Boolean)

This function is deprecated.

Use stop and clearMediaItems (if reset is true) or just stop (if reset is false).

Inherited Constants

From androidx.media3.common.Player
const Int

Command to increase and decrease the device volume and mute it.

const Int

Command to change the MediaItems in the playlist.

const Int

Command to get the player current AudioAttributes.

const Int

Command to get the currently playing MediaItem.

const Int

Command to get the device volume and whether it is muted.

const Int

Command to get the MediaItems metadata.

const Int

Command to get the text that should currently be displayed by the player.

const Int

Command to get the information about the current timeline.

const Int

Command to get details of the current track selection.

const Int

Command to get the player volume.

const Int

Represents an invalid Command.

const Int

Command to start, pause or resume playback.

const Int

Command to prepare the player.

const Int

Command to seek back by a fixed increment into the current MediaItem.

const Int

Command to seek forward by a fixed increment into the current MediaItem.

const Int

Command to seek anywhere into the current MediaItem.

const Int

This property is deprecated.

Use COMMAND_SEEK_IN_CURRENT_MEDIA_ITEM instead.

const Int

Command to seek to the default position of the current MediaItem.

const Int

Command to seek anywhere in any MediaItem.

const Int

Command to seek to a later position in the current or next MediaItem.

const Int

Command to seek to the default position of the next MediaItem.

const Int

This property is deprecated.

Use COMMAND_SEEK_TO_NEXT_MEDIA_ITEM instead.

const Int

Command to seek to an earlier position in the current or previous MediaItem.

const Int

Command to seek to the default position of the previous MediaItem.

const Int

This property is deprecated.

Use COMMAND_SEEK_TO_PREVIOUS_MEDIA_ITEM instead.

const Int

This property is deprecated.

Use COMMAND_SEEK_TO_MEDIA_ITEM instead.

const Int

Command to set the device volume and mute it.

const Int

Command to set a MediaItem.

const Int

Command to set the MediaItems metadata.

const Int

Command to set the repeat mode.

const Int

Command to enable shuffling.

const Int

Command to set the playback speed and pitch.

const Int

Command to set the player's track selection parameters.

const Int

Command to set and clear the surface on which to render the video.

const Int

Command to set the player volume.

const Int

Command to stop playback or release the player.

const Int

Automatic playback transition from one period in the timeline to the next.

const Int

Discontinuity introduced internally (e.g. by the source).

const Int

Discontinuity caused by the removal of the current period from the Timeline.

const Int

Seek within the current period or to another period.

const Int

Seek adjustment due to being unable to seek to the requested position or because the seek was permitted to be inexact.

const Int

Discontinuity introduced by a skipped period (for instance a skipped ad).

const Int

getAudioAttributes changed.

const Int

The audio session id was set.

const Int

isCommandAvailable changed for at least one Command.

const Int

getCurrentCues changed.

const Int

getDeviceInfo changed.

const Int

getDeviceVolume changed.

const Int

isLoading ()} changed.

const Int

isPlaying changed.

const Int

getMaxSeekToPreviousPosition changed.

const Int

getCurrentMediaItem changed or the player started repeating the current item.

const Int

getMediaMetadata changed.

const Int

Metadata associated with the current playback time changed.

const Int

getPlaybackParameters changed.

const Int

getPlaybackState changed.

const Int

getPlaybackSuppressionReason changed.

const Int

getPlayerError changed.

const Int

getPlaylistMetadata changed.

const Int

getPlayWhenReady changed.

const Int

A position discontinuity occurred.

const Int

A frame is rendered for the first time since setting the surface, or since the renderer was reset, or since the stream being rendered was changed.

const Int

getRepeatMode changed.

const Int

getSeekBackIncrement changed.

const Int

getSeekForwardIncrement changed.

const Int

getShuffleModeEnabled changed.

const Int

Skipping silences in the audio stream is enabled or disabled.

const Int

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

const Int

getCurrentTimeline changed.

const Int

getCurrentTracks changed.

const Int

getTrackSelectionParameters changed.

const Int

getVideoSize changed.