@UnstableApi
public class StubExoPlayer extends StubPlayer implements ExoPlayer


An abstract ExoPlayer implementation that throws UnsupportedOperationException from every method.

Summary

Public constructors

Public methods

void

Adds an AnalyticsListener to receive analytics events.

void

Adds a listener to receive audio offload events.

void

Adds a media source to the end of the playlist.

void
addMediaSource(int index, MediaSource mediaSource)

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

void

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

void
addMediaSources(int index, List<MediaSource> mediaSources)

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

void

Detaches any previously attached auxiliary audio effect from the underlying audio track.

void

Clears the listener which receives camera motion events if it matches the one passed.

void

Clears the listener which receives video frame metadata events if it matches the one passed.

PlayerMessage

Creates a message that can be sent to a PlayerMessage.Target.

AnalyticsCollector

Returns the AnalyticsCollector used for collecting analytics events.

@Nullable DecoderCounters

Returns DecoderCounters for audio, or null if no audio is being played.

@Nullable Format

Returns the audio format currently being played, or null if no audio is being played.

int

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

Clock

Returns the Clock used for playback.

TrackGroupArray

This method is deprecated.

Use getCurrentTracks.

TrackSelectionArray

This method is deprecated.

Use getCurrentTracks.

boolean

Returns whether the player pauses playback at the end of each media item.

Looper

Returns the Looper associated with the playback thread.

ExoPlaybackException

Returns the error that caused playback to fail.

ExoPlayer.PreloadConfiguration

Returns the preload configuration.

Renderer
getRenderer(int index)

Returns the renderer at the given index.

int

Returns the number of renderers.

int
getRendererType(int index)

Returns the track type that the renderer at a given index handles.

ScrubbingModeParameters

Gets the parameters that control behavior in scrubbing mode.

SeekParameters

Returns the currently active SeekParameters of the player.

boolean

Returns whether skipping silences in the audio stream is enabled.

@Nullable TrackSelector

Returns the track selector that this player uses, or null if track selection is not supported.

int

Returns the C.VideoChangeFrameRateStrategy.

@Nullable DecoderCounters

Returns DecoderCounters for video, or null if no video is being played.

@Nullable Format

Returns the video format currently being played, or null if no video is being played.

int

Returns the C.VideoScalingMode.

boolean

Returns whether release has been called on the player.

boolean

Returns whether the player is optimized for scrubbing (many frequent seeks).

boolean

Returns whether the player has paused its main loop to save power in offload scheduling mode.

boolean

Returns whether tunneling is enabled for the currently selected tracks.

void
prepare(MediaSource mediaSource)

This method is deprecated.

Use setMediaSource and prepare instead.

void
prepare(
    MediaSource mediaSource,
    boolean resetPosition,
    boolean resetState
)

This method is deprecated.

Use setMediaSource and prepare instead.

void

Removes an AnalyticsListener.

void

Removes a listener of audio offload events.

void
setAudioAttributes(
    AudioAttributes audioAttributes,
    boolean handleAudioFocus
)

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

void
setAudioSessionId(int audioSessionId)

Sets the ID of the audio session to attach to the underlying android.media.AudioTrack.

void

Sets information on an auxiliary audio effect to attach to the underlying audio track.

void

Sets a listener of camera motion events.

void
setForegroundMode(boolean foregroundMode)

Sets whether the player is allowed to keep holding limited resources such as video decoders, even when in the idle state.

void
setHandleAudioBecomingNoisy(boolean handleAudioBecomingNoisy)

Sets whether the player should pause automatically when audio is rerouted from a headset to device speakers.

void

Sets the ImageOutput where rendered images will be forwarded.

void

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

void
setMediaSource(MediaSource mediaSource, boolean resetPosition)

Clears the playlist and adds the specified MediaSource.

void
setMediaSource(MediaSource mediaSource, long startPositionMs)

Clears the playlist and adds the specified MediaSource.

void

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

void
setMediaSources(List<MediaSource> mediaSources, boolean resetPosition)

Clears the playlist and adds the specified MediaSources.

void
setMediaSources(
    List<MediaSource> mediaSources,
    int startMediaItemIndex,
    long startPositionMs
)

Clears the playlist and adds the specified MediaSources.

void
setPauseAtEndOfMediaItems(boolean pauseAtEndOfMediaItems)

Sets whether to pause playback at the end of each media item.

void

Sets the preferred audio device.

void

Sets the preload configuration to configure playlist preloading.

void
setPriority(@C.Priority int priority)

Sets the C.Priority for this player.

void
setPriorityTaskManager(
    @Nullable PriorityTaskManager priorityTaskManager
)

Sets a PriorityTaskManager, or null to clear a previously set priority task manager.

void
setScrubbingModeEnabled(boolean scrubbingModeEnabled)

Sets whether to optimize the player for scrubbing (many frequent seeks).

void
setScrubbingModeParameters(
    ScrubbingModeParameters scrubbingModeParameters
)

Sets the parameters that control behavior in scrubbing mode.

void

Sets the parameters that control how seek operations are performed.

void

Sets the shuffle order.

void
setSkipSilenceEnabled(boolean skipSilenceEnabled)

Sets whether skipping silences in the audio stream is enabled.

void
setVideoChangeFrameRateStrategy(int videoChangeFrameRateStrategy)

Sets a C.VideoChangeFrameRateStrategy that will be used by the player when provided with a video output Surface.

void
setVideoEffects(List<Effect> videoEffects)

Sets a List of video effects that will be applied to each video frame.

void

Sets a listener to receive video frame metadata events.

void
setVideoScalingMode(int videoScalingMode)

Sets the C.VideoScalingMode.

void
setWakeMode(int wakeMode)

Sets how the player should keep the device awake for playback when the screen is off.

Inherited Constants

From androidx.media3.exoplayer.ExoPlayer
static final long

The default timeout for detaching a surface from the player, in milliseconds.

static final long

The default timeout for calls to release and setForegroundMode, in milliseconds.

From androidx.media3.common.Player
static final int

This field is deprecated.

Use COMMAND_ADJUST_DEVICE_VOLUME_WITH_FLAGS instead.

static final int

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

static final int

Command to change the media items in the playlist.

static final int

Command to get the player current AudioAttributes.

static final int

Command to get information about the currently playing MediaItem.

static final int

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

static final int

This field is deprecated.

Use COMMAND_GET_METADATA instead.

static final int

Command to get metadata related to the playlist and current MediaItem.

static final int

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

static final int

Command to get the information about the current timeline.

static final int

Command to get details of the current track selection.

static final int

Command to get the player volume.

static final int

Represents an invalid Command.

static final int

Command to start, pause or resume playback.

static final int

Command to prepare the player.

static final int

Command to release the player.

static final int

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

static final int

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

static final int

Command to seek anywhere inside the current MediaItem.

static final int

This field is deprecated.

Use COMMAND_SEEK_IN_CURRENT_MEDIA_ITEM instead.

static final int

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

static final int

Command to seek anywhere in any MediaItem.

static final int

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

static final int

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

static final int

This field is deprecated.

Use COMMAND_SEEK_TO_NEXT_MEDIA_ITEM instead.

static final int

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

static final int

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

static final int

This field is deprecated.

Use COMMAND_SEEK_TO_PREVIOUS_MEDIA_ITEM instead.

static final int

This field is deprecated.

Use COMMAND_SEEK_TO_MEDIA_ITEM instead.

static final int

Command to set the player's audio attributes.

static final int

This field is deprecated.

Use COMMAND_SET_DEVICE_VOLUME_WITH_FLAGS instead.

static final int

Command to set the device volume with volume flags.

static final int

Command to set a MediaItem.

static final int

This field is deprecated.

Use COMMAND_SET_PLAYLIST_METADATA instead.

static final int

Command to set the playlist metadata.

static final int

Command to set the repeat mode.

static final int

Command to enable shuffling.

static final int

Command to set the playback speed and pitch.

static final int

Command to set the player's track selection parameters.

static final int

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

static final int

Command to set the player volume.

static final int

Command to stop playback.

static final int

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

static final int

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

static final int

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

static final int

Seek within the current period or to another period.

static final int

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

static final int

Discontinuity introduced by a skipped silence.

static final int

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

static final int

getAudioAttributes changed.

static final int

The audio session id was set.

static final int

isCommandAvailable changed for at least one Command.

static final int

getCurrentCues changed.

static final int

getDeviceInfo changed.

static final int

getDeviceVolume or isDeviceMuted changed.

static final int

isLoading ()} changed.

static final int

isPlaying changed.

static final int

getMaxSeekToPreviousPosition changed.

static final int

getCurrentMediaItem changed or the player started repeating the current item.

static final int

getMediaMetadata changed.

static final int

Metadata associated with the current playback time changed.

static final int

getPlaybackParameters changed.

static final int

getPlaybackState changed.

static final int

getPlaybackSuppressionReason changed.

static final int

getPlayerError changed.

static final int

getPlaylistMetadata changed.

static final int

getPlayWhenReady changed.

static final int

A position discontinuity occurred.

static final 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.

static final int

getRepeatMode changed.

static final int

getSeekBackIncrement changed.

static final int

getSeekForwardIncrement changed.

static final int

getShuffleModeEnabled changed.

static final int

Skipping silences in the audio stream is enabled or disabled.

static final int

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

static final int

getCurrentTimeline changed.

static final int

getCurrentTracks changed.

static final int

getTrackSelectionParameters changed.

static final int

getVideoSize changed.

static final int

getVolume changed.

static final int

Playback has automatically transitioned to the next media item.

static final int

The current media item has changed because of a change in the playlist.

static final int

The media item has been repeated.

static final int

A seek to another media item has occurred.

static final int