docs/doc/reference/com/google/android/exoplayer2/SimpleExoPlayer.html
Package com.google.android.exoplayer2
All Implemented Interfaces:ExoPlayer, ExoPlayer.AudioComponent, ExoPlayer.DeviceComponent, ExoPlayer.TextComponent, ExoPlayer.VideoComponent, Player
[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public classSimpleExoPlayerextends[BasePlayer](BasePlayer.html "class in com.google.android.exoplayer2")implements[ExoPlayer](ExoPlayer.html "interface in com.google.android.exoplayer2"),[ExoPlayer.AudioComponent](ExoPlayer.AudioComponent.html "interface in com.google.android.exoplayer2"),[ExoPlayer.VideoComponent](ExoPlayer.VideoComponent.html "interface in com.google.android.exoplayer2"),[ExoPlayer.TextComponent](ExoPlayer.TextComponent.html "interface in com.google.android.exoplayer2"),[ExoPlayer.DeviceComponent](ExoPlayer.DeviceComponent.html "interface in com.google.android.exoplayer2")
Deprecated.
Use ExoPlayer instead.
Nested Classes | Modifier and Type | Class | Description |
| --- | --- | --- |
| static class | SimpleExoPlayer.Builder |
Deprecated.
Use ExoPlayer.Builder instead.
|
-
ExoPlayer.AudioComponent, ExoPlayer.AudioOffloadListener, ExoPlayer.DeviceComponent, ExoPlayer.TextComponent, ExoPlayer.VideoComponent
-
Player.Command, Player.Commands, Player.DiscontinuityReason, Player.Event, Player.Events, Player.Listener, Player.MediaItemTransitionReason, Player.PlaybackSuppressionReason, Player.PlayWhenReadyChangeReason, Player.PositionInfo, Player.RepeatMode, Player.State, Player.TimelineChangeReason
-
window
-
DEFAULT_DETACH_SURFACE_TIMEOUT_MS, DEFAULT_RELEASE_TIMEOUT_MS
-
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 | SimpleExoPlayer(Context context, RenderersFactory renderersFactory, TrackSelector trackSelector, MediaSource.Factory mediaSourceFactory, LoadControl loadControl, BandwidthMeter bandwidthMeter, AnalyticsCollector analyticsCollector, boolean useLazyPreparation, Clock clock, Looper applicationLooper) |
Deprecated.
Use the ExoPlayer.Builder.
|
| protected | SimpleExoPlayer(SimpleExoPlayer.Builder builder) |
Deprecated.
|
All Methods Instance Methods Concrete Methods Deprecated Methods | Modifier and Type | Method | Description |
| --- | --- | --- |
| void | addAnalyticsListener(AnalyticsListener listener) |
Deprecated.
Adds an AnalyticsListener to receive analytics events.
|
| void | addAudioOffloadListener(ExoPlayer.AudioOffloadListener listener) |
Deprecated.
Adds a listener to receive audio offload events.
|
| 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 | addMediaSource(int index, MediaSource mediaSource) |
Deprecated.
Adds a media source at the given index of the playlist.
|
| void | addMediaSource(MediaSource mediaSource) |
Deprecated.
Adds a media source to the end of the playlist.
|
| void | addMediaSources(int index, List<MediaSource> mediaSources) |
Deprecated.
Adds a list of media sources at the given index of the playlist.
|
| void | addMediaSources(List<MediaSource> mediaSources) |
Deprecated.
Adds a list of media sources to the end of the playlist.
|
| void | clearAuxEffectInfo() |
Deprecated.
Detaches any previously attached auxiliary audio effect from the underlying audio track.
|
| void | clearCameraMotionListener(CameraMotionListener listener) |
Deprecated.
Clears the listener which receives camera motion events if it matches the one passed.
|
| void | clearVideoFrameMetadataListener(VideoFrameMetadataListener listener) |
Deprecated.
Clears the listener which receives video frame metadata events if it matches the one passed.
|
| 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.
|
| PlayerMessage | createMessage(PlayerMessage.Target target) |
Deprecated.
Creates a message that can be sent to a PlayerMessage.Target.
|
| void | decreaseDeviceVolume() |
Deprecated.
Use decreaseDeviceVolume(int) instead.
|
| void | decreaseDeviceVolume(@com.google.android.exoplayer2.C.VolumeFlags int flags) |
Deprecated.
Decreases the volume of the device.
|
| boolean | experimentalIsSleepingForOffload() |
Deprecated.
Returns whether the player has paused its main loop to save power in offload scheduling mode.
|
| void | experimentalSetOffloadSchedulingEnabled(boolean offloadSchedulingEnabled) |
Deprecated.
Sets whether audio offload scheduling is enabled.
|
| AnalyticsCollector | getAnalyticsCollector() |
Deprecated.
Returns the AnalyticsCollector used for collecting analytics events.
|
| 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.
|
| ExoPlayer.AudioComponent | getAudioComponent() |
Deprecated.
Use ExoPlayer, as the ExoPlayer.AudioComponent methods are defined by that interface.
|
| DecoderCounters | getAudioDecoderCounters() |
Deprecated.
Returns DecoderCounters for audio, or null if no audio is being played.
|
| Format | getAudioFormat() |
Deprecated.
Returns the audio format currently being played, or null if no audio is being played.
|
| int | getAudioSessionId() |
Deprecated.
Returns the audio session identifier, or C.AUDIO_SESSION_ID_UNSET if not set.
|
| 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.
|
| Clock | getClock() |
Deprecated.
Returns the Clock used for playback.
|
| 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.
|
| TrackGroupArray | getCurrentTrackGroups() |
Deprecated.
Use getCurrentTracks().
|
| Tracks | getCurrentTracks() |
Deprecated.
Returns the current tracks.
|
| TrackSelectionArray | getCurrentTrackSelections() |
Deprecated.
Use getCurrentTracks().
|
| ExoPlayer.DeviceComponent | getDeviceComponent() |
Deprecated.
Use Player, as the ExoPlayer.DeviceComponent methods are defined by that interface.
|
| 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.
|
| boolean | getPauseAtEndOfMediaItems() |
Deprecated.
Returns whether the player pauses playback at the end of each media item.
|
| Looper | getPlaybackLooper() |
Deprecated.
Returns the Looper associated with the playback thread.
|
| 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.
|
| @com.google.android.exoplayer2.Player.PlaybackSuppressionReason 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.
|
| ExoPlaybackException | getPlayerError() |
Deprecated.
Equivalent to Player.getPlayerError(), except the exception is guaranteed to be an ExoPlaybackException.
|
| 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.
|
| Renderer | getRenderer(int index) |
Deprecated.
Returns the renderer at the given index.
|
| int | getRendererCount() |
Deprecated.
Returns the number of renderers.
|
| @com.google.android.exoplayer2.C.TrackType int | getRendererType(int index) |
Deprecated.
Returns the track type that the renderer at a given index handles.
|
| @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.
|
| SeekParameters | getSeekParameters() |
Deprecated.
Returns the currently active SeekParameters of the player.
|
| boolean | getShuffleModeEnabled() |
Deprecated.
Returns whether shuffling of media items is enabled.
|
| boolean | getSkipSilenceEnabled() |
Deprecated.
Returns whether skipping silences in the audio stream is enabled.
|
| Size | getSurfaceSize() |
Deprecated.
Gets the size of the surface on which the video is rendered.
|
| ExoPlayer.TextComponent | getTextComponent() |
Deprecated.
Use Player, as the ExoPlayer.TextComponent methods are defined by that interface.
|
| 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.
|
| TrackSelector | getTrackSelector() |
Deprecated.
Returns the track selector that this player uses, or null if track selection is not supported.
|
| @com.google.android.exoplayer2.C.VideoChangeFrameRateStrategy int | getVideoChangeFrameRateStrategy() |
Deprecated.
Returns the C.VideoChangeFrameRateStrategy.
|
| ExoPlayer.VideoComponent | getVideoComponent() |
Deprecated.
Use ExoPlayer, as the ExoPlayer.VideoComponent methods are defined by that interface.
|
| DecoderCounters | getVideoDecoderCounters() |
Deprecated.
Returns DecoderCounters for video, or null if no video is being played.
|
| Format | getVideoFormat() |
Deprecated.
Returns the video format currently being played, or null if no video is being played.
|
| @com.google.android.exoplayer2.C.VideoScalingMode int | getVideoScalingMode() |
Deprecated.
Returns the C.VideoScalingMode.
|
| 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).
|
| void | increaseDeviceVolume() |
Deprecated.
Use increaseDeviceVolume(int) instead.
|
| void | increaseDeviceVolume(@com.google.android.exoplayer2.C.VolumeFlags int flags) |
Deprecated.
Increases the volume of the device.
|
| 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.
|
| boolean | isTunnelingEnabled() |
Deprecated.
Returns whether tunneling is enabled for the currently selected tracks.
|
| 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 | prepare(MediaSource mediaSource) |
Deprecated.
Use setMediaSource(MediaSource) and Player.prepare() instead.
|
| void | prepare(MediaSource mediaSource, boolean resetPosition, boolean resetState) |
Deprecated.
Use setMediaSource(MediaSource, boolean) and Player.prepare() instead.
|
| void | release() |
Deprecated.
Releases the player.
|
| void | removeAnalyticsListener(AnalyticsListener listener) |
Deprecated.
Removes an AnalyticsListener.
|
| void | removeAudioOffloadListener(ExoPlayer.AudioOffloadListener listener) |
Deprecated.
Removes a listener of audio offload events.
|
| 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 | setAudioAttributes(AudioAttributes audioAttributes, boolean handleAudioFocus) |
Deprecated.
Sets the attributes for audio playback, used by the underlying audio track.
|
| void | setAudioSessionId(int audioSessionId) |
Deprecated.
Sets the ID of the audio session to attach to the underlying AudioTrack.
|
| void | setAuxEffectInfo(AuxEffectInfo auxEffectInfo) |
Deprecated.
Sets information on an auxiliary audio effect to attach to the underlying audio track.
|
| void | setCameraMotionListener(CameraMotionListener listener) |
Deprecated.
Sets a listener of camera motion events.
|
| 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 | setForegroundMode(boolean foregroundMode) |
Deprecated.
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) |
Deprecated.
Sets whether the player should pause automatically when audio is rerouted from a headset to device speakers.
|
| 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 | setMediaSource(MediaSource mediaSource) |
Deprecated.
Clears the playlist, adds the specified MediaSource and resets the position to the default position.
|
| void | setMediaSource(MediaSource mediaSource, boolean resetPosition) |
Deprecated.
Clears the playlist and adds the specified MediaSource.
|
| void | setMediaSource(MediaSource mediaSource, long startPositionMs) |
Deprecated.
Clears the playlist and adds the specified MediaSource.
|
| void | setMediaSources(List<MediaSource> mediaSources) |
Deprecated.
Clears the playlist, adds the specified MediaSources and resets the position to the default position.
|
| void | setMediaSources(List<MediaSource> mediaSources, boolean resetPosition) |
Deprecated.
Clears the playlist and adds the specified MediaSources.
|
| void | setMediaSources(List<MediaSource> mediaSources, int startMediaItemIndex, long startPositionMs) |
Deprecated.
Clears the playlist and adds the specified MediaSources.
|
| void | setPauseAtEndOfMediaItems(boolean pauseAtEndOfMediaItems) |
Deprecated.
Sets whether to pause playback at the end of each media item.
|
| 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 | setPreferredAudioDevice(AudioDeviceInfo audioDeviceInfo) |
Deprecated.
Sets the preferred audio device.
|
| void | setPriorityTaskManager(PriorityTaskManager priorityTaskManager) |
Deprecated.
Sets a PriorityTaskManager, or null to clear a previously set priority task manager.
|
| void | setRepeatMode(@com.google.android.exoplayer2.Player.RepeatMode int repeatMode) |
Deprecated.
Sets the Player.RepeatMode to be used for playback.
|
| void | setSeekParameters(SeekParameters seekParameters) |
Deprecated.
Sets the parameters that control how seek operations are performed.
|
| void | setShuffleModeEnabled(boolean shuffleModeEnabled) |
Deprecated.
Sets whether shuffling of media items is enabled.
|
| void | setShuffleOrder(ShuffleOrder shuffleOrder) |
Deprecated.
Sets the shuffle order.
|
| void | setSkipSilenceEnabled(boolean skipSilenceEnabled) |
Deprecated.
Sets whether skipping silences in the audio stream is enabled.
|
| void | setTrackSelectionParameters(TrackSelectionParameters parameters) |
Deprecated.
Sets the parameters constraining the track selection.
|
| void | setVideoChangeFrameRateStrategy(@com.google.android.exoplayer2.C.VideoChangeFrameRateStrategy int videoChangeFrameRateStrategy) |
Deprecated.
Sets a C.VideoChangeFrameRateStrategy that will be used by the player when provided with a video output Surface.
|
| void | setVideoEffects(List<Effect> videoEffects) |
Deprecated.
Sets a List of video effects that will be applied to each video frame.
|
| void | setVideoFrameMetadataListener(VideoFrameMetadataListener listener) |
Deprecated.
Sets a listener to receive video frame metadata events.
|
| void | setVideoScalingMode(@com.google.android.exoplayer2.C.VideoScalingMode int videoScalingMode) |
Deprecated.
Sets the C.VideoScalingMode.
|
| 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 | setWakeMode(@com.google.android.exoplayer2.C.WakeMode int wakeMode) |
Deprecated.
Sets how the player should keep the device awake for playback when the screen is off.
|
| 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
-
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
-
[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")protected SimpleExoPlayer([Context](https://developer.android.com/reference/android/content/Context.html "class or interface in android.content")context,[RenderersFactory](RenderersFactory.html "interface in com.google.android.exoplayer2")renderersFactory,[TrackSelector](trackselection/TrackSelector.html "class in com.google.android.exoplayer2.trackselection")trackSelector,[MediaSource.Factory](source/MediaSource.Factory.html "interface in com.google.android.exoplayer2.source")mediaSourceFactory,[LoadControl](LoadControl.html "interface in com.google.android.exoplayer2")loadControl,[BandwidthMeter](upstream/BandwidthMeter.html "interface in com.google.android.exoplayer2.upstream")bandwidthMeter,[AnalyticsCollector](analytics/AnalyticsCollector.html "interface in com.google.android.exoplayer2.analytics")analyticsCollector,
boolean useLazyPreparation,[Clock](util/Clock.html "interface in com.google.android.exoplayer2.util")clock,[Looper](https://developer.android.com/reference/android/os/Looper.html "class or interface in android.os")applicationLooper)
Deprecated.
Use the ExoPlayer.Builder.
-
protected SimpleExoPlayer([SimpleExoPlayer.Builder](SimpleExoPlayer.Builder.html "class in com.google.android.exoplayer2")builder)
Deprecated.
Parameters:builder - The SimpleExoPlayer.Builder to obtain all construction parameters.
-
public void experimentalSetOffloadSchedulingEnabled(boolean offloadSchedulingEnabled)
Deprecated.
Description copied from interface: ExoPlayer
Sets whether audio offload scheduling is enabled. If enabled, ExoPlayer's main loop will run as rarely as possible when playing an audio stream using audio offload.
Only use this scheduling mode if the player is not displaying anything to the user. For example when the application is in the background, or the screen is off. The player state (including position) is rarely updated (roughly between every 10 seconds and 1 minute).
While offload scheduling is enabled, player events may be delivered severely delayed and apps should not interact with the player. When returning to the foreground, disable offload scheduling and wait for ExoPlayer.AudioOffloadListener.onExperimentalOffloadSchedulingEnabledChanged(boolean) to be called with offloadSchedulingEnabled = false before interacting with the player.
This mode should save significant power when the phone is playing offload audio with the screen off.
This mode only has an effect when playing an audio track in offload mode, which requires all the following:
- Audio offload rendering is enabled in [`DefaultRenderersFactory.setEnableAudioOffload(boolean)`](DefaultRenderersFactory.html#setEnableAudioOffload(boolean)) or the equivalent option passed to [`DefaultAudioSink.Builder.setOffloadMode(@com.google.android.exoplayer2.audio.DefaultAudioSink.OffloadMode int)`](audio/DefaultAudioSink.Builder.html#setOffloadMode(@com.google.android.exoplayer2.audio.DefaultAudioSink.OffloadModeint)).
- An audio track is playing in a format that the device supports offloading (for example, MP3 or AAC).
- The [`AudioSink`](audio/AudioSink.html "interface in com.google.android.exoplayer2.audio") is playing with an offload [`AudioTrack`](https://developer.android.com/reference/android/media/AudioTrack.html "class or interface in android.media").
The state where ExoPlayer main loop has been paused to save power during offload playback can be queried with ExoPlayer.experimentalIsSleepingForOffload().
This method is experimental, and will be renamed or removed in a future release.
Specified by:experimentalSetOffloadSchedulingEnabled in interface ExoPlayerParameters:offloadSchedulingEnabled - Whether to enable offload scheduling.
-
public boolean experimentalIsSleepingForOffload()
Deprecated.
Description copied from interface: ExoPlayer
Returns whether the player has paused its main loop to save power in offload scheduling mode.
Specified by:experimentalIsSleepingForOffload in interface ExoPlayerSee Also:ExoPlayer.experimentalSetOffloadSchedulingEnabled(boolean), ExoPlayer.AudioOffloadListener.onExperimentalSleepingForOffloadChanged(boolean)
-
[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")@Nullable
public[ExoPlayer.AudioComponent](ExoPlayer.AudioComponent.html "interface in com.google.android.exoplayer2")getAudioComponent()
Deprecated.
Use ExoPlayer, as the ExoPlayer.AudioComponent methods are defined by that interface.
Specified by:getAudioComponent in interface ExoPlayer
-
[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")@Nullable
public[ExoPlayer.VideoComponent](ExoPlayer.VideoComponent.html "interface in com.google.android.exoplayer2")getVideoComponent()
Deprecated.
Use ExoPlayer, as the ExoPlayer.VideoComponent methods are defined by that interface.
Specified by:getVideoComponent in interface ExoPlayer
-
[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")@Nullable
public[ExoPlayer.TextComponent](ExoPlayer.TextComponent.html "interface in com.google.android.exoplayer2")getTextComponent()
Deprecated.
Use Player, as the ExoPlayer.TextComponent methods are defined by that interface.
Specified by:getTextComponent in interface ExoPlayer
-
[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")@Nullable
public[ExoPlayer.DeviceComponent](ExoPlayer.DeviceComponent.html "interface in com.google.android.exoplayer2")getDeviceComponent()
Deprecated.
Use Player, as the ExoPlayer.DeviceComponent methods are defined by that interface.
Specified by:getDeviceComponent in interface ExoPlayer
-
public void setVideoScalingMode([@VideoScalingMode](C.VideoScalingMode.html "annotation in com.google.android.exoplayer2")@com.google.android.exoplayer2.C.VideoScalingMode int videoScalingMode)
Deprecated.
Description copied from interface: ExoPlayer
Sets the C.VideoScalingMode.
The scaling mode only applies if a MediaCodec-based video Renderer is enabled and if the output surface is owned by a SurfaceView.
Specified by:setVideoScalingMode in interface ExoPlayerSpecified by:setVideoScalingMode in interface ExoPlayer.VideoComponentParameters:videoScalingMode - The C.VideoScalingMode.
-
[@VideoScalingMode](C.VideoScalingMode.html "annotation in com.google.android.exoplayer2")public @com.google.android.exoplayer2.C.VideoScalingMode int getVideoScalingMode()
Deprecated.
Description copied from interface: ExoPlayer
Returns the C.VideoScalingMode.
Specified by:getVideoScalingMode in interface ExoPlayerSpecified by:getVideoScalingMode in interface ExoPlayer.VideoComponent
-
public void setVideoChangeFrameRateStrategy([@VideoChangeFrameRateStrategy](C.VideoChangeFrameRateStrategy.html "annotation in com.google.android.exoplayer2")@com.google.android.exoplayer2.C.VideoChangeFrameRateStrategy int videoChangeFrameRateStrategy)
Deprecated.
Description copied from interface: ExoPlayer
Sets a C.VideoChangeFrameRateStrategy that will be used by the player when provided with a video output Surface.
The strategy only applies if a MediaCodec-based video Renderer is enabled. Applications wishing to use Surface.CHANGE_FRAME_RATE_ALWAYS should set the mode to C.VIDEO_CHANGE_FRAME_RATE_STRATEGY_OFF to disable calls to Surface.setFrameRate(float, int, int) from ExoPlayer, and should then call Surface.setFrameRate(float, int, int) directly from application code.
Specified by:setVideoChangeFrameRateStrategy in interface ExoPlayerSpecified by:setVideoChangeFrameRateStrategy in interface ExoPlayer.VideoComponentParameters:videoChangeFrameRateStrategy - A C.VideoChangeFrameRateStrategy.
-
[@VideoChangeFrameRateStrategy](C.VideoChangeFrameRateStrategy.html "annotation in com.google.android.exoplayer2")public @com.google.android.exoplayer2.C.VideoChangeFrameRateStrategy int getVideoChangeFrameRateStrategy()
Deprecated.
Description copied from interface: ExoPlayer
Returns the C.VideoChangeFrameRateStrategy.
Specified by:getVideoChangeFrameRateStrategy in interface ExoPlayerSpecified by:getVideoChangeFrameRateStrategy in interface ExoPlayer.VideoComponent
-
public[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.
Specified by:getVideoSize in interface ExoPlayer.VideoComponentSpecified by:getVideoSize in interface PlayerSee Also:Player.Listener.onVideoSizeChanged(VideoSize)
-
public[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.
Specified by:getSurfaceSize in interface PlayerSee Also:Player.Listener.onSurfaceSizeChanged(int, int)
-
public 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.
Specified by:clearVideoSurface in interface ExoPlayer.VideoComponentSpecified by:clearVideoSurface in interface Player
-
public 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.
Specified by:clearVideoSurface in interface ExoPlayer.VideoComponentSpecified by:clearVideoSurface in interface PlayerParameters:surface - The surface to clear.
-
public 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.
Specified by:setVideoSurface in interface ExoPlayer.VideoComponentSpecified by:setVideoSurface in interface PlayerParameters:surface - The Surface.
-
public 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.
Specified by:setVideoSurfaceHolder in interface ExoPlayer.VideoComponentSpecified by:setVideoSurfaceHolder in interface PlayerParameters:surfaceHolder - The surface holder.
-
public 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.
Specified by:clearVideoSurfaceHolder in interface ExoPlayer.VideoComponentSpecified by:clearVideoSurfaceHolder in interface PlayerParameters:surfaceHolder - The surface holder to clear.
-
public 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.
Specified by:setVideoSurfaceView in interface ExoPlayer.VideoComponentSpecified by:setVideoSurfaceView in interface PlayerParameters:surfaceView - The surface view.
-
public 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.
Specified by:clearVideoSurfaceView in interface ExoPlayer.VideoComponentSpecified by:clearVideoSurfaceView in interface PlayerParameters:surfaceView - The texture view to clear.
-
public 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.
Specified by:setVideoTextureView in interface ExoPlayer.VideoComponentSpecified by:setVideoTextureView in interface PlayerParameters:textureView - The texture view.
-
public 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.
Specified by:clearVideoTextureView in interface ExoPlayer.VideoComponentSpecified by:clearVideoTextureView in interface PlayerParameters:textureView - The texture view to clear.
-
public void addAudioOffloadListener([ExoPlayer.AudioOffloadListener](ExoPlayer.AudioOffloadListener.html "interface in com.google.android.exoplayer2")listener)
Deprecated.
Description copied from interface: ExoPlayer
Adds a listener to receive audio offload events.
This method can be called from any thread.
Specified by:addAudioOffloadListener in interface ExoPlayerParameters:listener - The listener to register.
-
public void removeAudioOffloadListener([ExoPlayer.AudioOffloadListener](ExoPlayer.AudioOffloadListener.html "interface in com.google.android.exoplayer2")listener)
Deprecated.
Description copied from interface: ExoPlayer
Removes a listener of audio offload events.
Specified by:removeAudioOffloadListener in interface ExoPlayerParameters:listener - The listener to unregister.
-
public void setAudioAttributes([AudioAttributes](audio/AudioAttributes.html "class in com.google.android.exoplayer2.audio")audioAttributes,
boolean handleAudioFocus)
Deprecated.
Description copied from interface: ExoPlayer
Sets the attributes for audio playback, used by the underlying audio track. If not set, the default audio attributes will be used. They are suitable for general media playback.
Setting the audio attributes during playback may introduce a short gap in audio output as the audio track is recreated. A new audio session id will also be generated.
If tunneling is enabled by the track selector, the specified audio attributes will be ignored, but they will take effect if audio is later played without tunneling.
If the device is running a build before platform API version 21, audio attributes cannot be set directly on the underlying audio track. In this case, the usage will be mapped onto an equivalent stream type using Util.getStreamTypeForAudioUsage(int).
If audio focus should be handled, the AudioAttributes.usage must be C.USAGE_MEDIA or C.USAGE_GAME. Other usages will throw an IllegalArgumentException.
Specified by:setAudioAttributes in interface ExoPlayerSpecified by:setAudioAttributes in interface ExoPlayer.AudioComponentParameters:audioAttributes - The attributes to use for audio playback.handleAudioFocus - True if the player should handle audio focus, false otherwise.
-
public[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.
Specified by:getAudioAttributes in interface ExoPlayer.AudioComponentSpecified by:getAudioAttributes in interface Player
-
public void setAudioSessionId(int audioSessionId)
Deprecated.
Description copied from interface: ExoPlayer
Sets the ID of the audio session to attach to the underlying AudioTrack.
The audio session ID can be generated using Util.generateAudioSessionIdV21(Context) for API 21+.
Specified by:setAudioSessionId in interface ExoPlayerSpecified by:setAudioSessionId in interface ExoPlayer.AudioComponentParameters:audioSessionId - The audio session ID, or C.AUDIO_SESSION_ID_UNSET if it should be generated by the framework.
-
public int getAudioSessionId()
Deprecated.
Description copied from interface: ExoPlayer
Returns the audio session identifier, or C.AUDIO_SESSION_ID_UNSET if not set.
Specified by:getAudioSessionId in interface ExoPlayerSpecified by:getAudioSessionId in interface ExoPlayer.AudioComponent
-
public void setAuxEffectInfo([AuxEffectInfo](audio/AuxEffectInfo.html "class in com.google.android.exoplayer2.audio")auxEffectInfo)
Deprecated.
Description copied from interface: ExoPlayer
Sets information on an auxiliary audio effect to attach to the underlying audio track.
Specified by:setAuxEffectInfo in interface ExoPlayerSpecified by:setAuxEffectInfo in interface ExoPlayer.AudioComponent
-
public void clearAuxEffectInfo()
Deprecated.
Description copied from interface: ExoPlayer
Detaches any previously attached auxiliary audio effect from the underlying audio track.
Specified by:clearAuxEffectInfo in interface ExoPlayerSpecified by:clearAuxEffectInfo in interface ExoPlayer.AudioComponent
-
@RequiresApi(23)
public void setPreferredAudioDevice(@Nullable[AudioDeviceInfo](https://developer.android.com/reference/android/media/AudioDeviceInfo.html "class or interface in android.media")audioDeviceInfo)
Deprecated.
Description copied from interface: ExoPlayer
Sets the preferred audio device.
Specified by:setPreferredAudioDevice in interface ExoPlayerParameters:audioDeviceInfo - The preferred audio device, or null to restore the default.
-
public 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.
Specified by:setVolume in interface ExoPlayer.AudioComponentSpecified by:setVolume in interface PlayerParameters:volume - Linear output gain to apply to all audio channels.
-
public 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.
Specified by:getVolume in interface ExoPlayer.AudioComponentSpecified by:getVolume in interface PlayerReturns:The linear gain applied to all audio channels.
-
public boolean getSkipSilenceEnabled()
Deprecated.
Description copied from interface: ExoPlayer
Returns whether skipping silences in the audio stream is enabled.
Specified by:getSkipSilenceEnabled in interface ExoPlayerSpecified by:getSkipSilenceEnabled in interface ExoPlayer.AudioComponent
-
public void setVideoEffects([List](https://developer.android.com/reference/java/util/List.html "class or interface in java.util")<[Effect](util/Effect.html "interface in com.google.android.exoplayer2.util")> videoEffects)
Deprecated.
Description copied from interface: ExoPlayer
Sets a List of video effects that will be applied to each video frame.
The following limitations exist for using video effects:
- This feature works only with the default [`MediaCodecVideoRenderer`](video/MediaCodecVideoRenderer.html "class in com.google.android.exoplayer2.video") and not custom or extension [video renderers](Renderer.html "interface in com.google.android.exoplayer2").
- This feature does not work with DRM-protected contents.
- This method should be called before calling [`ExoPlayer.prepare(com.google.android.exoplayer2.source.MediaSource)`](ExoPlayer.html#prepare(com.google.android.exoplayer2.source.MediaSource)).
Specified by:setVideoEffects in interface ExoPlayerParameters:videoEffects - The List of video effects to apply.
-
public void setSkipSilenceEnabled(boolean skipSilenceEnabled)
Deprecated.
Description copied from interface: ExoPlayer
Sets whether skipping silences in the audio stream is enabled.
Specified by:setSkipSilenceEnabled in interface ExoPlayerSpecified by:setSkipSilenceEnabled in interface ExoPlayer.AudioComponentParameters:skipSilenceEnabled - Whether skipping silences in the audio stream is enabled.
-
public[AnalyticsCollector](analytics/AnalyticsCollector.html "interface in com.google.android.exoplayer2.analytics")getAnalyticsCollector()
Deprecated.
Description copied from interface: ExoPlayer
Returns the AnalyticsCollector used for collecting analytics events.
Specified by:getAnalyticsCollector in interface ExoPlayer
-
public void addAnalyticsListener([AnalyticsListener](analytics/AnalyticsListener.html "interface in com.google.android.exoplayer2.analytics")listener)
Deprecated.
Description copied from interface: ExoPlayer
Adds an AnalyticsListener to receive analytics events.
This method can be called from any thread.
Specified by:addAnalyticsListener in interface ExoPlayerParameters:listener - The listener to be added.
-
public void removeAnalyticsListener([AnalyticsListener](analytics/AnalyticsListener.html "interface in com.google.android.exoplayer2.analytics")listener)
Deprecated.
Description copied from interface: ExoPlayer
Removes an AnalyticsListener.
Specified by:removeAnalyticsListener in interface ExoPlayerParameters:listener - The listener to be removed.
-
public void setHandleAudioBecomingNoisy(boolean handleAudioBecomingNoisy)
Deprecated.
Description copied from interface: ExoPlayer
Sets whether the player should pause automatically when audio is rerouted from a headset to device speakers. See the audio becoming noisy documentation for more information.
Specified by:setHandleAudioBecomingNoisy in interface ExoPlayerParameters:handleAudioBecomingNoisy - Whether the player should pause automatically when audio is rerouted from a headset to device speakers.
-
public void setPriorityTaskManager(@Nullable[PriorityTaskManager](util/PriorityTaskManager.html "class in com.google.android.exoplayer2.util")priorityTaskManager)
Deprecated.
Description copied from interface: ExoPlayer
Sets a PriorityTaskManager, or null to clear a previously set priority task manager.
The priority C.PRIORITY_PLAYBACK will be set while the player is loading.
Specified by:setPriorityTaskManager in interface ExoPlayerParameters:priorityTaskManager - The PriorityTaskManager, or null to clear a previously set priority task manager.
-
@Nullable
public[Format](Format.html "class in com.google.android.exoplayer2")getVideoFormat()
Deprecated.
Description copied from interface: ExoPlayer
Returns the video format currently being played, or null if no video is being played.
Specified by:getVideoFormat in interface ExoPlayer
-
@Nullable
public[Format](Format.html "class in com.google.android.exoplayer2")getAudioFormat()
Deprecated.
Description copied from interface: ExoPlayer
Returns the audio format currently being played, or null if no audio is being played.
Specified by:getAudioFormat in interface ExoPlayer
-
@Nullable
public[DecoderCounters](decoder/DecoderCounters.html "class in com.google.android.exoplayer2.decoder")getVideoDecoderCounters()
Deprecated.
Description copied from interface: ExoPlayer
Returns DecoderCounters for video, or null if no video is being played.
Specified by:getVideoDecoderCounters in interface ExoPlayer
-
@Nullable
public[DecoderCounters](decoder/DecoderCounters.html "class in com.google.android.exoplayer2.decoder")getAudioDecoderCounters()
Deprecated.
Description copied from interface: ExoPlayer
Returns DecoderCounters for audio, or null if no audio is being played.
Specified by:getAudioDecoderCounters in interface ExoPlayer
-
public void setVideoFrameMetadataListener([VideoFrameMetadataListener](video/VideoFrameMetadataListener.html "interface in com.google.android.exoplayer2.video")listener)
Deprecated.
Description copied from interface: ExoPlayer
Sets a listener to receive video frame metadata events.
This method is intended to be called by the same component that sets the Surface onto which video will be rendered. If using ExoPlayer's standard UI components, this method should not be called directly from application code.
Specified by:setVideoFrameMetadataListener in interface ExoPlayerSpecified by:setVideoFrameMetadataListener in interface ExoPlayer.VideoComponentParameters:listener - The listener.
-
public void clearVideoFrameMetadataListener([VideoFrameMetadataListener](video/VideoFrameMetadataListener.html "interface in com.google.android.exoplayer2.video")listener)
Deprecated.
Description copied from interface: ExoPlayer
Clears the listener which receives video frame metadata events if it matches the one passed. Else does nothing.
Specified by:clearVideoFrameMetadataListener in interface ExoPlayerSpecified by:clearVideoFrameMetadataListener in interface ExoPlayer.VideoComponentParameters:listener - The listener to clear.
-
public void setCameraMotionListener([CameraMotionListener](video/spherical/CameraMotionListener.html "interface in com.google.android.exoplayer2.video.spherical")listener)
Deprecated.
Description copied from interface: ExoPlayer
Sets a listener of camera motion events.
Specified by:setCameraMotionListener in interface ExoPlayerSpecified by:setCameraMotionListener in interface ExoPlayer.VideoComponentParameters:listener - The listener.
-
public void clearCameraMotionListener([CameraMotionListener](video/spherical/CameraMotionListener.html "interface in com.google.android.exoplayer2.video.spherical")listener)
Deprecated.
Description copied from interface: ExoPlayer
Clears the listener which receives camera motion events if it matches the one passed. Else does nothing.
Specified by:clearCameraMotionListener in interface ExoPlayerSpecified by:clearCameraMotionListener in interface ExoPlayer.VideoComponentParameters:listener - The listener to clear.
-
public[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.
Specified by:getCurrentCues in interface ExoPlayer.TextComponentSpecified by:getCurrentCues in interface Player
-
public[Looper](https://developer.android.com/reference/android/os/Looper.html "class or interface in android.os")getPlaybackLooper()
Deprecated.
Description copied from interface: ExoPlayer
Returns the Looper associated with the playback thread.
This method may be called from any thread.
Specified by:getPlaybackLooper in interface ExoPlayer
-
public[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.
Specified by:getApplicationLooper in interface Player
-
public[Clock](util/Clock.html "interface in com.google.android.exoplayer2.util")getClock()
Deprecated.
Description copied from interface: ExoPlayer
Returns the Clock used for playback.
This method can be called from any thread.
Specified by:getClock in interface ExoPlayer
-
public 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.
Specified by:addListener in interface PlayerParameters:listener - The listener to register.
-
public 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.
Specified by:removeListener in interface PlayerParameters:listener - The listener to unregister.
-
[@State](Player.State.html "annotation in com.google.android.exoplayer2")public @com.google.android.exoplayer2.Player.State int getPlaybackState()
Deprecated.
Description copied from interface: Player
Returns the current playback state of the player.
Specified by:getPlaybackState in interface PlayerReturns:The current playback state.See Also:Player.Listener.onPlaybackStateChanged(int)
-
[@PlaybackSuppressionReason](Player.PlaybackSuppressionReason.html "annotation in com.google.android.exoplayer2")public @com.google.android.exoplayer2.Player.PlaybackSuppressionReason 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.
Specified by:getPlaybackSuppressionReason in interface PlayerReturns:The current Player.PlaybackSuppressionReason.See Also:Player.Listener.onPlaybackSuppressionReasonChanged(int)
-
@Nullable
public[ExoPlaybackException](ExoPlaybackException.html "class in com.google.android.exoplayer2")getPlayerError()
Deprecated.
Description copied from interface: ExoPlayer
Equivalent to Player.getPlayerError(), except the exception is guaranteed to be an ExoPlaybackException.
Specified by:getPlayerError in interface ExoPlayerSpecified by:getPlayerError in interface PlayerReturns:The error, or null.See Also:Player.Listener.onPlayerError(PlaybackException)
-
public[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.
Specified by:getAvailableCommands in interface PlayerReturns:The currently available Player.Commands.See Also:Player.Listener.onAvailableCommandsChanged(com.google.android.exoplayer2.Player.Commands)
-
public 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.
Specified by:prepare in interface Player
-
[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public void prepare([MediaSource](source/MediaSource.html "interface in com.google.android.exoplayer2.source")mediaSource)
Deprecated.
Use setMediaSource(MediaSource) and Player.prepare() instead.
Specified by:prepare in interface ExoPlayer
-
[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public void prepare([MediaSource](source/MediaSource.html "interface in com.google.android.exoplayer2.source")mediaSource,
boolean resetPosition,
boolean resetState)
Deprecated.
Use setMediaSource(MediaSource, boolean) and Player.prepare() instead.
Specified by:prepare in interface ExoPlayer
-
public 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.
Specified by:setMediaItems in interface PlayerParameters: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 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.
Specified by:setMediaItems in interface PlayerParameters: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 void setMediaSources([List](https://developer.android.com/reference/java/util/List.html "class or interface in java.util")<[MediaSource](source/MediaSource.html "interface in com.google.android.exoplayer2.source")> mediaSources)
Deprecated.
Description copied from interface: ExoPlayer
Clears the playlist, adds the specified MediaSources and resets the position to the default position.
Specified by:setMediaSources in interface ExoPlayerParameters:mediaSources - The new MediaSources.
-
public void setMediaSources([List](https://developer.android.com/reference/java/util/List.html "class or interface in java.util")<[MediaSource](source/MediaSource.html "interface in com.google.android.exoplayer2.source")> mediaSources,
boolean resetPosition)
Deprecated.
Description copied from interface: ExoPlayer
Clears the playlist and adds the specified MediaSources.
Specified by:setMediaSources in interface ExoPlayerParameters:mediaSources - The new MediaSources.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 void setMediaSources([List](https://developer.android.com/reference/java/util/List.html "class or interface in java.util")<[MediaSource](source/MediaSource.html "interface in com.google.android.exoplayer2.source")> mediaSources,
int startMediaItemIndex,
long startPositionMs)
Deprecated.
Description copied from interface: ExoPlayer
Clears the playlist and adds the specified MediaSources.
Specified by:setMediaSources in interface ExoPlayerParameters:mediaSources - The new MediaSources.startMediaItemIndex - The media item 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 media item is used. In any case, if startMediaItemIndex is set to C.INDEX_UNSET, this parameter is ignored and the position is not reset at all.
-
public void setMediaSource([MediaSource](source/MediaSource.html "interface in com.google.android.exoplayer2.source")mediaSource)
Deprecated.
Description copied from interface: ExoPlayer
Clears the playlist, adds the specified MediaSource and resets the position to the default position.
Specified by:setMediaSource in interface ExoPlayerParameters:mediaSource - The new MediaSource.
-
public void setMediaSource([MediaSource](source/MediaSource.html "interface in com.google.android.exoplayer2.source")mediaSource,
boolean resetPosition)
Deprecated.
Description copied from interface: ExoPlayer
Clears the playlist and adds the specified MediaSource.
Specified by:setMediaSource in interface ExoPlayerParameters:mediaSource - The new MediaSource.resetPosition - Whether the playback position should be reset to the default position. If false, playback will start from the position defined by Player.getCurrentMediaItemIndex() and Player.getCurrentPosition().
-
public void setMediaSource([MediaSource](source/MediaSource.html "interface in com.google.android.exoplayer2.source")mediaSource,
long startPositionMs)
Deprecated.
Description copied from interface: ExoPlayer
Clears the playlist and adds the specified MediaSource.
Specified by:setMediaSource in interface ExoPlayerParameters:mediaSource - The new MediaSource.startPositionMs - The position in milliseconds to start playback from.
-
public 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.
Specified by:addMediaItems in interface PlayerParameters: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 void addMediaSource([MediaSource](source/MediaSource.html "interface in com.google.android.exoplayer2.source")mediaSource)
Deprecated.
Description copied from interface: ExoPlayer
Adds a media source to the end of the playlist.
Specified by:addMediaSource in interface ExoPlayerParameters:mediaSource - The MediaSource to add.
-
public void addMediaSource(int index,[MediaSource](source/MediaSource.html "interface in com.google.android.exoplayer2.source")mediaSource)
Deprecated.
Description copied from interface: ExoPlayer
Adds a media source at the given index of the playlist.
Specified by:addMediaSource in interface ExoPlayerParameters:index - The index at which to add the source.mediaSource - The MediaSource to add.
-
public void addMediaSources([List](https://developer.android.com/reference/java/util/List.html "class or interface in java.util")<[MediaSource](source/MediaSource.html "interface in com.google.android.exoplayer2.source")> mediaSources)
Deprecated.
Description copied from interface: ExoPlayer
Adds a list of media sources to the end of the playlist.
Specified by:addMediaSources in interface ExoPlayerParameters:mediaSources - The MediaSources to add.
-
public void addMediaSources(int index,[List](https://developer.android.com/reference/java/util/List.html "class or interface in java.util")<[MediaSource](source/MediaSource.html "interface in com.google.android.exoplayer2.source")> mediaSources)
Deprecated.
Description copied from interface: ExoPlayer
Adds a list of media sources at the given index of the playlist.
Specified by:addMediaSources in interface ExoPlayerParameters:index - The index at which to add the media sources.mediaSources - The MediaSources to add.
-
public 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.
Specified by:moveMediaItems in interface PlayerParameters: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 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.
Specified by:replaceMediaItems in interface PlayerParameters: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 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.
Specified by:removeMediaItems in interface PlayerParameters: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 void setShuffleOrder([ShuffleOrder](source/ShuffleOrder.html "interface in com.google.android.exoplayer2.source")shuffleOrder)
Deprecated.
Description copied from interface: ExoPlayer
Sets the shuffle order.
The ShuffleOrder passed must have the same length as the current playlist (Player.getMediaItemCount()).
Specified by:setShuffleOrder in interface ExoPlayerParameters:shuffleOrder - The shuffle order.
-
public 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.
Specified by:setPlayWhenReady in interface PlayerParameters:playWhenReady - Whether playback should proceed when ready.
-
public boolean getPlayWhenReady()
Deprecated.
Description copied from interface: Player
Whether playback will proceed when Player.getPlaybackState() == Player.STATE_READY.
Specified by:getPlayWhenReady in interface PlayerReturns:Whether playback will proceed when ready.See Also:Player.Listener.onPlayWhenReadyChanged(boolean, int)
-
public void setPauseAtEndOfMediaItems(boolean pauseAtEndOfMediaItems)
Deprecated.
Description copied from interface: ExoPlayer
Sets whether to pause playback at the end of each media item.
This means the player will pause at the end of each window in the current timeline. Listeners will be informed by a call to Player.Listener.onPlayWhenReadyChanged(boolean, int) with the reason Player.PLAY_WHEN_READY_CHANGE_REASON_END_OF_MEDIA_ITEM when this happens.
Specified by:setPauseAtEndOfMediaItems in interface ExoPlayerParameters:pauseAtEndOfMediaItems - Whether to pause playback at the end of each media item.
-
public boolean getPauseAtEndOfMediaItems()
Deprecated.
Description copied from interface: ExoPlayer
Returns whether the player pauses playback at the end of each media item.
Specified by:getPauseAtEndOfMediaItems in interface ExoPlayerSee Also:ExoPlayer.setPauseAtEndOfMediaItems(boolean)
-
[@RepeatMode](Player.RepeatMode.html "annotation in com.google.android.exoplayer2")public @com.google.android.exoplayer2.Player.RepeatMode int getRepeatMode()
Deprecated.
Description copied from interface: Player
Returns the current Player.RepeatMode used for playback.
Specified by:getRepeatMode in interface PlayerReturns:The current repeat mode.See Also:Player.Listener.onRepeatModeChanged(int)
-
public 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.
Specified by:setRepeatMode in interface PlayerParameters:repeatMode - The repeat mode.
-
public 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.
Specified by:setShuffleModeEnabled in interface PlayerParameters:shuffleModeEnabled - Whether shuffling is enabled.
-
public boolean getShuffleModeEnabled()
Deprecated.
Description copied from interface: Player
Returns whether shuffling of media items is enabled.
Specified by:getShuffleModeEnabled in interface PlayerSee Also:Player.Listener.onShuffleModeEnabledChanged(boolean)
-
public boolean isLoading()
Deprecated.
Description copied from interface: Player
Whether the player is currently loading the source.
Specified by:isLoading in interface PlayerReturns:Whether the player is currently loading the source.See Also:Player.Listener.onIsLoadingChanged(boolean)
-
public 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 long getSeekBackIncrement()
Deprecated.
Description copied from interface: Player
Returns the Player.seekBack() increment.
Specified by:getSeekBackIncrement in interface PlayerReturns:The seek back increment, in milliseconds.See Also:Player.Listener.onSeekBackIncrementChanged(long)
-
public long getSeekForwardIncrement()
Deprecated.
Description copied from interface: Player
Returns the Player.seekForward() increment.
Specified by:getSeekForwardIncrement in interface PlayerReturns:The seek forward increment, in milliseconds.See Also:Player.Listener.onSeekForwardIncrementChanged(long)
-
public long getMaxSeekToPreviousPosition()
Deprecated.
Description copied from interface: Player
Returns the maximum position for which Player.seekToPrevious() seeks to the previous MediaItem, in milliseconds.
Specified by:getMaxSeekToPreviousPosition in interface PlayerReturns:The maximum seek to previous position, in milliseconds.See Also:Player.Listener.onMaxSeekToPreviousPositionChanged(long)
-
public 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.
Specified by:setPlaybackParameters in interface PlayerParameters:playbackParameters - The playback parameters.
-
public[PlaybackParameters](PlaybackParameters.html "class in com.google.android.exoplayer2")getPlaybackParameters()
Deprecated.
Description copied from interface: Player
Returns the currently active playback parameters.
Specified by:getPlaybackParameters in interface PlayerSee Also:Player.Listener.onPlaybackParametersChanged(PlaybackParameters)
-
public void setSeekParameters(@Nullable[SeekParameters](SeekParameters.html "class in com.google.android.exoplayer2")seekParameters)
Deprecated.
Description copied from interface: ExoPlayer
Sets the parameters that control how seek operations are performed.
Specified by:setSeekParameters in interface ExoPlayerParameters:seekParameters - The seek parameters, or null to use the defaults.
-
public[SeekParameters](SeekParameters.html "class in com.google.android.exoplayer2")getSeekParameters()
Deprecated.
Description copied from interface: ExoPlayer
Returns the currently active SeekParameters of the player.
Specified by:getSeekParameters in interface ExoPlayer
-
public void setForegroundMode(boolean foregroundMode)
Deprecated.
Description copied from interface: ExoPlayer
Sets whether the player is allowed to keep holding limited resources such as video decoders, even when in the idle state. By doing so, the player may be able to reduce latency when starting to play another piece of content for which the same resources are required.
This mode should be used with caution, since holding limited resources may prevent other players of media components from acquiring them. It should only be enabled when both of the following conditions are true:
- The application that owns the player is in the foreground.
- The player is used in a way that may benefit from foreground mode. For this to be true, the same player instance must be used to play multiple pieces of content, and there must be gaps between the playbacks (i.e. [`Player.stop()`](Player.html#stop()) is called to halt one playback, and [`ExoPlayer.prepare(com.google.android.exoplayer2.source.MediaSource)`](ExoPlayer.html#prepare(com.google.android.exoplayer2.source.MediaSource)) is called some time later to start a new one).
Note that foreground mode is not useful for switching between content without gaps between the playbacks. For this use case Player.stop() does not need to be called, and simply calling ExoPlayer.prepare(com.google.android.exoplayer2.source.MediaSource) for the new media will cause limited resources to be retained even if foreground mode is not enabled.
If foreground mode is enabled, it's the application's responsibility to disable it when the conditions described above no longer hold.
Specified by:setForegroundMode in interface ExoPlayerParameters:foregroundMode - Whether the player is allowed to keep limited resources even when in the idle state.
-
public 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.
Specified by:stop in interface Player
-
public 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.
Specified by:release in interface Player
-
public[PlayerMessage](PlayerMessage.html "class in com.google.android.exoplayer2")createMessage([PlayerMessage.Target](PlayerMessage.Target.html "interface in com.google.android.exoplayer2")target)
Deprecated.
Description copied from interface: ExoPlayer
Creates a message that can be sent to a PlayerMessage.Target. By default, the message will be delivered immediately without blocking on the playback thread. The default PlayerMessage.getType() is 0 and the default PlayerMessage.getPayload() is null. If a position is specified with PlayerMessage.setPosition(long), the message will be delivered at this position in the current media item defined by Player.getCurrentMediaItemIndex(). Alternatively, the message can be sent at a specific mediaItem using PlayerMessage.setPosition(int, long).
Specified by:createMessage in interface ExoPlayer
-
public int getRendererCount()
Deprecated.
Description copied from interface: ExoPlayer
Returns the number of renderers.
Specified by:getRendererCount in interface ExoPlayer
-
public @com.google.android.exoplayer2.C.TrackType int getRendererType(int index)
Deprecated.
Description copied from interface: ExoPlayer
Returns the track type that the renderer at a given index handles.
For example, a video renderer will return C.TRACK_TYPE_VIDEO, an audio renderer will return C.TRACK_TYPE_AUDIO and a text renderer will return C.TRACK_TYPE_TEXT.
Specified by:getRendererType in interface ExoPlayerParameters:index - The index of the renderer.Returns:The track type that the renderer handles.
-
public[Renderer](Renderer.html "interface in com.google.android.exoplayer2")getRenderer(int index)
Deprecated.
Description copied from interface: ExoPlayer
Returns the renderer at the given index.
Specified by:getRenderer in interface ExoPlayerParameters:index - The index of the renderer.Returns:The renderer at this index.
-
public[TrackSelector](trackselection/TrackSelector.html "class in com.google.android.exoplayer2.trackselection")getTrackSelector()
Deprecated.
Description copied from interface: ExoPlayer
Returns the track selector that this player uses, or null if track selection is not supported.
Specified by:getTrackSelector in interface ExoPlayer
-
[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public[TrackGroupArray](source/TrackGroupArray.html "class in com.google.android.exoplayer2.source")getCurrentTrackGroups()
Deprecated.
Use getCurrentTracks().
Description copied from interface: ExoPlayer
Returns the available track groups.
Specified by:getCurrentTrackGroups in interface ExoPlayerSee Also:Player.Listener.onTracksChanged(Tracks)
-
[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public[TrackSelectionArray](trackselection/TrackSelectionArray.html "class in com.google.android.exoplayer2.trackselection")getCurrentTrackSelections()
Deprecated.
Use getCurrentTracks().
Description copied from interface: ExoPlayer
Returns the current track selections for each renderer, which may include null elements if some renderers do not have any selected tracks.
Specified by:getCurrentTrackSelections in interface ExoPlayerSee Also:Player.Listener.onTracksChanged(Tracks)
-
public[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.
Specified by:getCurrentTracks in interface PlayerSee Also:Player.Listener.onTracksChanged(Tracks)
-
public[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.
Specified by:getTrackSelectionParameters in interface PlayerSee Also:}
-
public 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.
Specified by:setTrackSelectionParameters in interface Player
-
public[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.
Specified by:getMediaMetadata in interface Player
-
public[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.
Specified by:getPlaylistMetadata in interface Player
-
public 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.
Specified by:setPlaylistMetadata in interface Player
-
public[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.
Specified by:getCurrentTimeline in interface PlayerSee Also:Player.Listener.onTimelineChanged(Timeline, int)
-
public 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.
Specified by:getCurrentPeriodIndex in interface Player
-
public 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.
Specified by:getCurrentMediaItemIndex in interface Player
-
public 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.
Specified by:getDuration in interface Player
-
public 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.
Specified by:getCurrentPosition in interface Player
-
public 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.
Specified by:getBufferedPosition in interface Player
-
public 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.
Specified by:getTotalBufferedDuration in interface Player
-
public 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.
Specified by:isPlayingAd in interface Player
-
public 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.
Specified by:getCurrentAdGroupIndex in interface Player
-
public 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.
Specified by:getCurrentAdIndexInAdGroup in interface Player
-
public 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.
Specified by:getContentPosition in interface Player
-
public 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.
Specified by:getContentBufferedPosition in interface Player
-
public void setWakeMode([@WakeMode](C.WakeMode.html "annotation in com.google.android.exoplayer2")@com.google.android.exoplayer2.C.WakeMode int wakeMode)
Deprecated.
Description copied from interface: ExoPlayer
Sets how the player should keep the device awake for playback when the screen is off.
Enabling this feature requires the Manifest.permission.WAKE_LOCK permission. It should be used together with a foreground Service for use cases where playback occurs and the screen is off (e.g. background audio playback). It is not useful when the screen will be kept on during playback (e.g. foreground video playback).
When enabled, the locks (PowerManager.WakeLock / WifiManager.WifiLock) will be held whenever the player is in the Player.STATE_READY or Player.STATE_BUFFERING states with playWhenReady = true. The locks held depends on the specified C.WakeMode.
Specified by:setWakeMode in interface ExoPlayerParameters:wakeMode - The C.WakeMode option to keep the device awake during playback.
-
public[DeviceInfo](DeviceInfo.html "class in com.google.android.exoplayer2")getDeviceInfo()
Deprecated.
Description copied from interface: Player
Gets the device information.
Specified by:getDeviceInfo in interface ExoPlayer.DeviceComponentSpecified by:getDeviceInfo in interface Player
-
public 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.
Specified by:getDeviceVolume in interface ExoPlayer.DeviceComponentSpecified by:getDeviceVolume in interface Player
-
public 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.
Specified by:isDeviceMuted in interface ExoPlayer.DeviceComponentSpecified by:isDeviceMuted in interface Player
-
[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public void setDeviceVolume(int volume)
Deprecated.
Use setDeviceVolume(int, int) instead.
Specified by:setDeviceVolume in interface ExoPlayer.DeviceComponentSpecified by:setDeviceVolume in interface Player
-
public 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.
Specified by:setDeviceVolume in interface PlayerParameters: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 void increaseDeviceVolume()
Deprecated.
Use increaseDeviceVolume(int) instead.
Specified by:increaseDeviceVolume in interface ExoPlayer.DeviceComponentSpecified by:increaseDeviceVolume in interface Player
-
public 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.
Specified by:increaseDeviceVolume in interface PlayerParameters: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 void decreaseDeviceVolume()
Deprecated.
Use decreaseDeviceVolume(int) instead.
Specified by:decreaseDeviceVolume in interface ExoPlayer.DeviceComponentSpecified by:decreaseDeviceVolume in interface Player
-
public 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.
Specified by:decreaseDeviceVolume in interface PlayerParameters: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 void setDeviceMuted(boolean muted)
Deprecated.
Use setDeviceMuted(boolean, int) instead.
Specified by:setDeviceMuted in interface ExoPlayer.DeviceComponentSpecified by:setDeviceMuted in interface Player
-
public 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.
Specified by:setDeviceMuted in interface PlayerParameters:muted - Whether to set the device to be muted or notflags - Either 0 or a bitwise combination of one or more C.VolumeFlags.
-
public boolean isTunnelingEnabled()
Deprecated.
Description copied from interface: ExoPlayer
Returns whether tunneling is enabled for the currently selected tracks.
Specified by:isTunnelingEnabled in interface ExoPlayerSee Also:Player.Listener.onTracksChanged(Tracks)