docs/doc/reference/com/google/android/exoplayer2/SimpleBasePlayer.html
Package com.google.android.exoplayer2
All Implemented Interfaces:Player
[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public abstract classSimpleBasePlayerextends[BasePlayer](BasePlayer.html "class in com.google.android.exoplayer2")
Deprecated. com.google.android.exoplayer2 is deprecated. Please migrate to androidx.media3 (which contains the same ExoPlayer code). See the migration guide for more details, including a script to help with the migration.
A base implementation for Player that reduces the number of methods to implement to a minimum.
Implementation notes:
getState() to populate the current player state on request.SimpleBasePlayer.State should set the available commands to indicate which Player methods are supported.setPlayWhenReady(boolean)) forward to overridable methods (for example, handleSetPlayWhenReady(boolean)) that can be used to handle these requests. These methods return a ListenableFuture to indicate when the request has been handled and is fully reflected in the values returned from getState(). This class will automatically request a state update once the request is done. If the state changes can be handled synchronously, these methods can return Guava's Futures.immediateVoidFuture().invalidateState(), for example if something changes independent of Player method calls.This base class handles various aspects of the player implementation to simplify the subclass:
The SimpleBasePlayer.State can only be created with allowed combinations of state values, avoiding any invalid player states.
Only functionality that is declared as available needs to be implemented. Other methods are automatically ignored.
Listener handling and informing listeners of state changes is handled automatically.
The base class provides a framework for asynchronous handling of method calls. It changes the visible playback state immediately to the most likely outcome to ensure the user-visible state changes look like synchronous operations. The state is then updated again once the asynchronous method calls have been fully handled.
Nested Classes | Modifier and Type | Class | Description |
| --- | --- | --- |
| protected static class | SimpleBasePlayer.MediaItemData |
Deprecated.
An immutable description of an item in the playlist, containing both static setup information like MediaItem and dynamic data that is generally read from the media like the duration.
|
| protected static class | SimpleBasePlayer.PeriodData |
Deprecated.
Data describing the properties of a period inside a SimpleBasePlayer.MediaItemData.
|
| protected static interface | SimpleBasePlayer.PositionSupplier |
Deprecated.
A supplier for a position.
|
| protected static class | SimpleBasePlayer.State |
Deprecated.
An immutable state description of the player. |
-
Player.Command, Player.Commands, Player.DiscontinuityReason, Player.Event, Player.Events, Player.Listener, Player.MediaItemTransitionReason, Player.PlaybackSuppressionReason, Player.PlayWhenReadyChangeReason, Player.PositionInfo, Player.RepeatMode, Player.TimelineChangeReason
-
window
-
COMMAND_ADJUST_DEVICE_VOLUME, COMMAND_ADJUST_DEVICE_VOLUME_WITH_FLAGS, COMMAND_CHANGE_MEDIA_ITEMS, COMMAND_GET_AUDIO_ATTRIBUTES, COMMAND_GET_CURRENT_MEDIA_ITEM, COMMAND_GET_DEVICE_VOLUME, COMMAND_GET_MEDIA_ITEMS_METADATA, COMMAND_GET_METADATA, COMMAND_GET_TEXT, COMMAND_GET_TIMELINE, COMMAND_GET_TRACKS, COMMAND_GET_VOLUME, COMMAND_INVALID, COMMAND_PLAY_PAUSE, COMMAND_PREPARE, COMMAND_RELEASE, COMMAND_SEEK_BACK, COMMAND_SEEK_FORWARD, COMMAND_SEEK_IN_CURRENT_MEDIA_ITEM, COMMAND_SEEK_IN_CURRENT_WINDOW, COMMAND_SEEK_TO_DEFAULT_POSITION, COMMAND_SEEK_TO_MEDIA_ITEM, COMMAND_SEEK_TO_NEXT, COMMAND_SEEK_TO_NEXT_MEDIA_ITEM, COMMAND_SEEK_TO_NEXT_WINDOW, COMMAND_SEEK_TO_PREVIOUS, COMMAND_SEEK_TO_PREVIOUS_MEDIA_ITEM, COMMAND_SEEK_TO_PREVIOUS_WINDOW, COMMAND_SEEK_TO_WINDOW, COMMAND_SET_DEVICE_VOLUME, COMMAND_SET_DEVICE_VOLUME_WITH_FLAGS, COMMAND_SET_MEDIA_ITEM, COMMAND_SET_MEDIA_ITEMS_METADATA, COMMAND_SET_PLAYLIST_METADATA, COMMAND_SET_REPEAT_MODE, COMMAND_SET_SHUFFLE_MODE, COMMAND_SET_SPEED_AND_PITCH, COMMAND_SET_TRACK_SELECTION_PARAMETERS, COMMAND_SET_VIDEO_SURFACE, COMMAND_SET_VOLUME, COMMAND_STOP, DISCONTINUITY_REASON_AUTO_TRANSITION, DISCONTINUITY_REASON_INTERNAL, DISCONTINUITY_REASON_REMOVE, DISCONTINUITY_REASON_SEEK, DISCONTINUITY_REASON_SEEK_ADJUSTMENT, DISCONTINUITY_REASON_SKIP, EVENT_AUDIO_ATTRIBUTES_CHANGED, EVENT_AUDIO_SESSION_ID, EVENT_AVAILABLE_COMMANDS_CHANGED, EVENT_CUES, EVENT_DEVICE_INFO_CHANGED, EVENT_DEVICE_VOLUME_CHANGED, EVENT_IS_LOADING_CHANGED, EVENT_IS_PLAYING_CHANGED, EVENT_MAX_SEEK_TO_PREVIOUS_POSITION_CHANGED, EVENT_MEDIA_ITEM_TRANSITION, EVENT_MEDIA_METADATA_CHANGED, EVENT_METADATA, EVENT_PLAY_WHEN_READY_CHANGED, EVENT_PLAYBACK_PARAMETERS_CHANGED, EVENT_PLAYBACK_STATE_CHANGED, EVENT_PLAYBACK_SUPPRESSION_REASON_CHANGED, EVENT_PLAYER_ERROR, EVENT_PLAYLIST_METADATA_CHANGED, EVENT_POSITION_DISCONTINUITY, EVENT_RENDERED_FIRST_FRAME, EVENT_REPEAT_MODE_CHANGED, EVENT_SEEK_BACK_INCREMENT_CHANGED, EVENT_SEEK_FORWARD_INCREMENT_CHANGED, EVENT_SHUFFLE_MODE_ENABLED_CHANGED, EVENT_SKIP_SILENCE_ENABLED_CHANGED, EVENT_SURFACE_SIZE_CHANGED, EVENT_TIMELINE_CHANGED, EVENT_TRACK_SELECTION_PARAMETERS_CHANGED, EVENT_TRACKS_CHANGED, EVENT_VIDEO_SIZE_CHANGED, EVENT_VOLUME_CHANGED, MEDIA_ITEM_TRANSITION_REASON_AUTO, MEDIA_ITEM_TRANSITION_REASON_PLAYLIST_CHANGED, MEDIA_ITEM_TRANSITION_REASON_REPEAT, MEDIA_ITEM_TRANSITION_REASON_SEEK, PLAY_WHEN_READY_CHANGE_REASON_AUDIO_BECOMING_NOISY, PLAY_WHEN_READY_CHANGE_REASON_AUDIO_FOCUS_LOSS, PLAY_WHEN_READY_CHANGE_REASON_END_OF_MEDIA_ITEM, PLAY_WHEN_READY_CHANGE_REASON_REMOTE, PLAY_WHEN_READY_CHANGE_REASON_SUPPRESSED_TOO_LONG, PLAY_WHEN_READY_CHANGE_REASON_USER_REQUEST, PLAYBACK_SUPPRESSION_REASON_NONE, PLAYBACK_SUPPRESSION_REASON_TRANSIENT_AUDIO_FOCUS_LOSS, PLAYBACK_SUPPRESSION_REASON_UNSUITABLE_AUDIO_ROUTE, REPEAT_MODE_ALL, REPEAT_MODE_OFF, REPEAT_MODE_ONE, STATE_BUFFERING, STATE_ENDED, STATE_IDLE, STATE_READY, TIMELINE_CHANGE_REASON_PLAYLIST_CHANGED, TIMELINE_CHANGE_REASON_SOURCE_UPDATE
Constructors | Modifier | Constructor | Description |
| --- | --- | --- |
| protected | SimpleBasePlayer(Looper applicationLooper) |
Deprecated.
Creates the base class.
|
| protected | SimpleBasePlayer(Looper applicationLooper, Clock clock) |
Deprecated.
Creates the base class. |
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods | Modifier and Type | Method | Description |
| --- | --- | --- |
| void | addListener(Player.Listener listener) |
Deprecated.
Registers a listener to receive all events from the player.
|
| void | addMediaItems(int index, List<MediaItem> mediaItems) |
Deprecated.
Adds a list of media items at the given index of the playlist.
|
| void | clearVideoSurface() |
Deprecated.
Clears any Surface, SurfaceHolder, SurfaceView or TextureView currently set on the player.
|
| void | clearVideoSurface(Surface surface) |
Deprecated.
Clears the Surface onto which video is being rendered if it matches the one passed.
|
| void | clearVideoSurfaceHolder(SurfaceHolder surfaceHolder) |
Deprecated.
Clears the SurfaceHolder that holds the Surface onto which video is being rendered if it matches the one passed.
|
| void | clearVideoSurfaceView(SurfaceView surfaceView) |
Deprecated.
Clears the SurfaceView onto which video is being rendered if it matches the one passed.
|
| void | clearVideoTextureView(TextureView textureView) |
Deprecated.
Clears the TextureView onto which video is being rendered if it matches the one passed.
|
| void | decreaseDeviceVolume() |
Deprecated.
Use decreaseDeviceVolume(int) instead.
|
| void | decreaseDeviceVolume(@com.google.android.exoplayer2.C.VolumeFlags int flags) |
Deprecated.
Decreases the volume of the device.
|
| Looper | getApplicationLooper() |
Deprecated.
Returns the Looper associated with the application thread that's used to access the player and on which player events are received.
|
| AudioAttributes | getAudioAttributes() |
Deprecated.
Returns the attributes for audio playback.
|
| Player.Commands | getAvailableCommands() |
Deprecated.
Returns the player's currently available Player.Commands.
|
| long | getBufferedPosition() |
Deprecated.
Returns an estimate of the position in the current content or ad up to which data is buffered, in milliseconds.
|
| long | getContentBufferedPosition() |
Deprecated.
If Player.isPlayingAd() returns true, returns an estimate of the content position in the current content up to which data is buffered, in milliseconds.
|
| long | getContentPosition() |
Deprecated.
If Player.isPlayingAd() returns true, returns the content position that will be played once all ads in the ad group have finished playing, in milliseconds.
|
| int | getCurrentAdGroupIndex() |
Deprecated.
If Player.isPlayingAd() returns true, returns the index of the ad group in the period currently being played.
|
| int | getCurrentAdIndexInAdGroup() |
Deprecated.
If Player.isPlayingAd() returns true, returns the index of the ad in its ad group.
|
| CueGroup | getCurrentCues() |
Deprecated.
Returns the current CueGroup.
|
| int | getCurrentMediaItemIndex() |
Deprecated.
Returns the index of the current MediaItem in the timeline, or the prospective index if the current timeline is empty.
|
| int | getCurrentPeriodIndex() |
Deprecated.
Returns the index of the period currently being played.
|
| long | getCurrentPosition() |
Deprecated.
Returns the playback position in the current content or ad, in milliseconds, or the prospective position in milliseconds if the current timeline is empty.
|
| Timeline | getCurrentTimeline() |
Deprecated.
Returns the current Timeline.
|
| Tracks | getCurrentTracks() |
Deprecated.
Returns the current tracks.
|
| DeviceInfo | getDeviceInfo() |
Deprecated.
Gets the device information.
|
| int | getDeviceVolume() |
Deprecated.
Gets the current volume of the device.
|
| long | getDuration() |
Deprecated.
Returns the duration of the current content or ad in milliseconds, or C.TIME_UNSET if the duration is not known.
|
| long | getMaxSeekToPreviousPosition() |
Deprecated.
Returns the maximum position for which Player.seekToPrevious() seeks to the previous MediaItem, in milliseconds.
|
| MediaMetadata | getMediaMetadata() |
Deprecated.
Returns the current combined MediaMetadata, or MediaMetadata.EMPTY if not supported.
|
| protected SimpleBasePlayer.MediaItemData | getPlaceholderMediaItemData(MediaItem mediaItem) |
Deprecated.
Returns the placeholder SimpleBasePlayer.MediaItemData used for a new MediaItem added to the playlist.
|
| protected SimpleBasePlayer.State | getPlaceholderState(SimpleBasePlayer.State suggestedPlaceholderState) |
Deprecated.
Returns the placeholder state used while a player method is handled asynchronously.
|
| PlaybackParameters | getPlaybackParameters() |
Deprecated.
Returns the currently active playback parameters.
|
| @com.google.android.exoplayer2.Player.State int | getPlaybackState() |
Deprecated.
Returns the current playback state of the player.
|
| int | getPlaybackSuppressionReason() |
Deprecated.
Returns the reason why playback is suppressed even though Player.getPlayWhenReady() is true, or Player.PLAYBACK_SUPPRESSION_REASON_NONE if playback is not suppressed.
|
| PlaybackException | getPlayerError() |
Deprecated.
Returns the error that caused playback to fail.
|
| MediaMetadata | getPlaylistMetadata() |
Deprecated.
Returns the playlist MediaMetadata, as set by Player.setPlaylistMetadata(MediaMetadata), or MediaMetadata.EMPTY if not supported.
|
| boolean | getPlayWhenReady() |
Deprecated.
Whether playback will proceed when Player.getPlaybackState() == Player.STATE_READY.
|
| @com.google.android.exoplayer2.Player.RepeatMode int | getRepeatMode() |
Deprecated.
Returns the current Player.RepeatMode used for playback.
|
| long | getSeekBackIncrement() |
Deprecated.
Returns the Player.seekBack() increment.
|
| long | getSeekForwardIncrement() |
Deprecated.
Returns the Player.seekForward() increment.
|
| boolean | getShuffleModeEnabled() |
Deprecated.
Returns whether shuffling of media items is enabled.
|
| protected abstract SimpleBasePlayer.State | getState() |
Deprecated.
Returns the current SimpleBasePlayer.State of the player.
|
| Size | getSurfaceSize() |
Deprecated.
Gets the size of the surface on which the video is rendered.
|
| long | getTotalBufferedDuration() |
Deprecated.
Returns an estimate of the total buffered duration from the current position, in milliseconds.
|
| TrackSelectionParameters | getTrackSelectionParameters() |
Deprecated.
Returns the parameters constraining the track selection.
|
| VideoSize | getVideoSize() |
Deprecated.
Gets the size of the video.
|
| float | getVolume() |
Deprecated.
Returns the audio volume, with 0 being silence and 1 being unity gain (signal unchanged).
|
| protected ListenableFuture<?> | handleAddMediaItems(int index, List<MediaItem> mediaItems) |
Deprecated.
Handles calls to Player.addMediaItem(com.google.android.exoplayer2.MediaItem) and Player.addMediaItems(java.util.List<com.google.android.exoplayer2.MediaItem>).
|
| protected ListenableFuture<?> | handleClearVideoOutput(Object videoOutput) |
Deprecated.
Handles calls to clear the video output.
|
| protected ListenableFuture<?> | handleDecreaseDeviceVolume(@com.google.android.exoplayer2.C.VolumeFlags int flags) |
Deprecated.
Handles calls to Player.decreaseDeviceVolume() and Player.decreaseDeviceVolume(int).
|
| protected ListenableFuture<?> | handleIncreaseDeviceVolume(@com.google.android.exoplayer2.C.VolumeFlags int flags) |
Deprecated.
Handles calls to Player.increaseDeviceVolume() and Player.increaseDeviceVolume(int).
|
| protected ListenableFuture<?> | handleMoveMediaItems(int fromIndex, int toIndex, int newIndex) |
Deprecated.
Handles calls to Player.moveMediaItem(int, int) and Player.moveMediaItems(int, int, int).
|
| protected ListenableFuture<?> | handlePrepare() |
Deprecated.
Handles calls to Player.prepare().
|
| protected ListenableFuture<?> | handleRelease() |
Deprecated.
Handles calls to Player.release().
|
| protected ListenableFuture<?> | handleRemoveMediaItems(int fromIndex, int toIndex) |
Deprecated.
Handles calls to Player.removeMediaItem(int) and Player.removeMediaItems(int, int).
|
| protected ListenableFuture<?> | handleReplaceMediaItems(int fromIndex, int toIndex, List<MediaItem> mediaItems) |
Deprecated.
Handles calls to Player.replaceMediaItem(int, com.google.android.exoplayer2.MediaItem) and Player.replaceMediaItems(int, int, java.util.List<com.google.android.exoplayer2.MediaItem>).
|
| protected ListenableFuture<?> | handleSeek(int mediaItemIndex, long positionMs, @com.google.android.exoplayer2.Player.Command int seekCommand) |
Deprecated.
Handles calls to Player.seekTo(long) and other seek operations (for example, Player.seekToNext()).
|
| protected ListenableFuture<?> | handleSetDeviceMuted(boolean muted, @com.google.android.exoplayer2.C.VolumeFlags int flags) |
Deprecated.
Handles calls to Player.setDeviceMuted(boolean) and Player.setDeviceMuted(boolean, int).
|
| protected ListenableFuture<?> | handleSetDeviceVolume(int deviceVolume, int flags) |
Deprecated.
Handles calls to Player.setDeviceVolume(int) and Player.setDeviceVolume(int, int).
|
| protected ListenableFuture<?> | handleSetMediaItems(List<MediaItem> mediaItems, int startIndex, long startPositionMs) |
Deprecated.
Handles calls to Player.setMediaItem(com.google.android.exoplayer2.MediaItem) and Player.setMediaItems(java.util.List<com.google.android.exoplayer2.MediaItem>).
|
| protected ListenableFuture<?> | handleSetPlaybackParameters(PlaybackParameters playbackParameters) |
Deprecated.
Handles calls to Player.setPlaybackParameters(com.google.android.exoplayer2.PlaybackParameters) or Player.setPlaybackSpeed(float).
|
| protected ListenableFuture<?> | handleSetPlaylistMetadata(MediaMetadata playlistMetadata) |
Deprecated.
Handles calls to Player.setPlaylistMetadata(com.google.android.exoplayer2.MediaMetadata).
|
| protected ListenableFuture<?> | handleSetPlayWhenReady(boolean playWhenReady) |
Deprecated.
Handles calls to Player.setPlayWhenReady(boolean), Player.play() and Player.pause().
|
| protected ListenableFuture<?> | handleSetRepeatMode(@com.google.android.exoplayer2.Player.RepeatMode int repeatMode) |
Deprecated.
Handles calls to Player.setRepeatMode(@com.google.android.exoplayer2.Player.RepeatMode int).
|
| protected ListenableFuture<?> | handleSetShuffleModeEnabled(boolean shuffleModeEnabled) |
Deprecated.
Handles calls to Player.setShuffleModeEnabled(boolean).
|
| protected ListenableFuture<?> | handleSetTrackSelectionParameters(TrackSelectionParameters trackSelectionParameters) |
Deprecated.
Handles calls to Player.setTrackSelectionParameters(com.google.android.exoplayer2.trackselection.TrackSelectionParameters).
|
| protected ListenableFuture<?> | handleSetVideoOutput(Object videoOutput) |
Deprecated.
Handles calls to set the video output.
|
| protected ListenableFuture<?> | handleSetVolume(float volume) |
Deprecated.
Handles calls to Player.setVolume(float).
|
| protected ListenableFuture<?> | handleStop() |
Deprecated.
Handles calls to Player.stop().
|
| void | increaseDeviceVolume() |
Deprecated.
Use increaseDeviceVolume(int) instead.
|
| void | increaseDeviceVolume(@com.google.android.exoplayer2.C.VolumeFlags int flags) |
Deprecated.
Increases the volume of the device.
|
| protected void | invalidateState() |
Deprecated.
Invalidates the current state.
|
| boolean | isDeviceMuted() |
Deprecated.
Gets whether the device is muted or not.
|
| boolean | isLoading() |
Deprecated.
Whether the player is currently loading the source.
|
| boolean | isPlayingAd() |
Deprecated.
Returns whether the player is currently playing an ad.
|
| void | moveMediaItems(int fromIndex, int toIndex, int newIndex) |
Deprecated.
Moves the media item range to the new index.
|
| void | prepare() |
Deprecated.
Prepares the player.
|
| void | release() |
Deprecated.
Releases the player.
|
| void | removeListener(Player.Listener listener) |
Deprecated.
Unregister a listener registered through Player.addListener(Listener).
|
| void | removeMediaItems(int fromIndex, int toIndex) |
Deprecated.
Removes a range of media items from the playlist.
|
| void | replaceMediaItems(int fromIndex, int toIndex, List<MediaItem> mediaItems) |
Deprecated.
Replaces the media items at the given range of the playlist.
|
| void | seekTo(int mediaItemIndex, long positionMs, @com.google.android.exoplayer2.Player.Command int seekCommand, boolean isRepeatingCurrentItem) |
Deprecated.
Seeks to a position in the specified MediaItem.
|
| void | setDeviceMuted(boolean muted) |
Deprecated.
Use setDeviceMuted(boolean, int) instead.
|
| void | setDeviceMuted(boolean muted, @com.google.android.exoplayer2.C.VolumeFlags int flags) |
Deprecated.
Sets the mute state of the device.
|
| void | setDeviceVolume(int volume) |
Deprecated.
Use setDeviceVolume(int, int) instead.
|
| void | setDeviceVolume(int volume, @com.google.android.exoplayer2.C.VolumeFlags int flags) |
Deprecated.
Sets the volume of the device with volume flags.
|
| void | setMediaItems(List<MediaItem> mediaItems, boolean resetPosition) |
Deprecated.
Clears the playlist and adds the specified media items.
|
| void | setMediaItems(List<MediaItem> mediaItems, int startIndex, long startPositionMs) |
Deprecated.
Clears the playlist and adds the specified media items.
|
| void | setPlaybackParameters(PlaybackParameters playbackParameters) |
Deprecated.
Attempts to set the playback parameters.
|
| void | setPlaylistMetadata(MediaMetadata mediaMetadata) |
Deprecated.
Sets the playlist MediaMetadata.
|
| void | setPlayWhenReady(boolean playWhenReady) |
Deprecated.
Sets whether playback should proceed when Player.getPlaybackState() == Player.STATE_READY.
|
| void | setRepeatMode(@com.google.android.exoplayer2.Player.RepeatMode int repeatMode) |
Deprecated.
Sets the Player.RepeatMode to be used for playback.
|
| void | setShuffleModeEnabled(boolean shuffleModeEnabled) |
Deprecated.
Sets whether shuffling of media items is enabled.
|
| void | setTrackSelectionParameters(TrackSelectionParameters parameters) |
Deprecated.
Sets the parameters constraining the track selection.
|
| void | setVideoSurface(Surface surface) |
Deprecated.
Sets the Surface onto which video will be rendered.
|
| void | setVideoSurfaceHolder(SurfaceHolder surfaceHolder) |
Deprecated.
Sets the SurfaceHolder that holds the Surface onto which video will be rendered.
|
| void | setVideoSurfaceView(SurfaceView surfaceView) |
Deprecated.
Sets the SurfaceView onto which video will be rendered.
|
| void | setVideoTextureView(TextureView textureView) |
Deprecated.
Sets the TextureView onto which video will be rendered.
|
| void | setVolume(float volume) |
Deprecated.
Sets the audio volume, valid values are between 0 (silence) and 1 (unity gain, signal unchanged), inclusive.
|
| void | stop() |
Deprecated.
Stops playback without resetting the playlist. |
-
addMediaItem, addMediaItem, addMediaItems, canAdvertiseSession, clearMediaItems, getBufferedPercentage, getContentDuration, getCurrentLiveOffset, getCurrentManifest, getCurrentMediaItem, getCurrentWindowIndex, getMediaItemAt, getMediaItemCount, getNextMediaItemIndex, getNextWindowIndex, getPreviousMediaItemIndex, getPreviousWindowIndex, hasNext, hasNextMediaItem, hasNextWindow, hasPrevious, hasPreviousMediaItem, hasPreviousWindow, isCommandAvailable, isCurrentMediaItemDynamic, isCurrentMediaItemLive, isCurrentMediaItemSeekable, isCurrentWindowDynamic, isCurrentWindowLive, isCurrentWindowSeekable, isPlaying, moveMediaItem, next, pause, play, previous, removeMediaItem, replaceMediaItem, seekBack, seekForward, seekTo, seekTo, seekToDefaultPosition, seekToDefaultPosition, seekToNext, seekToNextMediaItem, seekToNextWindow, seekToPrevious, seekToPreviousMediaItem, seekToPreviousWindow, setMediaItem, setMediaItem, setMediaItem, setMediaItems, setPlaybackSpeed
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
protected SimpleBasePlayer([Looper](https://developer.android.com/reference/android/os/Looper.html "class or interface in android.os")applicationLooper)
Deprecated.
Creates the base class.
Parameters:applicationLooper - The Looper that must be used for all calls to the player and that is used to call listeners on.
-
protected SimpleBasePlayer([Looper](https://developer.android.com/reference/android/os/Looper.html "class or interface in android.os")applicationLooper,[Clock](util/Clock.html "interface in com.google.android.exoplayer2.util")clock)
Deprecated.
Creates the base class.
Parameters:applicationLooper - The Looper that must be used for all calls to the player and that is used to call listeners on.clock - The Clock that will be used by the player.
-
public final void addListener([Player.Listener](Player.Listener.html "interface in com.google.android.exoplayer2")listener)
Deprecated.
Description copied from interface: Player
Registers a listener to receive all events from the player.
The listener's methods will be called on the thread associated with Player.getApplicationLooper().
This method can be called from any thread.
Parameters:listener - The listener to register.
-
public final void removeListener([Player.Listener](Player.Listener.html "interface in com.google.android.exoplayer2")listener)
Deprecated.
Description copied from interface: Player
Unregister a listener registered through Player.addListener(Listener). The listener will no longer receive events.
Parameters:listener - The listener to unregister.
-
public final[Looper](https://developer.android.com/reference/android/os/Looper.html "class or interface in android.os")getApplicationLooper()
Deprecated.
Description copied from interface: Player
Returns the Looper associated with the application thread that's used to access the player and on which player events are received.
This method can be called from any thread.
-
public final[Player.Commands](Player.Commands.html "class in com.google.android.exoplayer2")getAvailableCommands()
Deprecated.
Description copied from interface: Player
Returns the player's currently available Player.Commands.
The returned Player.Commands are not updated when available commands change. Use Player.Listener.onAvailableCommandsChanged(Commands) to get an update when the available commands change.
Returns:The currently available Player.Commands.See Also:Player.Listener.onAvailableCommandsChanged(com.google.android.exoplayer2.Player.Commands)
-
public final void setPlayWhenReady(boolean playWhenReady)
Deprecated.
Description copied from interface: Player
Sets whether playback should proceed when Player.getPlaybackState() == Player.STATE_READY.
If the player is already in the ready state then this method pauses and resumes playback.
This method must only be called if Player.COMMAND_PLAY_PAUSE is available.
Parameters:playWhenReady - Whether playback should proceed when ready.
-
public final boolean getPlayWhenReady()
Deprecated.
Description copied from interface: Player
Whether playback will proceed when Player.getPlaybackState() == Player.STATE_READY.
Returns:Whether playback will proceed when ready.See Also:Player.Listener.onPlayWhenReadyChanged(boolean, int)
-
public final void setMediaItems([List](https://developer.android.com/reference/java/util/List.html "class or interface in java.util")<[MediaItem](MediaItem.html "class in com.google.android.exoplayer2")> mediaItems,
boolean resetPosition)
Deprecated.
Description copied from interface: Player
Clears the playlist and adds the specified media items.
This method must only be called if Player.COMMAND_CHANGE_MEDIA_ITEMS is available.
Parameters:mediaItems - The new media items.resetPosition - Whether the playback position should be reset to the default position in the first Timeline.Window. If false, playback will start from the position defined by Player.getCurrentMediaItemIndex() and Player.getCurrentPosition().
-
public final void setMediaItems([List](https://developer.android.com/reference/java/util/List.html "class or interface in java.util")<[MediaItem](MediaItem.html "class in com.google.android.exoplayer2")> mediaItems,
int startIndex,
long startPositionMs)
Deprecated.
Description copied from interface: Player
Clears the playlist and adds the specified media items.
This method must only be called if Player.COMMAND_CHANGE_MEDIA_ITEMS is available.
Parameters:mediaItems - The new media items.startIndex - The MediaItem index to start playback from. If C.INDEX_UNSET is passed, the current position is not reset.startPositionMs - The position in milliseconds to start playback from. If C.TIME_UNSET is passed, the default position of the given MediaItem is used. In any case, if startIndex is set to C.INDEX_UNSET, this parameter is ignored and the position is not reset at all.
-
public final void addMediaItems(int index,[List](https://developer.android.com/reference/java/util/List.html "class or interface in java.util")<[MediaItem](MediaItem.html "class in com.google.android.exoplayer2")> mediaItems)
Deprecated.
Description copied from interface: Player
Adds a list of media items at the given index of the playlist.
This method must only be called if Player.COMMAND_CHANGE_MEDIA_ITEMS is available.
Parameters:index - The index at which to add the media items. If the index is larger than the size of the playlist, the media items are added to the end of the playlist.mediaItems - The media items to add.
-
public final void moveMediaItems(int fromIndex,
int toIndex,
int newIndex)
Deprecated.
Description copied from interface: Player
Moves the media item range to the new index.
This method must only be called if Player.COMMAND_CHANGE_MEDIA_ITEMS is available.
Parameters:fromIndex - The start of the range to move. If the index is larger than the size of the playlist, the request is ignored.toIndex - The first item not to be included in the range (exclusive). If the index is larger than the size of the playlist, items up to the end of the playlist are moved.newIndex - The new index of the first media item of the range. If the new index is larger than the size of the remaining playlist after removing the range, the range is moved to the end of the playlist.
-
public final void replaceMediaItems(int fromIndex,
int toIndex,[List](https://developer.android.com/reference/java/util/List.html "class or interface in java.util")<[MediaItem](MediaItem.html "class in com.google.android.exoplayer2")> mediaItems)
Deprecated.
Description copied from interface: Player
Replaces the media items at the given range of the playlist.
This method must only be called if Player.COMMAND_CHANGE_MEDIA_ITEMS is available.
Note that it is possible to replace a range with an arbitrary number of new items, so that the number of removed items defined by fromIndex and toIndex does not have to match the number of added items defined by mediaItems. As result, it may also change the index of subsequent items not touched by this operation.
Parameters:fromIndex - The start of the range. If the index is larger than the size of the playlist, the request is ignored.toIndex - The first item not to be included in the range (exclusive). If the index is larger than the size of the playlist, items up to the end of the playlist are replaced.mediaItems - The media items to replace the range with.
-
public final void removeMediaItems(int fromIndex,
int toIndex)
Deprecated.
Description copied from interface: Player
Removes a range of media items from the playlist.
This method must only be called if Player.COMMAND_CHANGE_MEDIA_ITEMS is available.
Parameters:fromIndex - The index at which to start removing media items. If the index is larger than the size of the playlist, the request is ignored.toIndex - The index of the first item to be kept (exclusive). If the index is larger than the size of the playlist, media items up to the end of the playlist are removed.
-
public final void prepare()
Deprecated.
Description copied from interface: Player
Prepares the player.
This method must only be called if Player.COMMAND_PREPARE is available.
This will move the player out of idle state and the player will start loading media and acquire resources needed for playback.
-
[@State](Player.State.html "annotation in com.google.android.exoplayer2")public final @com.google.android.exoplayer2.Player.State int getPlaybackState()
Deprecated.
Description copied from interface: Player
Returns the current playback state of the player.
Returns:The current playback state.See Also:Player.Listener.onPlaybackStateChanged(int)
-
public final int getPlaybackSuppressionReason()
Deprecated.
Description copied from interface: Player
Returns the reason why playback is suppressed even though Player.getPlayWhenReady() is true, or Player.PLAYBACK_SUPPRESSION_REASON_NONE if playback is not suppressed.
Returns:The current Player.PlaybackSuppressionReason.See Also:Player.Listener.onPlaybackSuppressionReasonChanged(int)
-
@Nullable
public final[PlaybackException](PlaybackException.html "class in com.google.android.exoplayer2")getPlayerError()
Deprecated.
Description copied from interface: Player
Returns the error that caused playback to fail. This is the same error that will have been reported via Player.Listener.onPlayerError(PlaybackException) at the time of failure. It can be queried using this method until the player is re-prepared.
Note that this method will always return null if Player.getPlaybackState() is not Player.STATE_IDLE.
Returns:The error, or null.See Also:Player.Listener.onPlayerError(PlaybackException)
-
public final void setRepeatMode([@RepeatMode](Player.RepeatMode.html "annotation in com.google.android.exoplayer2")@com.google.android.exoplayer2.Player.RepeatMode int repeatMode)
Deprecated.
Description copied from interface: Player
Sets the Player.RepeatMode to be used for playback.
This method must only be called if Player.COMMAND_SET_REPEAT_MODE is available.
Parameters:repeatMode - The repeat mode.
-
[@RepeatMode](Player.RepeatMode.html "annotation in com.google.android.exoplayer2")public final @com.google.android.exoplayer2.Player.RepeatMode int getRepeatMode()
Deprecated.
Description copied from interface: Player
Returns the current Player.RepeatMode used for playback.
Returns:The current repeat mode.See Also:Player.Listener.onRepeatModeChanged(int)
-
public final void setShuffleModeEnabled(boolean shuffleModeEnabled)
Deprecated.
Description copied from interface: Player
Sets whether shuffling of media items is enabled.
This method must only be called if Player.COMMAND_SET_SHUFFLE_MODE is available.
Parameters:shuffleModeEnabled - Whether shuffling is enabled.
-
public final boolean getShuffleModeEnabled()
Deprecated.
Description copied from interface: Player
Returns whether shuffling of media items is enabled.
See Also:Player.Listener.onShuffleModeEnabledChanged(boolean)
-
public final boolean isLoading()
Deprecated.
Description copied from interface: Player
Whether the player is currently loading the source.
Returns:Whether the player is currently loading the source.See Also:Player.Listener.onIsLoadingChanged(boolean)
-
public final void seekTo(int mediaItemIndex,
long positionMs,[@Command](Player.Command.html "annotation in com.google.android.exoplayer2")@com.google.android.exoplayer2.Player.Command int seekCommand,
boolean isRepeatingCurrentItem)
Deprecated.
Description copied from class: BasePlayer
Seeks to a position in the specified MediaItem.
Specified by:seekTo in class BasePlayerParameters:mediaItemIndex - The index of the MediaItem.positionMs - The seek position in the specified MediaItem in milliseconds, or C.TIME_UNSET to seek to the media item's default position.seekCommand - The Player.Command used to trigger the seek.isRepeatingCurrentItem - Whether this seeks repeats the current item.
-
public final long getSeekBackIncrement()
Deprecated.
Description copied from interface: Player
Returns the Player.seekBack() increment.
Returns:The seek back increment, in milliseconds.See Also:Player.Listener.onSeekBackIncrementChanged(long)
-
public final long getSeekForwardIncrement()
Deprecated.
Description copied from interface: Player
Returns the Player.seekForward() increment.
Returns:The seek forward increment, in milliseconds.See Also:Player.Listener.onSeekForwardIncrementChanged(long)
-
public final long getMaxSeekToPreviousPosition()
Deprecated.
Description copied from interface: Player
Returns the maximum position for which Player.seekToPrevious() seeks to the previous MediaItem, in milliseconds.
Returns:The maximum seek to previous position, in milliseconds.See Also:Player.Listener.onMaxSeekToPreviousPositionChanged(long)
-
public final void setPlaybackParameters([PlaybackParameters](PlaybackParameters.html "class in com.google.android.exoplayer2")playbackParameters)
Deprecated.
Description copied from interface: Player
Attempts to set the playback parameters. Passing PlaybackParameters.DEFAULT resets the player to the default, which means there is no speed or pitch adjustment.
Playback parameters changes may cause the player to buffer. Player.Listener.onPlaybackParametersChanged(PlaybackParameters) will be called whenever the currently active playback parameters change.
This method must only be called if Player.COMMAND_SET_SPEED_AND_PITCH is available.
Parameters:playbackParameters - The playback parameters.
-
public final[PlaybackParameters](PlaybackParameters.html "class in com.google.android.exoplayer2")getPlaybackParameters()
Deprecated.
Description copied from interface: Player
Returns the currently active playback parameters.
See Also:Player.Listener.onPlaybackParametersChanged(PlaybackParameters)
-
public final void stop()
Deprecated.
Description copied from interface: Player
Stops playback without resetting the playlist. Use Player.pause() rather than this method if the intention is to pause playback.
Calling this method will cause the playback state to transition to Player.STATE_IDLE and the player will release the loaded media and resources required for playback. The player instance can still be used by calling Player.prepare() again, and Player.release() must still be called on the player if it's no longer required.
Calling this method does not clear the playlist, reset the playback position or the playback error.
This method must only be called if Player.COMMAND_STOP is available.
-
public final void release()
Deprecated.
Description copied from interface: Player
Releases the player. This method must be called when the player is no longer required. The player must not be used after calling this method.
This method must only be called if Player.COMMAND_RELEASE is available.
-
public final[Tracks](Tracks.html "class in com.google.android.exoplayer2")getCurrentTracks()
Deprecated.
Description copied from interface: Player
Returns the current tracks.
This method must only be called if Player.COMMAND_GET_TRACKS is available.
See Also:Player.Listener.onTracksChanged(Tracks)
-
public final[TrackSelectionParameters](trackselection/TrackSelectionParameters.html "class in com.google.android.exoplayer2.trackselection")getTrackSelectionParameters()
Deprecated.
Description copied from interface: Player
Returns the parameters constraining the track selection.
See Also:}
-
public final void setTrackSelectionParameters([TrackSelectionParameters](trackselection/TrackSelectionParameters.html "class in com.google.android.exoplayer2.trackselection")parameters)
Deprecated.
Description copied from interface: Player
Sets the parameters constraining the track selection.
Unsupported parameters will be silently ignored.
Use Player.getTrackSelectionParameters() to retrieve the current parameters. For example, the following snippet restricts video to SD whilst keep other track selection parameters unchanged:
player.setTrackSelectionParameters(
player.getTrackSelectionParameters()
.buildUpon()
.setMaxVideoSizeSd()
.build())
This method must only be called if Player.COMMAND_SET_TRACK_SELECTION_PARAMETERS is available.
-
public final[MediaMetadata](MediaMetadata.html "class in com.google.android.exoplayer2")getMediaMetadata()
Deprecated.
Description copied from interface: Player
Returns the current combined MediaMetadata, or MediaMetadata.EMPTY if not supported.
This MediaMetadata is a combination of the MediaItem metadata, the static metadata in the media's Format, and any timed metadata that has been parsed from the media and output via Player.Listener.onMetadata(Metadata). If a field is populated in the MediaItem.mediaMetadata, it will be prioritised above the same field coming from static or timed metadata.
This method must only be called if Player.COMMAND_GET_METADATA is available.
-
public final[MediaMetadata](MediaMetadata.html "class in com.google.android.exoplayer2")getPlaylistMetadata()
Deprecated.
Description copied from interface: Player
Returns the playlist MediaMetadata, as set by Player.setPlaylistMetadata(MediaMetadata), or MediaMetadata.EMPTY if not supported.
This method must only be called if Player.COMMAND_GET_METADATA is available.
-
public final void setPlaylistMetadata([MediaMetadata](MediaMetadata.html "class in com.google.android.exoplayer2")mediaMetadata)
Deprecated.
Description copied from interface: Player
Sets the playlist MediaMetadata.
This method must only be called if Player.COMMAND_SET_PLAYLIST_METADATA is available.
-
public final[Timeline](Timeline.html "class in com.google.android.exoplayer2")getCurrentTimeline()
Deprecated.
Description copied from interface: Player
Returns the current Timeline. Never null, but may be empty.
This method must only be called if Player.COMMAND_GET_TIMELINE is available.
See Also:Player.Listener.onTimelineChanged(Timeline, int)
-
public final int getCurrentPeriodIndex()
Deprecated.
Description copied from interface: Player
Returns the index of the period currently being played.
This method must only be called if Player.COMMAND_GET_TIMELINE is available.
-
public final int getCurrentMediaItemIndex()
Deprecated.
Description copied from interface: Player
Returns the index of the current MediaItem in the timeline, or the prospective index if the current timeline is empty.
This method must only be called if Player.COMMAND_GET_TIMELINE is available.
-
public final long getDuration()
Deprecated.
Description copied from interface: Player
Returns the duration of the current content or ad in milliseconds, or C.TIME_UNSET if the duration is not known.
This method must only be called if Player.COMMAND_GET_CURRENT_MEDIA_ITEM is available.
-
public final long getCurrentPosition()
Deprecated.
Description copied from interface: Player
Returns the playback position in the current content or ad, in milliseconds, or the prospective position in milliseconds if the current timeline is empty.
This method must only be called if Player.COMMAND_GET_CURRENT_MEDIA_ITEM is available.
-
public final long getBufferedPosition()
Deprecated.
Description copied from interface: Player
Returns an estimate of the position in the current content or ad up to which data is buffered, in milliseconds.
This method must only be called if Player.COMMAND_GET_CURRENT_MEDIA_ITEM is available.
-
public final long getTotalBufferedDuration()
Deprecated.
Description copied from interface: Player
Returns an estimate of the total buffered duration from the current position, in milliseconds. This includes pre-buffered data for subsequent ads and media items.
This method must only be called if Player.COMMAND_GET_CURRENT_MEDIA_ITEM is available.
-
public final boolean isPlayingAd()
Deprecated.
Description copied from interface: Player
Returns whether the player is currently playing an ad.
This method must only be called if Player.COMMAND_GET_CURRENT_MEDIA_ITEM is available.
-
public final int getCurrentAdGroupIndex()
Deprecated.
Description copied from interface: Player
If Player.isPlayingAd() returns true, returns the index of the ad group in the period currently being played. Returns C.INDEX_UNSET otherwise.
This method must only be called if Player.COMMAND_GET_CURRENT_MEDIA_ITEM is available.
-
public final int getCurrentAdIndexInAdGroup()
Deprecated.
Description copied from interface: Player
If Player.isPlayingAd() returns true, returns the index of the ad in its ad group. Returns C.INDEX_UNSET otherwise.
This method must only be called if Player.COMMAND_GET_CURRENT_MEDIA_ITEM is available.
-
public final long getContentPosition()
Deprecated.
Description copied from interface: Player
If Player.isPlayingAd() returns true, returns the content position that will be played once all ads in the ad group have finished playing, in milliseconds. If there is no ad playing, the returned position is the same as that returned by Player.getCurrentPosition().
This method must only be called if Player.COMMAND_GET_CURRENT_MEDIA_ITEM is available.
-
public final long getContentBufferedPosition()
Deprecated.
Description copied from interface: Player
If Player.isPlayingAd() returns true, returns an estimate of the content position in the current content up to which data is buffered, in milliseconds. If there is no ad playing, the returned position is the same as that returned by Player.getBufferedPosition().
This method must only be called if Player.COMMAND_GET_CURRENT_MEDIA_ITEM is available.
-
public final[AudioAttributes](audio/AudioAttributes.html "class in com.google.android.exoplayer2.audio")getAudioAttributes()
Deprecated.
Description copied from interface: Player
Returns the attributes for audio playback.
This method must only be called if Player.COMMAND_GET_AUDIO_ATTRIBUTES is available.
-
public final void setVolume(float volume)
Deprecated.
Description copied from interface: Player
Sets the audio volume, valid values are between 0 (silence) and 1 (unity gain, signal unchanged), inclusive.
This method must only be called if Player.COMMAND_SET_VOLUME is available.
Parameters:volume - Linear output gain to apply to all audio channels.
-
public final float getVolume()
Deprecated.
Description copied from interface: Player
Returns the audio volume, with 0 being silence and 1 being unity gain (signal unchanged).
This method must only be called if Player.COMMAND_GET_VOLUME is available.
Returns:The linear gain applied to all audio channels.
-
public final void setVideoSurface(@Nullable[Surface](https://developer.android.com/reference/android/view/Surface.html "class or interface in android.view")surface)
Deprecated.
Description copied from interface: Player
Sets the Surface onto which video will be rendered. The caller is responsible for tracking the lifecycle of the surface, and must clear the surface by calling setVideoSurface(null) if the surface is destroyed.
If the surface is held by a SurfaceView, TextureView or SurfaceHolder then it's recommended to use Player.setVideoSurfaceView(SurfaceView), Player.setVideoTextureView(TextureView) or Player.setVideoSurfaceHolder(SurfaceHolder) rather than this method, since passing the holder allows the player to track the lifecycle of the surface automatically.
This method must only be called if Player.COMMAND_SET_VIDEO_SURFACE is available.
Parameters:surface - The Surface.
-
public final void setVideoSurfaceHolder(@Nullable[SurfaceHolder](https://developer.android.com/reference/android/view/SurfaceHolder.html "class or interface in android.view")surfaceHolder)
Deprecated.
Description copied from interface: Player
Sets the SurfaceHolder that holds the Surface onto which video will be rendered. The player will track the lifecycle of the surface automatically.
The thread that calls the SurfaceHolder.Callback methods must be the thread associated with Player.getApplicationLooper().
This method must only be called if Player.COMMAND_SET_VIDEO_SURFACE is available.
Parameters:surfaceHolder - The surface holder.
-
public final void setVideoSurfaceView(@Nullable[SurfaceView](https://developer.android.com/reference/android/view/SurfaceView.html "class or interface in android.view")surfaceView)
Deprecated.
Description copied from interface: Player
Sets the SurfaceView onto which video will be rendered. The player will track the lifecycle of the surface automatically.
The thread that calls the SurfaceHolder.Callback methods must be the thread associated with Player.getApplicationLooper().
This method must only be called if Player.COMMAND_SET_VIDEO_SURFACE is available.
Parameters:surfaceView - The surface view.
-
public final void setVideoTextureView(@Nullable[TextureView](https://developer.android.com/reference/android/view/TextureView.html "class or interface in android.view")textureView)
Deprecated.
Description copied from interface: Player
Sets the TextureView onto which video will be rendered. The player will track the lifecycle of the surface automatically.
The thread that calls the TextureView.SurfaceTextureListener methods must be the thread associated with Player.getApplicationLooper().
This method must only be called if Player.COMMAND_SET_VIDEO_SURFACE is available.
Parameters:textureView - The texture view.
-
public final void clearVideoSurface()
Deprecated.
Description copied from interface: Player
Clears any Surface, SurfaceHolder, SurfaceView or TextureView currently set on the player.
This method must only be called if Player.COMMAND_SET_VIDEO_SURFACE is available.
-
public final void clearVideoSurface(@Nullable[Surface](https://developer.android.com/reference/android/view/Surface.html "class or interface in android.view")surface)
Deprecated.
Description copied from interface: Player
Clears the Surface onto which video is being rendered if it matches the one passed. Else does nothing.
This method must only be called if Player.COMMAND_SET_VIDEO_SURFACE is available.
Parameters:surface - The surface to clear.
-
public final void clearVideoSurfaceHolder(@Nullable[SurfaceHolder](https://developer.android.com/reference/android/view/SurfaceHolder.html "class or interface in android.view")surfaceHolder)
Deprecated.
Description copied from interface: Player
Clears the SurfaceHolder that holds the Surface onto which video is being rendered if it matches the one passed. Else does nothing.
This method must only be called if Player.COMMAND_SET_VIDEO_SURFACE is available.
Parameters:surfaceHolder - The surface holder to clear.
-
public final void clearVideoSurfaceView(@Nullable[SurfaceView](https://developer.android.com/reference/android/view/SurfaceView.html "class or interface in android.view")surfaceView)
Deprecated.
Description copied from interface: Player
Clears the SurfaceView onto which video is being rendered if it matches the one passed. Else does nothing.
This method must only be called if Player.COMMAND_SET_VIDEO_SURFACE is available.
Parameters:surfaceView - The texture view to clear.
-
public final void clearVideoTextureView(@Nullable[TextureView](https://developer.android.com/reference/android/view/TextureView.html "class or interface in android.view")textureView)
Deprecated.
Description copied from interface: Player
Clears the TextureView onto which video is being rendered if it matches the one passed. Else does nothing.
This method must only be called if Player.COMMAND_SET_VIDEO_SURFACE is available.
Parameters:textureView - The texture view to clear.
-
public final[VideoSize](video/VideoSize.html "class in com.google.android.exoplayer2.video")getVideoSize()
Deprecated.
Description copied from interface: Player
Gets the size of the video.
The video's width and height are 0 if there is no supported video track or its size has not been determined yet.
See Also:Player.Listener.onVideoSizeChanged(VideoSize)
-
public final[Size](util/Size.html "class in com.google.android.exoplayer2.util")getSurfaceSize()
Deprecated.
Description copied from interface: Player
Gets the size of the surface on which the video is rendered.
See Also:Player.Listener.onSurfaceSizeChanged(int, int)
-
public final[CueGroup](text/CueGroup.html "class in com.google.android.exoplayer2.text")getCurrentCues()
Deprecated.
Description copied from interface: Player
Returns the current CueGroup.
This method must only be called if Player.COMMAND_GET_TEXT is available.
-
public final[DeviceInfo](DeviceInfo.html "class in com.google.android.exoplayer2")getDeviceInfo()
Deprecated.
Description copied from interface: Player
Gets the device information.
-
public final int getDeviceVolume()
Deprecated.
Description copied from interface: Player
Gets the current volume of the device.
For devices with local playback, the volume returned by this method varies according to the current stream type. The stream type is determined by AudioAttributes.usage which can be converted to stream type with Util.getStreamTypeForAudioUsage(int).
For devices with remote playback, the volume of the remote device is returned.
This method must only be called if Player.COMMAND_GET_DEVICE_VOLUME is available.
-
public final boolean isDeviceMuted()
Deprecated.
Description copied from interface: Player
Gets whether the device is muted or not.
This method must only be called if Player.COMMAND_GET_DEVICE_VOLUME is available.
-
[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public final void setDeviceVolume(int volume)
Deprecated.
Use setDeviceVolume(int, int) instead.
-
public final void setDeviceVolume(int volume,
@com.google.android.exoplayer2.C.VolumeFlags int flags)
Deprecated.
Description copied from interface: Player
Sets the volume of the device with volume flags.
This method must only be called if Player.COMMAND_SET_DEVICE_VOLUME_WITH_FLAGS is available.
Parameters:volume - The volume to set.flags - Either 0 or a bitwise combination of one or more C.VolumeFlags.
-
[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public final void increaseDeviceVolume()
Deprecated.
Use increaseDeviceVolume(int) instead.
-
public final void increaseDeviceVolume(@com.google.android.exoplayer2.C.VolumeFlags int flags)
Deprecated.
Description copied from interface: Player
Increases the volume of the device.
The Player.getDeviceVolume() device volume cannot be increased above DeviceInfo.maxVolume, if defined.
This method must only be called if Player.COMMAND_ADJUST_DEVICE_VOLUME_WITH_FLAGS is available.
Parameters:flags - Either 0 or a bitwise combination of one or more C.VolumeFlags.
-
[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public final void decreaseDeviceVolume()
Deprecated.
Use decreaseDeviceVolume(int) instead.
-
public final void decreaseDeviceVolume(@com.google.android.exoplayer2.C.VolumeFlags int flags)
Deprecated.
Description copied from interface: Player
Decreases the volume of the device.
The Player.getDeviceVolume() device volume cannot be decreased below DeviceInfo.minVolume.
This method must only be called if Player.COMMAND_ADJUST_DEVICE_VOLUME_WITH_FLAGS is available.
Parameters:flags - Either 0 or a bitwise combination of one or more C.VolumeFlags.
-
[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public final void setDeviceMuted(boolean muted)
Deprecated.
Use setDeviceMuted(boolean, int) instead.
-
public final void setDeviceMuted(boolean muted,
@com.google.android.exoplayer2.C.VolumeFlags int flags)
Deprecated.
Description copied from interface: Player
Sets the mute state of the device.
This method must only be called if Player.COMMAND_ADJUST_DEVICE_VOLUME_WITH_FLAGS is available.
Parameters:muted - Whether to set the device to be muted or notflags - Either 0 or a bitwise combination of one or more C.VolumeFlags.
-
protected final void invalidateState()
Deprecated.
Invalidates the current state.
Triggers a call to getState() and informs listeners if the state changed.
Note that this may not have an immediate effect while there are still player methods being handled asynchronously. The state will be invalidated automatically once these pending synchronous operations are finished and there is no need to call this method again.
-
@ForOverride
protected abstract[SimpleBasePlayer.State](SimpleBasePlayer.State.html "class in com.google.android.exoplayer2")getState()
Deprecated.
Returns the current SimpleBasePlayer.State of the player.
The SimpleBasePlayer.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(State) if required.
-
@ForOverride
protected[SimpleBasePlayer.State](SimpleBasePlayer.State.html "class in com.google.android.exoplayer2")getPlaceholderState([SimpleBasePlayer.State](SimpleBasePlayer.State.html "class in com.google.android.exoplayer2")suggestedPlaceholderState)
Deprecated.
Returns the placeholder state used while a player method is handled asynchronously.
The suggestedPlaceholderState already contains the most likely state update, for example setting SimpleBasePlayer.State.playWhenReady to true if player.setPlayWhenReady(true) is called, and an implementations only needs to override this method if it can determine a more accurate placeholder state.
Parameters:suggestedPlaceholderState - The suggested placeholder SimpleBasePlayer.State, including the most likely outcome of handling all pending asynchronous operations.Returns:The placeholder SimpleBasePlayer.State to use while asynchronous operations are pending.
-
@ForOverride
protected[SimpleBasePlayer.MediaItemData](SimpleBasePlayer.MediaItemData.html "class in com.google.android.exoplayer2")getPlaceholderMediaItemData([MediaItem](MediaItem.html "class in com.google.android.exoplayer2")mediaItem)
Deprecated.
Returns the placeholder SimpleBasePlayer.MediaItemData used for a new MediaItem added to the playlist.
An implementation only needs to override this method if it can determine a more accurate placeholder state than the default.
Parameters:mediaItem - The MediaItem added to the playlist.Returns:The SimpleBasePlayer.MediaItemData used as placeholder while adding the item to the playlist is in progress.
-
@ForOverride
protected[ListenableFuture](https://guava.dev/releases/31.1-android/api/docs/com/google/common/util/concurrent/ListenableFuture.html?is-external=true "class or interface in com.google.common.util.concurrent")<?> handleSetPlayWhenReady(boolean playWhenReady)
Deprecated.
Handles calls to Player.setPlayWhenReady(boolean), Player.play() and Player.pause().
Will only be called if Player.COMMAND_PLAY_PAUSE is available.
Parameters:playWhenReady - The requested SimpleBasePlayer.State.playWhenReadyReturns:A ListenableFuture indicating the completion of all immediate SimpleBasePlayer.State changes caused by this call.
-
@ForOverride
protected[ListenableFuture](https://guava.dev/releases/31.1-android/api/docs/com/google/common/util/concurrent/ListenableFuture.html?is-external=true "class or interface in com.google.common.util.concurrent")<?> handlePrepare()
Deprecated.
Handles calls to Player.prepare().
Will only be called if Player.COMMAND_PREPARE is available.
Returns:A ListenableFuture indicating the completion of all immediate SimpleBasePlayer.State changes caused by this call.
-
@ForOverride
protected[ListenableFuture](https://guava.dev/releases/31.1-android/api/docs/com/google/common/util/concurrent/ListenableFuture.html?is-external=true "class or interface in com.google.common.util.concurrent")<?> handleStop()
Deprecated.
Handles calls to Player.stop().
Will only be called if Player.COMMAND_STOP is available.
Returns:A ListenableFuture indicating the completion of all immediate SimpleBasePlayer.State changes caused by this call.
-
@ForOverride
protected[ListenableFuture](https://guava.dev/releases/31.1-android/api/docs/com/google/common/util/concurrent/ListenableFuture.html?is-external=true "class or interface in com.google.common.util.concurrent")<?> handleRelease()
Deprecated.
Handles calls to Player.release().
Will only be called if Player.COMMAND_RELEASE is available.
Returns:A ListenableFuture indicating the completion of all immediate SimpleBasePlayer.State changes caused by this call.
-
@ForOverride
protected[ListenableFuture](https://guava.dev/releases/31.1-android/api/docs/com/google/common/util/concurrent/ListenableFuture.html?is-external=true "class or interface in com.google.common.util.concurrent")<?> handleSetRepeatMode([@RepeatMode](Player.RepeatMode.html "annotation in com.google.android.exoplayer2")@com.google.android.exoplayer2.Player.RepeatMode int repeatMode)
Deprecated.
Handles calls to Player.setRepeatMode(@com.google.android.exoplayer2.Player.RepeatMode int).
Will only be called if Player.COMMAND_SET_REPEAT_MODE is available.
Parameters:repeatMode - The requested Player.RepeatMode.Returns:A ListenableFuture indicating the completion of all immediate SimpleBasePlayer.State changes caused by this call.
-
@ForOverride
protected[ListenableFuture](https://guava.dev/releases/31.1-android/api/docs/com/google/common/util/concurrent/ListenableFuture.html?is-external=true "class or interface in com.google.common.util.concurrent")<?> handleSetShuffleModeEnabled(boolean shuffleModeEnabled)
Deprecated.
Handles calls to Player.setShuffleModeEnabled(boolean).
Will only be called if Player.COMMAND_SET_SHUFFLE_MODE is available.
Parameters:shuffleModeEnabled - Whether shuffle mode was requested to be enabled.Returns:A ListenableFuture indicating the completion of all immediate SimpleBasePlayer.State changes caused by this call.
-
@ForOverride
protected[ListenableFuture](https://guava.dev/releases/31.1-android/api/docs/com/google/common/util/concurrent/ListenableFuture.html?is-external=true "class or interface in com.google.common.util.concurrent")<?> handleSetPlaybackParameters([PlaybackParameters](PlaybackParameters.html "class in com.google.android.exoplayer2")playbackParameters)
Deprecated.
Handles calls to Player.setPlaybackParameters(com.google.android.exoplayer2.PlaybackParameters) or Player.setPlaybackSpeed(float).
Will only be called if Player.COMMAND_SET_SPEED_AND_PITCH is available.
Parameters:playbackParameters - The requested PlaybackParameters.Returns:A ListenableFuture indicating the completion of all immediate SimpleBasePlayer.State changes caused by this call.
-
@ForOverride
protected[ListenableFuture](https://guava.dev/releases/31.1-android/api/docs/com/google/common/util/concurrent/ListenableFuture.html?is-external=true "class or interface in com.google.common.util.concurrent")<?> handleSetTrackSelectionParameters([TrackSelectionParameters](trackselection/TrackSelectionParameters.html "class in com.google.android.exoplayer2.trackselection")trackSelectionParameters)
Deprecated.
Handles calls to Player.setTrackSelectionParameters(com.google.android.exoplayer2.trackselection.TrackSelectionParameters).
Will only be called if Player.COMMAND_SET_TRACK_SELECTION_PARAMETERS is available.
Parameters:trackSelectionParameters - The requested TrackSelectionParameters.Returns:A ListenableFuture indicating the completion of all immediate SimpleBasePlayer.State changes caused by this call.
-
@ForOverride
protected[ListenableFuture](https://guava.dev/releases/31.1-android/api/docs/com/google/common/util/concurrent/ListenableFuture.html?is-external=true "class or interface in com.google.common.util.concurrent")<?> handleSetPlaylistMetadata([MediaMetadata](MediaMetadata.html "class in com.google.android.exoplayer2")playlistMetadata)
Deprecated.
Handles calls to Player.setPlaylistMetadata(com.google.android.exoplayer2.MediaMetadata).
Will only be called if Player.COMMAND_SET_PLAYLIST_METADATA is available.
Parameters:playlistMetadata - The requested playlist metadata.Returns:A ListenableFuture indicating the completion of all immediate SimpleBasePlayer.State changes caused by this call.
-
@ForOverride
protected[ListenableFuture](https://guava.dev/releases/31.1-android/api/docs/com/google/common/util/concurrent/ListenableFuture.html?is-external=true "class or interface in com.google.common.util.concurrent")<?> handleSetVolume(@FloatRange(from=0.0,to=1.0)
float volume)
Deprecated.
Handles calls to Player.setVolume(float).
Will only be called if Player.COMMAND_SET_VOLUME is available.
Parameters:volume - The requested audio volume, with 0 being silence and 1 being unity gain (signal unchanged).Returns:A ListenableFuture indicating the completion of all immediate SimpleBasePlayer.State changes caused by this call.
-
@ForOverride
protected[ListenableFuture](https://guava.dev/releases/31.1-android/api/docs/com/google/common/util/concurrent/ListenableFuture.html?is-external=true "class or interface in com.google.common.util.concurrent")<?> handleSetDeviceVolume(@IntRange(from=0L)
int deviceVolume,
int flags)
Deprecated.
Handles calls to Player.setDeviceVolume(int) and Player.setDeviceVolume(int, int).
Will only be called if Player.COMMAND_SET_DEVICE_VOLUME or Player.COMMAND_SET_DEVICE_VOLUME_WITH_FLAGS is available.
Parameters:deviceVolume - The requested device volume.flags - Either 0 or a bitwise combination of one or more C.VolumeFlags.Returns:A ListenableFuture indicating the completion of all immediate SimpleBasePlayer.State changes caused by this call.
-
@ForOverride
protected[ListenableFuture](https://guava.dev/releases/31.1-android/api/docs/com/google/common/util/concurrent/ListenableFuture.html?is-external=true "class or interface in com.google.common.util.concurrent")<?> handleIncreaseDeviceVolume(@com.google.android.exoplayer2.C.VolumeFlags int flags)
Deprecated.
Handles calls to Player.increaseDeviceVolume() and Player.increaseDeviceVolume(int).
Will only be called if Player.COMMAND_ADJUST_DEVICE_VOLUME or Player.COMMAND_ADJUST_DEVICE_VOLUME_WITH_FLAGS is available.
Parameters:flags - Either 0 or a bitwise combination of one or more C.VolumeFlags.Returns:A ListenableFuture indicating the completion of all immediate SimpleBasePlayer.State changes caused by this call.
-
@ForOverride
protected[ListenableFuture](https://guava.dev/releases/31.1-android/api/docs/com/google/common/util/concurrent/ListenableFuture.html?is-external=true "class or interface in com.google.common.util.concurrent")<?> handleDecreaseDeviceVolume(@com.google.android.exoplayer2.C.VolumeFlags int flags)
Deprecated.
Handles calls to Player.decreaseDeviceVolume() and Player.decreaseDeviceVolume(int).
Will only be called if Player.COMMAND_ADJUST_DEVICE_VOLUME or Player.COMMAND_ADJUST_DEVICE_VOLUME_WITH_FLAGS is available.
Parameters:flags - Either 0 or a bitwise combination of one or more C.VolumeFlags.Returns:A ListenableFuture indicating the completion of all immediate SimpleBasePlayer.State changes caused by this call.
-
@ForOverride
protected[ListenableFuture](https://guava.dev/releases/31.1-android/api/docs/com/google/common/util/concurrent/ListenableFuture.html?is-external=true "class or interface in com.google.common.util.concurrent")<?> handleSetDeviceMuted(boolean muted,
@com.google.android.exoplayer2.C.VolumeFlags int flags)
Deprecated.
Handles calls to Player.setDeviceMuted(boolean) and Player.setDeviceMuted(boolean, int).
Will only be called if Player.COMMAND_ADJUST_DEVICE_VOLUME or Player.COMMAND_ADJUST_DEVICE_VOLUME is available.
Parameters:muted - Whether the device was requested to be muted.flags - Either 0 or a bitwise combination of one or more C.VolumeFlags.Returns:A ListenableFuture indicating the completion of all immediate SimpleBasePlayer.State changes caused by this call.
-
@ForOverride
protected[ListenableFuture](https://guava.dev/releases/31.1-android/api/docs/com/google/common/util/concurrent/ListenableFuture.html?is-external=true "class or interface in com.google.common.util.concurrent")<?> handleSetVideoOutput([Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")videoOutput)
Deprecated.
Handles calls to set the video output.
Will only be called if Player.COMMAND_SET_VIDEO_SURFACE is available.
Parameters:videoOutput - The requested video output. This is either a Surface, SurfaceHolder, TextureView or SurfaceView.Returns:A ListenableFuture indicating the completion of all immediate SimpleBasePlayer.State changes caused by this call.
-
@ForOverride
protected[ListenableFuture](https://guava.dev/releases/31.1-android/api/docs/com/google/common/util/concurrent/ListenableFuture.html?is-external=true "class or interface in com.google.common.util.concurrent")<?> handleClearVideoOutput(@Nullable[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")videoOutput)
Deprecated.
Handles calls to clear the video output.
Will only be called if Player.COMMAND_SET_VIDEO_SURFACE is available.
Parameters:videoOutput - 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:A ListenableFuture indicating the completion of all immediate SimpleBasePlayer.State changes caused by this call.
-
@ForOverride
protected[ListenableFuture](https://guava.dev/releases/31.1-android/api/docs/com/google/common/util/concurrent/ListenableFuture.html?is-external=true "class or interface in com.google.common.util.concurrent")<?> handleSetMediaItems([List](https://developer.android.com/reference/java/util/List.html "class or interface in java.util")<[MediaItem](MediaItem.html "class in com.google.android.exoplayer2")> mediaItems,
int startIndex,
long startPositionMs)
Deprecated.
Handles calls to Player.setMediaItem(com.google.android.exoplayer2.MediaItem) and Player.setMediaItems(java.util.List<com.google.android.exoplayer2.MediaItem>).
Will only be called if Player.COMMAND_SET_MEDIA_ITEM or Player.COMMAND_CHANGE_MEDIA_ITEMS is available. If only Player.COMMAND_SET_MEDIA_ITEM is available, the list of media items will always contain exactly one item.
Parameters:mediaItems - The media items to add.startIndex - The index at which to start playback from, or C.INDEX_UNSET to start at the default item.startPositionMs - The position in milliseconds to start playback from, or C.TIME_UNSET to start at the default position in the media item.Returns:A ListenableFuture indicating the completion of all immediate SimpleBasePlayer.State changes caused by this call.
-
@ForOverride
protected[ListenableFuture](https://guava.dev/releases/31.1-android/api/docs/com/google/common/util/concurrent/ListenableFuture.html?is-external=true "class or interface in com.google.common.util.concurrent")<?> handleAddMediaItems(int index,[List](https://developer.android.com/reference/java/util/List.html "class or interface in java.util")<[MediaItem](MediaItem.html "class in com.google.android.exoplayer2")> mediaItems)
Deprecated.
Handles calls to Player.addMediaItem(com.google.android.exoplayer2.MediaItem) and Player.addMediaItems(java.util.List<com.google.android.exoplayer2.MediaItem>).
Will only be called if Player.COMMAND_CHANGE_MEDIA_ITEMS is available.
Parameters:index - The index at which to add the items. The index is in the range 0 <= index <= BasePlayer.getMediaItemCount().mediaItems - The media items to add.Returns:A ListenableFuture indicating the completion of all immediate SimpleBasePlayer.State changes caused by this call.
-
@ForOverride
protected[ListenableFuture](https://guava.dev/releases/31.1-android/api/docs/com/google/common/util/concurrent/ListenableFuture.html?is-external=true "class or interface in com.google.common.util.concurrent")<?> handleMoveMediaItems(int fromIndex,
int toIndex,
int newIndex)
Deprecated.
Handles calls to Player.moveMediaItem(int, int) and Player.moveMediaItems(int, int, int).
Will only be called if Player.COMMAND_CHANGE_MEDIA_ITEMS is available.
Parameters:fromIndex - The start index of the items to move. The index is in the range 0 <= fromIndex < BasePlayer.getMediaItemCount().toIndex - The index of the first item not to be included in the move (exclusive). The index is in the range fromIndex < toIndex <= BasePlayer.getMediaItemCount().newIndex - The new index of the first moved item. The index is in the range 0 <= newIndex < - (toIndex - fromIndex).Returns:A ListenableFuture indicating the completion of all immediate SimpleBasePlayer.State changes caused by this call.
-
@ForOverride
protected[ListenableFuture](https://guava.dev/releases/31.1-android/api/docs/com/google/common/util/concurrent/ListenableFuture.html?is-external=true "class or interface in com.google.common.util.concurrent")<?> handleReplaceMediaItems(int fromIndex,
int toIndex,[List](https://developer.android.com/reference/java/util/List.html "class or interface in java.util")<[MediaItem](MediaItem.html "class in com.google.android.exoplayer2")> mediaItems)
Deprecated.
Handles calls to Player.replaceMediaItem(int, com.google.android.exoplayer2.MediaItem) and Player.replaceMediaItems(int, int, java.util.List<com.google.android.exoplayer2.MediaItem>).
Will only be called if Player.COMMAND_CHANGE_MEDIA_ITEMS is available.
Parameters:fromIndex - The start index of the items to replace. The index is in the range 0 <= fromIndex < BasePlayer.getMediaItemCount().toIndex - The index of the first item not to be replaced (exclusive). The index is in the range fromIndex < toIndex <= BasePlayer.getMediaItemCount().mediaItems - The media items to replace the specified range with.Returns:A ListenableFuture indicating the completion of all immediate SimpleBasePlayer.State changes caused by this call.
-
@ForOverride
protected[ListenableFuture](https://guava.dev/releases/31.1-android/api/docs/com/google/common/util/concurrent/ListenableFuture.html?is-external=true "class or interface in com.google.common.util.concurrent")<?> handleRemoveMediaItems(int fromIndex,
int toIndex)
Deprecated.
Handles calls to Player.removeMediaItem(int) and Player.removeMediaItems(int, int).
Will only be called if Player.COMMAND_CHANGE_MEDIA_ITEMS is available.
Parameters:fromIndex - The index at which to start removing media items. The index is in the range 0 <= fromIndex < BasePlayer.getMediaItemCount().toIndex - The index of the first item to be kept (exclusive). The index is in the range fromIndex < toIndex <= BasePlayer.getMediaItemCount().Returns:A ListenableFuture indicating the completion of all immediate SimpleBasePlayer.State changes caused by this call.
-
@ForOverride
protected[ListenableFuture](https://guava.dev/releases/31.1-android/api/docs/com/google/common/util/concurrent/ListenableFuture.html?is-external=true "class or interface in com.google.common.util.concurrent")<?> handleSeek(int mediaItemIndex,
long positionMs,[@Command](Player.Command.html "annotation in com.google.android.exoplayer2")@com.google.android.exoplayer2.Player.Command int seekCommand)
Deprecated.
Handles calls to Player.seekTo(long) and other seek operations (for example, Player.seekToNext()).
Will only be called if the appropriate Player.Command, for example Player.COMMAND_SEEK_TO_MEDIA_ITEM or Player.COMMAND_SEEK_TO_NEXT, is available.
Parameters:mediaItemIndex - The media item index to seek to. The index is in the range 0 <= mediaItemIndex < mediaItems.size().positionMs - The position in milliseconds to start playback from, or C.TIME_UNSET to start at the default position in the media item.seekCommand - The Player.Command used to trigger the seek.Returns:A ListenableFuture indicating the completion of all immediate SimpleBasePlayer.State changes caused by this call.