Class SimpleExoPlayer
- java.lang.Object
-
- com.google.android.exoplayer2.BasePlayer
-
- com.google.android.exoplayer2.SimpleExoPlayer
-
- All Implemented Interfaces:
ExoPlayer
,ExoPlayer.AudioComponent
,ExoPlayer.DeviceComponent
,ExoPlayer.TextComponent
,ExoPlayer.VideoComponent
,Player
@Deprecated public class SimpleExoPlayer extends BasePlayer implements ExoPlayer, ExoPlayer.AudioComponent, ExoPlayer.VideoComponent, ExoPlayer.TextComponent, ExoPlayer.DeviceComponent
Deprecated.UseExoPlayer
instead.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SimpleExoPlayer.Builder
Deprecated.UseExoPlayer.Builder
instead.-
Nested classes/interfaces inherited from interface com.google.android.exoplayer2.ExoPlayer
ExoPlayer.AudioComponent, ExoPlayer.AudioOffloadListener, ExoPlayer.DeviceComponent, ExoPlayer.TextComponent, ExoPlayer.VideoComponent
-
Nested classes/interfaces inherited from interface com.google.android.exoplayer2.Player
Player.Command, Player.Commands, Player.DiscontinuityReason, Player.Event, Player.EventListener, Player.Events, Player.Listener, Player.MediaItemTransitionReason, Player.PlaybackSuppressionReason, Player.PlayWhenReadyChangeReason, Player.PositionInfo, Player.RepeatMode, Player.State, Player.TimelineChangeReason
-
-
Field Summary
Fields Modifier and Type Field Description protected Renderer[]
renderers
Deprecated.-
Fields inherited from class com.google.android.exoplayer2.BasePlayer
window
-
Fields inherited from interface com.google.android.exoplayer2.ExoPlayer
DEFAULT_DETACH_SURFACE_TIMEOUT_MS, DEFAULT_RELEASE_TIMEOUT_MS
-
Fields inherited from interface com.google.android.exoplayer2.Player
COMMAND_ADJUST_DEVICE_VOLUME, COMMAND_CHANGE_MEDIA_ITEMS, COMMAND_GET_AUDIO_ATTRIBUTES, COMMAND_GET_CURRENT_MEDIA_ITEM, COMMAND_GET_DEVICE_VOLUME, COMMAND_GET_MEDIA_ITEMS_METADATA, COMMAND_GET_TEXT, COMMAND_GET_TIMELINE, COMMAND_GET_TRACK_INFOS, COMMAND_GET_VOLUME, COMMAND_INVALID, COMMAND_PLAY_PAUSE, COMMAND_PREPARE, 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_MEDIA_ITEMS_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_AVAILABLE_COMMANDS_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_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_REPEAT_MODE_CHANGED, EVENT_SEEK_BACK_INCREMENT_CHANGED, EVENT_SEEK_FORWARD_INCREMENT_CHANGED, EVENT_SHUFFLE_MODE_ENABLED_CHANGED, EVENT_TIMELINE_CHANGED, EVENT_TRACK_SELECTION_PARAMETERS_CHANGED, EVENT_TRACKS_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_USER_REQUEST, PLAYBACK_SUPPRESSION_REASON_NONE, PLAYBACK_SUPPRESSION_REASON_TRANSIENT_AUDIO_FOCUS_LOSS, 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
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
SimpleExoPlayer(Context context, RenderersFactory renderersFactory, TrackSelector trackSelector, MediaSourceFactory mediaSourceFactory, LoadControl loadControl, BandwidthMeter bandwidthMeter, AnalyticsCollector analyticsCollector, boolean useLazyPreparation, Clock clock, Looper applicationLooper)
Deprecated.Use theExoPlayer.Builder
.protected
SimpleExoPlayer(SimpleExoPlayer.Builder builder)
Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
addAnalyticsListener(AnalyticsListener listener)
Deprecated.Adds anAnalyticsListener
to receive analytics events.void
addAudioOffloadListener(ExoPlayer.AudioOffloadListener listener)
Deprecated.Adds a listener to receive audio offload events.void
addListener(Player.EventListener listener)
Deprecated.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.void
clearVideoSurface(Surface surface)
Deprecated.Clears theSurface
onto which video is being rendered if it matches the one passed.void
clearVideoSurfaceHolder(SurfaceHolder surfaceHolder)
Deprecated.Clears theSurfaceHolder
that holds theSurface
onto which video is being rendered if it matches the one passed.void
clearVideoSurfaceView(SurfaceView surfaceView)
Deprecated.Clears theSurfaceView
onto which video is being rendered if it matches the one passed.void
clearVideoTextureView(TextureView textureView)
Deprecated.Clears theTextureView
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 aPlayerMessage.Target
.void
decreaseDeviceVolume()
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 theAnalyticsCollector
used for collecting analytics events.Looper
getApplicationLooper()
Deprecated.Returns theLooper
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.DecoderCounters
getAudioDecoderCounters()
Deprecated.ReturnsDecoderCounters
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, orC.AUDIO_SESSION_ID_UNSET
if not set.Player.Commands
getAvailableCommands()
Deprecated.Returns the player's currently availablePlayer.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 theClock
used for playback.long
getContentBufferedPosition()
Deprecated.IfPlayer.isPlayingAd()
returnstrue
, returns an estimate of the content position in the current content up to which data is buffered, in milliseconds.long
getContentPosition()
Deprecated.IfPlayer.isPlayingAd()
returnstrue
, returns the content position that will be played once all ads in the ad group have finished playing, in milliseconds.int
getCurrentAdGroupIndex()
Deprecated.IfPlayer.isPlayingAd()
returns true, returns the index of the ad group in the period currently being played.int
getCurrentAdIndexInAdGroup()
Deprecated.IfPlayer.isPlayingAd()
returns true, returns the index of the ad in its ad group.List<Cue>
getCurrentCues()
Deprecated.Returns the currentCues
.int
getCurrentMediaItemIndex()
Deprecated.Returns the index of the currentMediaItem
in thetimeline
, or the prospective index if thecurrent 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 thecurrent timeline
is empty.Timeline
getCurrentTimeline()
Deprecated.Returns the currentTimeline
.TrackGroupArray
getCurrentTrackGroups()
Deprecated.Returns the available track groups.TrackSelectionArray
getCurrentTrackSelections()
Deprecated.Returns the current track selections.TracksInfo
getCurrentTracksInfo()
Deprecated.Returns the available tracks, as well as the tracks' support, type, and selection status.ExoPlayer.DeviceComponent
getDeviceComponent()
Deprecated.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, orC.TIME_UNSET
if the duration is not known.long
getMaxSeekToPreviousPosition()
Deprecated.Returns the maximum position for whichPlayer.seekToPrevious()
seeks to the previousMediaItem
, in milliseconds.MediaMetadata
getMediaMetadata()
Deprecated.Returns the current combinedMediaMetadata
, orMediaMetadata.EMPTY
if not supported.boolean
getPauseAtEndOfMediaItems()
Deprecated.Returns whether the player pauses playback at the end of each media item.Looper
getPlaybackLooper()
Deprecated.Returns theLooper
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 currentplayback state
of the player.@com.google.android.exoplayer2.Player.PlaybackSuppressionReason int
getPlaybackSuppressionReason()
Deprecated.Returns the reason why playback is suppressed even thoughPlayer.getPlayWhenReady()
istrue
, orPlayer.PLAYBACK_SUPPRESSION_REASON_NONE
if playback is not suppressed.ExoPlaybackException
getPlayerError()
Deprecated.Equivalent toPlayer.getPlayerError()
, except the exception is guaranteed to be anExoPlaybackException
.MediaMetadata
getPlaylistMetadata()
Deprecated.Returns the playlistMediaMetadata
, as set byPlayer.setPlaylistMetadata(MediaMetadata)
, orMediaMetadata.EMPTY
if not supported.boolean
getPlayWhenReady()
Deprecated.Whether playback will proceed whenPlayer.getPlaybackState()
==Player.STATE_READY
.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 currentPlayer.RepeatMode
used for playback.long
getSeekBackIncrement()
Deprecated.Returns thePlayer.seekBack()
increment.long
getSeekForwardIncrement()
Deprecated.Returns thePlayer.seekForward()
increment.SeekParameters
getSeekParameters()
Deprecated.Returns the currently activeSeekParameters
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.ExoPlayer.TextComponent
getTextComponent()
Deprecated.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.int
getVideoChangeFrameRateStrategy()
Deprecated.Returns theC.VideoChangeFrameRateStrategy
.ExoPlayer.VideoComponent
getVideoComponent()
Deprecated.DecoderCounters
getVideoDecoderCounters()
Deprecated.ReturnsDecoderCounters
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.int
getVideoScalingMode()
Deprecated.Returns theC.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.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.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.UsesetMediaSource(MediaSource)
andPlayer.prepare()
instead.void
prepare(MediaSource mediaSource, boolean resetPosition, boolean resetState)
Deprecated.UsesetMediaSource(MediaSource, boolean)
andPlayer.prepare()
instead.void
release()
Deprecated.Releases the player.void
removeAnalyticsListener(AnalyticsListener listener)
Deprecated.Removes anAnalyticsListener
.void
removeAudioOffloadListener(ExoPlayer.AudioOffloadListener listener)
Deprecated.Removes a listener of audio offload events.void
removeListener(Player.EventListener listener)
Deprecated.void
removeListener(Player.Listener listener)
Deprecated.Unregister a listener registered throughPlayer.addListener(Listener)
.void
removeMediaItems(int fromIndex, int toIndex)
Deprecated.Removes a range of media items from the playlist.void
retry()
Deprecated.Useprepare()
instead.void
seekTo(int mediaItemIndex, long positionMs)
Deprecated.Seeks to a position specified in milliseconds in the specifiedMediaItem
.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 underlyingAudioTrack
.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.Sets the mute state of the device.void
setDeviceVolume(int volume)
Deprecated.Sets the volume of the device.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
setHandleWakeLock(boolean handleWakeLock)
Deprecated.void
setMediaItems(List<MediaItem> mediaItems, boolean resetPosition)
Deprecated.Clears the playlist and adds the specifiedMediaItems
.void
setMediaItems(List<MediaItem> mediaItems, int startIndex, long startPositionMs)
Deprecated.Clears the playlist and adds the specifiedMediaItems
.void
setMediaSource(MediaSource mediaSource)
Deprecated.Clears the playlist, adds the specifiedMediaSource
and resets the position to the default position.void
setMediaSource(MediaSource mediaSource, boolean resetPosition)
Deprecated.Clears the playlist and adds the specifiedMediaSource
.void
setMediaSource(MediaSource mediaSource, long startPositionMs)
Deprecated.Clears the playlist and adds the specifiedMediaSource
.void
setMediaSources(List<MediaSource> mediaSources)
Deprecated.Clears the playlist, adds the specifiedMediaSources
and resets the position to the default position.void
setMediaSources(List<MediaSource> mediaSources, boolean resetPosition)
Deprecated.Clears the playlist and adds the specifiedMediaSources
.void
setMediaSources(List<MediaSource> mediaSources, int startMediaItemIndex, long startPositionMs)
Deprecated.Clears the playlist and adds the specifiedMediaSources
.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 playlistMediaMetadata
.void
setPlayWhenReady(boolean playWhenReady)
Deprecated.Sets whether playback should proceed whenPlayer.getPlaybackState()
==Player.STATE_READY
.void
setPriorityTaskManager(PriorityTaskManager priorityTaskManager)
Deprecated.Sets aPriorityTaskManager
, or null to clear a previously set priority task manager.void
setRepeatMode(@com.google.android.exoplayer2.Player.RepeatMode int repeatMode)
Deprecated.Sets thePlayer.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
setThrowsWhenUsingWrongThread(boolean throwsWhenUsingWrongThread)
Deprecated.void
setTrackSelectionParameters(TrackSelectionParameters parameters)
Deprecated.Sets the parameters constraining the track selection.void
setVideoChangeFrameRateStrategy(int videoChangeFrameRateStrategy)
Deprecated.Sets aC.VideoChangeFrameRateStrategy
that will be used by the player when provided with a video outputSurface
.void
setVideoFrameMetadataListener(VideoFrameMetadataListener listener)
Deprecated.Sets a listener to receive video frame metadata events.void
setVideoScalingMode(int videoScalingMode)
Deprecated.Sets theC.VideoScalingMode
.void
setVideoSurface(Surface surface)
Deprecated.Sets theSurface
onto which video will be rendered.void
setVideoSurfaceHolder(SurfaceHolder surfaceHolder)
Deprecated.Sets theSurfaceHolder
that holds theSurface
onto which video will be rendered.void
setVideoSurfaceView(SurfaceView surfaceView)
Deprecated.Sets theSurfaceView
onto which video will be rendered.void
setVideoTextureView(TextureView textureView)
Deprecated.Sets theTextureView
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.void
stop(boolean reset)
Deprecated.-
Methods inherited from class com.google.android.exoplayer2.BasePlayer
addMediaItem, addMediaItem, addMediaItems, canAdvertiseSession, clearMediaItems, getAvailableCommands, 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, seekBack, seekForward, seekTo, seekToDefaultPosition, seekToDefaultPosition, seekToNext, seekToNextMediaItem, seekToNextWindow, seekToPrevious, seekToPreviousMediaItem, seekToPreviousWindow, setMediaItem, setMediaItem, setMediaItem, setMediaItems, setPlaybackSpeed
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.google.android.exoplayer2.Player
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, seekBack, seekForward, seekTo, seekToDefaultPosition, seekToDefaultPosition, seekToNext, seekToNextMediaItem, seekToNextWindow, seekToPrevious, seekToPreviousMediaItem, seekToPreviousWindow, setMediaItem, setMediaItem, setMediaItem, setMediaItems, setPlaybackSpeed
-
-
-
-
Field Detail
-
renderers
protected final Renderer[] renderers
Deprecated.
-
-
Constructor Detail
-
SimpleExoPlayer
@Deprecated protected SimpleExoPlayer(Context context, RenderersFactory renderersFactory, TrackSelector trackSelector, MediaSourceFactory mediaSourceFactory, LoadControl loadControl, BandwidthMeter bandwidthMeter, AnalyticsCollector analyticsCollector, boolean useLazyPreparation, Clock clock, Looper applicationLooper)
Deprecated.Use theExoPlayer.Builder
.
-
SimpleExoPlayer
protected SimpleExoPlayer(SimpleExoPlayer.Builder builder)
Deprecated.- Parameters:
builder
- TheSimpleExoPlayer.Builder
to obtain all construction parameters.
-
-
Method Detail
-
experimentalSetOffloadSchedulingEnabled
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 withoffloadSchedulingEnabled = 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)
or the equivalent option passed toDefaultAudioSink(AudioCapabilities, DefaultAudioSink.AudioProcessorChain, boolean, boolean, int)
. - An audio track is playing in a format that the device supports offloading (for example, MP3 or AAC).
- The
AudioSink
is playing with an offloadAudioTrack
.
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 interfaceExoPlayer
- Parameters:
offloadSchedulingEnabled
- Whether to enable offload scheduling.
- Audio offload rendering is enabled in
-
experimentalIsSleepingForOffload
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.
-
getAudioComponent
@Nullable public ExoPlayer.AudioComponent getAudioComponent()
Deprecated.- Specified by:
getAudioComponent
in interfaceExoPlayer
-
getVideoComponent
@Nullable public ExoPlayer.VideoComponent getVideoComponent()
Deprecated.- Specified by:
getVideoComponent
in interfaceExoPlayer
-
getTextComponent
@Nullable public ExoPlayer.TextComponent getTextComponent()
Deprecated.- Specified by:
getTextComponent
in interfaceExoPlayer
-
getDeviceComponent
@Nullable public ExoPlayer.DeviceComponent getDeviceComponent()
Deprecated.- Specified by:
getDeviceComponent
in interfaceExoPlayer
-
setVideoScalingMode
public void setVideoScalingMode(@VideoScalingMode int videoScalingMode)
Deprecated.Description copied from interface:ExoPlayer
Sets theC.VideoScalingMode
.The scaling mode only applies if a
MediaCodec
-based videoRenderer
is enabled and if the output surface is owned by aSurfaceView
.- Specified by:
setVideoScalingMode
in interfaceExoPlayer
- Specified by:
setVideoScalingMode
in interfaceExoPlayer.VideoComponent
- Parameters:
videoScalingMode
- TheC.VideoScalingMode
.
-
getVideoScalingMode
@VideoScalingMode public int getVideoScalingMode()
Deprecated.Description copied from interface:ExoPlayer
Returns theC.VideoScalingMode
.- Specified by:
getVideoScalingMode
in interfaceExoPlayer
- Specified by:
getVideoScalingMode
in interfaceExoPlayer.VideoComponent
-
setVideoChangeFrameRateStrategy
public void setVideoChangeFrameRateStrategy(@VideoChangeFrameRateStrategy int videoChangeFrameRateStrategy)
Deprecated.Description copied from interface:ExoPlayer
Sets aC.VideoChangeFrameRateStrategy
that will be used by the player when provided with a video outputSurface
.The strategy only applies if a
MediaCodec
-based videoRenderer
is enabled. Applications wishing to useSurface.CHANGE_FRAME_RATE_ALWAYS
should set the mode toC.VIDEO_CHANGE_FRAME_RATE_STRATEGY_OFF
to disable calls toSurface.setFrameRate(float, int, int)
from ExoPlayer, and should then callSurface.setFrameRate(float, int, int)
directly from application code.- Specified by:
setVideoChangeFrameRateStrategy
in interfaceExoPlayer
- Specified by:
setVideoChangeFrameRateStrategy
in interfaceExoPlayer.VideoComponent
- Parameters:
videoChangeFrameRateStrategy
- AC.VideoChangeFrameRateStrategy
.
-
getVideoChangeFrameRateStrategy
@VideoChangeFrameRateStrategy public int getVideoChangeFrameRateStrategy()
Deprecated.Description copied from interface:ExoPlayer
Returns theC.VideoChangeFrameRateStrategy
.- Specified by:
getVideoChangeFrameRateStrategy
in interfaceExoPlayer
- Specified by:
getVideoChangeFrameRateStrategy
in interfaceExoPlayer.VideoComponent
-
getVideoSize
public VideoSize 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 video or its size has not been determined yet.- Specified by:
getVideoSize
in interfaceExoPlayer.VideoComponent
- Specified by:
getVideoSize
in interfacePlayer
- See Also:
Player.Listener.onVideoSizeChanged(VideoSize)
-
clearVideoSurface
public void clearVideoSurface()
Deprecated.Description copied from interface:Player
- Specified by:
clearVideoSurface
in interfaceExoPlayer.VideoComponent
- Specified by:
clearVideoSurface
in interfacePlayer
-
clearVideoSurface
public void clearVideoSurface(@Nullable Surface surface)
Deprecated.Description copied from interface:Player
Clears theSurface
onto which video is being rendered if it matches the one passed. Else does nothing.- Specified by:
clearVideoSurface
in interfaceExoPlayer.VideoComponent
- Specified by:
clearVideoSurface
in interfacePlayer
- Parameters:
surface
- The surface to clear.
-
setVideoSurface
public void setVideoSurface(@Nullable Surface surface)
Deprecated.Description copied from interface:Player
Sets theSurface
onto which video will be rendered. The caller is responsible for tracking the lifecycle of the surface, and must clear the surface by callingsetVideoSurface(null)
if the surface is destroyed.If the surface is held by a
SurfaceView
,TextureView
orSurfaceHolder
then it's recommended to usePlayer.setVideoSurfaceView(SurfaceView)
,Player.setVideoTextureView(TextureView)
orPlayer.setVideoSurfaceHolder(SurfaceHolder)
rather than this method, since passing the holder allows the player to track the lifecycle of the surface automatically.- Specified by:
setVideoSurface
in interfaceExoPlayer.VideoComponent
- Specified by:
setVideoSurface
in interfacePlayer
- Parameters:
surface
- TheSurface
.
-
setVideoSurfaceHolder
public void setVideoSurfaceHolder(@Nullable SurfaceHolder surfaceHolder)
Deprecated.Description copied from interface:Player
Sets theSurfaceHolder
that holds theSurface
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 withPlayer.getApplicationLooper()
.- Specified by:
setVideoSurfaceHolder
in interfaceExoPlayer.VideoComponent
- Specified by:
setVideoSurfaceHolder
in interfacePlayer
- Parameters:
surfaceHolder
- The surface holder.
-
clearVideoSurfaceHolder
public void clearVideoSurfaceHolder(@Nullable SurfaceHolder surfaceHolder)
Deprecated.Description copied from interface:Player
Clears theSurfaceHolder
that holds theSurface
onto which video is being rendered if it matches the one passed. Else does nothing.- Specified by:
clearVideoSurfaceHolder
in interfaceExoPlayer.VideoComponent
- Specified by:
clearVideoSurfaceHolder
in interfacePlayer
- Parameters:
surfaceHolder
- The surface holder to clear.
-
setVideoSurfaceView
public void setVideoSurfaceView(@Nullable SurfaceView surfaceView)
Deprecated.Description copied from interface:Player
Sets theSurfaceView
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 withPlayer.getApplicationLooper()
.- Specified by:
setVideoSurfaceView
in interfaceExoPlayer.VideoComponent
- Specified by:
setVideoSurfaceView
in interfacePlayer
- Parameters:
surfaceView
- The surface view.
-
clearVideoSurfaceView
public void clearVideoSurfaceView(@Nullable SurfaceView surfaceView)
Deprecated.Description copied from interface:Player
Clears theSurfaceView
onto which video is being rendered if it matches the one passed. Else does nothing.- Specified by:
clearVideoSurfaceView
in interfaceExoPlayer.VideoComponent
- Specified by:
clearVideoSurfaceView
in interfacePlayer
- Parameters:
surfaceView
- The texture view to clear.
-
setVideoTextureView
public void setVideoTextureView(@Nullable TextureView textureView)
Deprecated.Description copied from interface:Player
Sets theTextureView
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 withPlayer.getApplicationLooper()
.- Specified by:
setVideoTextureView
in interfaceExoPlayer.VideoComponent
- Specified by:
setVideoTextureView
in interfacePlayer
- Parameters:
textureView
- The texture view.
-
clearVideoTextureView
public void clearVideoTextureView(@Nullable TextureView textureView)
Deprecated.Description copied from interface:Player
Clears theTextureView
onto which video is being rendered if it matches the one passed. Else does nothing.- Specified by:
clearVideoTextureView
in interfaceExoPlayer.VideoComponent
- Specified by:
clearVideoTextureView
in interfacePlayer
- Parameters:
textureView
- The texture view to clear.
-
addAudioOffloadListener
public void addAudioOffloadListener(ExoPlayer.AudioOffloadListener listener)
Deprecated.Description copied from interface:ExoPlayer
Adds a listener to receive audio offload events.- Specified by:
addAudioOffloadListener
in interfaceExoPlayer
- Parameters:
listener
- The listener to register.
-
removeAudioOffloadListener
public void removeAudioOffloadListener(ExoPlayer.AudioOffloadListener listener)
Deprecated.Description copied from interface:ExoPlayer
Removes a listener of audio offload events.- Specified by:
removeAudioOffloadListener
in interfaceExoPlayer
- Parameters:
listener
- The listener to unregister.
-
setAudioAttributes
public void setAudioAttributes(AudioAttributes 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 beC.USAGE_MEDIA
orC.USAGE_GAME
. Other usages will throw anIllegalArgumentException
.- Specified by:
setAudioAttributes
in interfaceExoPlayer
- Specified by:
setAudioAttributes
in interfaceExoPlayer.AudioComponent
- Parameters:
audioAttributes
- The attributes to use for audio playback.handleAudioFocus
- True if the player should handle audio focus, false otherwise.
-
getAudioAttributes
public AudioAttributes getAudioAttributes()
Deprecated.Description copied from interface:Player
Returns the attributes for audio playback.- Specified by:
getAudioAttributes
in interfaceExoPlayer.AudioComponent
- Specified by:
getAudioAttributes
in interfacePlayer
-
setAudioSessionId
public void setAudioSessionId(int audioSessionId)
Deprecated.Description copied from interface:ExoPlayer
Sets the ID of the audio session to attach to the underlyingAudioTrack
.The audio session ID can be generated using
Util.generateAudioSessionIdV21(Context)
for API 21+.- Specified by:
setAudioSessionId
in interfaceExoPlayer
- Specified by:
setAudioSessionId
in interfaceExoPlayer.AudioComponent
- Parameters:
audioSessionId
- The audio session ID, orC.AUDIO_SESSION_ID_UNSET
if it should be generated by the framework.
-
getAudioSessionId
public int getAudioSessionId()
Deprecated.Description copied from interface:ExoPlayer
Returns the audio session identifier, orC.AUDIO_SESSION_ID_UNSET
if not set.- Specified by:
getAudioSessionId
in interfaceExoPlayer
- Specified by:
getAudioSessionId
in interfaceExoPlayer.AudioComponent
-
setAuxEffectInfo
public void setAuxEffectInfo(AuxEffectInfo 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 interfaceExoPlayer
- Specified by:
setAuxEffectInfo
in interfaceExoPlayer.AudioComponent
-
clearAuxEffectInfo
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 interfaceExoPlayer
- Specified by:
clearAuxEffectInfo
in interfaceExoPlayer.AudioComponent
-
setVolume
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.- Specified by:
setVolume
in interfaceExoPlayer.AudioComponent
- Specified by:
setVolume
in interfacePlayer
- Parameters:
volume
- Linear output gain to apply to all audio channels.
-
getVolume
public float getVolume()
Deprecated.Description copied from interface:Player
Returns the audio volume, with 0 being silence and 1 being unity gain (signal unchanged).- Specified by:
getVolume
in interfaceExoPlayer.AudioComponent
- Specified by:
getVolume
in interfacePlayer
- Returns:
- The linear gain applied to all audio channels.
-
getSkipSilenceEnabled
public boolean getSkipSilenceEnabled()
Deprecated.Description copied from interface:ExoPlayer
Returns whether skipping silences in the audio stream is enabled.- Specified by:
getSkipSilenceEnabled
in interfaceExoPlayer
- Specified by:
getSkipSilenceEnabled
in interfaceExoPlayer.AudioComponent
-
setSkipSilenceEnabled
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 interfaceExoPlayer
- Specified by:
setSkipSilenceEnabled
in interfaceExoPlayer.AudioComponent
- Parameters:
skipSilenceEnabled
- Whether skipping silences in the audio stream is enabled.
-
getAnalyticsCollector
public AnalyticsCollector getAnalyticsCollector()
Deprecated.Description copied from interface:ExoPlayer
Returns theAnalyticsCollector
used for collecting analytics events.- Specified by:
getAnalyticsCollector
in interfaceExoPlayer
-
addAnalyticsListener
public void addAnalyticsListener(AnalyticsListener listener)
Deprecated.Description copied from interface:ExoPlayer
Adds anAnalyticsListener
to receive analytics events.- Specified by:
addAnalyticsListener
in interfaceExoPlayer
- Parameters:
listener
- The listener to be added.
-
removeAnalyticsListener
public void removeAnalyticsListener(AnalyticsListener listener)
Deprecated.Description copied from interface:ExoPlayer
Removes anAnalyticsListener
.- Specified by:
removeAnalyticsListener
in interfaceExoPlayer
- Parameters:
listener
- The listener to be removed.
-
setHandleAudioBecomingNoisy
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 interfaceExoPlayer
- Parameters:
handleAudioBecomingNoisy
- Whether the player should pause automatically when audio is rerouted from a headset to device speakers.
-
setPriorityTaskManager
public void setPriorityTaskManager(@Nullable PriorityTaskManager priorityTaskManager)
Deprecated.Description copied from interface:ExoPlayer
Sets aPriorityTaskManager
, 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 interfaceExoPlayer
- Parameters:
priorityTaskManager
- ThePriorityTaskManager
, or null to clear a previously set priority task manager.
-
getVideoFormat
@Nullable public Format 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 interfaceExoPlayer
-
getAudioFormat
@Nullable public Format 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 interfaceExoPlayer
-
getVideoDecoderCounters
@Nullable public DecoderCounters getVideoDecoderCounters()
Deprecated.Description copied from interface:ExoPlayer
ReturnsDecoderCounters
for video, or null if no video is being played.- Specified by:
getVideoDecoderCounters
in interfaceExoPlayer
-
getAudioDecoderCounters
@Nullable public DecoderCounters getAudioDecoderCounters()
Deprecated.Description copied from interface:ExoPlayer
ReturnsDecoderCounters
for audio, or null if no audio is being played.- Specified by:
getAudioDecoderCounters
in interfaceExoPlayer
-
setVideoFrameMetadataListener
public void setVideoFrameMetadataListener(VideoFrameMetadataListener 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 interfaceExoPlayer
- Specified by:
setVideoFrameMetadataListener
in interfaceExoPlayer.VideoComponent
- Parameters:
listener
- The listener.
-
clearVideoFrameMetadataListener
public void clearVideoFrameMetadataListener(VideoFrameMetadataListener 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 interfaceExoPlayer
- Specified by:
clearVideoFrameMetadataListener
in interfaceExoPlayer.VideoComponent
- Parameters:
listener
- The listener to clear.
-
setCameraMotionListener
public void setCameraMotionListener(CameraMotionListener listener)
Deprecated.Description copied from interface:ExoPlayer
Sets a listener of camera motion events.- Specified by:
setCameraMotionListener
in interfaceExoPlayer
- Specified by:
setCameraMotionListener
in interfaceExoPlayer.VideoComponent
- Parameters:
listener
- The listener.
-
clearCameraMotionListener
public void clearCameraMotionListener(CameraMotionListener 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 interfaceExoPlayer
- Specified by:
clearCameraMotionListener
in interfaceExoPlayer.VideoComponent
- Parameters:
listener
- The listener to clear.
-
getCurrentCues
public List<Cue> getCurrentCues()
Deprecated.Description copied from interface:Player
Returns the currentCues
. This list may be empty.- Specified by:
getCurrentCues
in interfaceExoPlayer.TextComponent
- Specified by:
getCurrentCues
in interfacePlayer
-
getPlaybackLooper
public Looper getPlaybackLooper()
Deprecated.Description copied from interface:ExoPlayer
Returns theLooper
associated with the playback thread.- Specified by:
getPlaybackLooper
in interfaceExoPlayer
-
getApplicationLooper
public Looper getApplicationLooper()
Deprecated.Description copied from interface:Player
Returns theLooper
associated with the application thread that's used to access the player and on which player events are received.- Specified by:
getApplicationLooper
in interfacePlayer
-
getClock
public Clock getClock()
Deprecated.Description copied from interface:ExoPlayer
Returns theClock
used for playback.
-
addListener
public void addListener(Player.Listener 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()
.- Specified by:
addListener
in interfacePlayer
- Parameters:
listener
- The listener to register.
-
addListener
@Deprecated public void addListener(Player.EventListener listener)
Deprecated.Description copied from interface:ExoPlayer
Registers a listener to receive events from the player.The listener's methods will be called on the thread associated with
Player.getApplicationLooper()
.- Specified by:
addListener
in interfaceExoPlayer
- Parameters:
listener
- The listener to register.
-
removeListener
public void removeListener(Player.Listener listener)
Deprecated.Description copied from interface:Player
Unregister a listener registered throughPlayer.addListener(Listener)
. The listener will no longer receive events.- Specified by:
removeListener
in interfacePlayer
- Parameters:
listener
- The listener to unregister.
-
removeListener
@Deprecated public void removeListener(Player.EventListener listener)
Deprecated.Description copied from interface:ExoPlayer
Unregister a listener registered throughExoPlayer.addListener(EventListener)
. The listener will no longer receive events from the player.- Specified by:
removeListener
in interfaceExoPlayer
- Parameters:
listener
- The listener to unregister.
-
getPlaybackState
@State public @com.google.android.exoplayer2.Player.State int getPlaybackState()
Deprecated.Description copied from interface:Player
Returns the currentplayback state
of the player.- Specified by:
getPlaybackState
in interfacePlayer
- Returns:
- The current
playback state
. - See Also:
Player.Listener.onPlaybackStateChanged(int)
-
getPlaybackSuppressionReason
@PlaybackSuppressionReason public @com.google.android.exoplayer2.Player.PlaybackSuppressionReason int getPlaybackSuppressionReason()
Deprecated.Description copied from interface:Player
Returns the reason why playback is suppressed even thoughPlayer.getPlayWhenReady()
istrue
, orPlayer.PLAYBACK_SUPPRESSION_REASON_NONE
if playback is not suppressed.- Specified by:
getPlaybackSuppressionReason
in interfacePlayer
- Returns:
- The current
playback suppression reason
. - See Also:
Player.Listener.onPlaybackSuppressionReasonChanged(int)
-
getPlayerError
@Nullable public ExoPlaybackException getPlayerError()
Deprecated.Description copied from interface:ExoPlayer
Equivalent toPlayer.getPlayerError()
, except the exception is guaranteed to be anExoPlaybackException
.- Specified by:
getPlayerError
in interfaceExoPlayer
- Specified by:
getPlayerError
in interfacePlayer
- Returns:
- The error, or
null
. - See Also:
Player.Listener.onPlayerError(PlaybackException)
-
retry
@Deprecated public void retry()
Deprecated.Useprepare()
instead.
-
getAvailableCommands
public Player.Commands getAvailableCommands()
Deprecated.Description copied from interface:Player
Returns the player's currently availablePlayer.Commands
.The returned
Player.Commands
are not updated when available commands change. UsePlayer.Listener.onAvailableCommandsChanged(Commands)
to get an update when the available commands change.Executing a command that is not available (for example, calling
Player.seekToNextMediaItem()
ifPlayer.COMMAND_SEEK_TO_NEXT_MEDIA_ITEM
is unavailable) will neither throw an exception nor generate aPlayer.getPlayerError()
player error}.Player.COMMAND_SEEK_TO_PREVIOUS_MEDIA_ITEM
andPlayer.COMMAND_SEEK_TO_NEXT_MEDIA_ITEM
are unavailable if there is no suchMediaItem
.- Specified by:
getAvailableCommands
in interfacePlayer
- Returns:
- The currently available
Player.Commands
. - See Also:
Player.Listener.onAvailableCommandsChanged(com.google.android.exoplayer2.Player.Commands)
-
prepare
public void prepare()
Deprecated.Description copied from interface:Player
Prepares the player.This will move the player out of
idle state
and the player will start loading media and acquire resources needed for playback.
-
prepare
@Deprecated public void prepare(MediaSource mediaSource)
Deprecated.UsesetMediaSource(MediaSource)
andPlayer.prepare()
instead.
-
prepare
@Deprecated public void prepare(MediaSource mediaSource, boolean resetPosition, boolean resetState)
Deprecated.UsesetMediaSource(MediaSource, boolean)
andPlayer.prepare()
instead.
-
setMediaItems
public void setMediaItems(List<MediaItem> mediaItems, boolean resetPosition)
Deprecated.Description copied from interface:Player
Clears the playlist and adds the specifiedMediaItems
.- Specified by:
setMediaItems
in interfacePlayer
- Parameters:
mediaItems
- The newMediaItems
.resetPosition
- Whether the playback position should be reset to the default position in the firstTimeline.Window
. If false, playback will start from the position defined byPlayer.getCurrentMediaItemIndex()
andPlayer.getCurrentPosition()
.
-
setMediaItems
public void setMediaItems(List<MediaItem> mediaItems, int startIndex, long startPositionMs)
Deprecated.Description copied from interface:Player
Clears the playlist and adds the specifiedMediaItems
.- Specified by:
setMediaItems
in interfacePlayer
- Parameters:
mediaItems
- The newMediaItems
.startIndex
- TheMediaItem
index to start playback from. IfC.INDEX_UNSET
is passed, the current position is not reset.startPositionMs
- The position in milliseconds to start playback from. IfC.TIME_UNSET
is passed, the default position of the givenMediaItem
is used. In any case, ifstartIndex
is set toC.INDEX_UNSET
, this parameter is ignored and the position is not reset at all.
-
setMediaSources
public void setMediaSources(List<MediaSource> mediaSources)
Deprecated.Description copied from interface:ExoPlayer
Clears the playlist, adds the specifiedMediaSources
and resets the position to the default position.- Specified by:
setMediaSources
in interfaceExoPlayer
- Parameters:
mediaSources
- The newMediaSources
.
-
setMediaSources
public void setMediaSources(List<MediaSource> mediaSources, boolean resetPosition)
Deprecated.Description copied from interface:ExoPlayer
Clears the playlist and adds the specifiedMediaSources
.- Specified by:
setMediaSources
in interfaceExoPlayer
- Parameters:
mediaSources
- The newMediaSources
.resetPosition
- Whether the playback position should be reset to the default position in the firstTimeline.Window
. If false, playback will start from the position defined byPlayer.getCurrentMediaItemIndex()
andPlayer.getCurrentPosition()
.
-
setMediaSources
public void setMediaSources(List<MediaSource> mediaSources, int startMediaItemIndex, long startPositionMs)
Deprecated.Description copied from interface:ExoPlayer
Clears the playlist and adds the specifiedMediaSources
.- Specified by:
setMediaSources
in interfaceExoPlayer
- Parameters:
mediaSources
- The newMediaSources
.startMediaItemIndex
- The media item index to start playback from. IfC.INDEX_UNSET
is passed, the current position is not reset.startPositionMs
- The position in milliseconds to start playback from. IfC.TIME_UNSET
is passed, the default position of the given media item is used. In any case, ifstartMediaItemIndex
is set toC.INDEX_UNSET
, this parameter is ignored and the position is not reset at all.
-
setMediaSource
public void setMediaSource(MediaSource mediaSource)
Deprecated.Description copied from interface:ExoPlayer
Clears the playlist, adds the specifiedMediaSource
and resets the position to the default position.- Specified by:
setMediaSource
in interfaceExoPlayer
- Parameters:
mediaSource
- The newMediaSource
.
-
setMediaSource
public void setMediaSource(MediaSource mediaSource, boolean resetPosition)
Deprecated.Description copied from interface:ExoPlayer
Clears the playlist and adds the specifiedMediaSource
.- Specified by:
setMediaSource
in interfaceExoPlayer
- Parameters:
mediaSource
- The newMediaSource
.resetPosition
- Whether the playback position should be reset to the default position. If false, playback will start from the position defined byPlayer.getCurrentMediaItemIndex()
andPlayer.getCurrentPosition()
.
-
setMediaSource
public void setMediaSource(MediaSource mediaSource, long startPositionMs)
Deprecated.Description copied from interface:ExoPlayer
Clears the playlist and adds the specifiedMediaSource
.- Specified by:
setMediaSource
in interfaceExoPlayer
- Parameters:
mediaSource
- The newMediaSource
.startPositionMs
- The position in milliseconds to start playback from.
-
addMediaItems
public void addMediaItems(int index, List<MediaItem> mediaItems)
Deprecated.Description copied from interface:Player
Adds a list of media items at the given index of the playlist.- Specified by:
addMediaItems
in interfacePlayer
- Parameters:
index
- The index at which to add the media items. If the index is larger than the size of the playlist, the media items are added to the end of the playlist.mediaItems
- TheMediaItems
to add.
-
addMediaSource
public void addMediaSource(MediaSource mediaSource)
Deprecated.Description copied from interface:ExoPlayer
Adds a media source to the end of the playlist.- Specified by:
addMediaSource
in interfaceExoPlayer
- Parameters:
mediaSource
- TheMediaSource
to add.
-
addMediaSource
public void addMediaSource(int index, MediaSource mediaSource)
Deprecated.Description copied from interface:ExoPlayer
Adds a media source at the given index of the playlist.- Specified by:
addMediaSource
in interfaceExoPlayer
- Parameters:
index
- The index at which to add the source.mediaSource
- TheMediaSource
to add.
-
addMediaSources
public void addMediaSources(List<MediaSource> mediaSources)
Deprecated.Description copied from interface:ExoPlayer
Adds a list of media sources to the end of the playlist.- Specified by:
addMediaSources
in interfaceExoPlayer
- Parameters:
mediaSources
- TheMediaSources
to add.
-
addMediaSources
public void addMediaSources(int index, List<MediaSource> mediaSources)
Deprecated.Description copied from interface:ExoPlayer
Adds a list of media sources at the given index of the playlist.- Specified by:
addMediaSources
in interfaceExoPlayer
- Parameters:
index
- The index at which to add the media sources.mediaSources
- TheMediaSources
to add.
-
moveMediaItems
public void moveMediaItems(int fromIndex, int toIndex, int newIndex)
Deprecated.Description copied from interface:Player
Moves the media item range to the new index.- Specified by:
moveMediaItems
in interfacePlayer
- Parameters:
fromIndex
- The start of the range to move.toIndex
- The first item not to be included in the range (exclusive).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.
-
removeMediaItems
public void removeMediaItems(int fromIndex, int toIndex)
Deprecated.Description copied from interface:Player
Removes a range of media items from the playlist.- Specified by:
removeMediaItems
in interfacePlayer
- Parameters:
fromIndex
- The index at which to start removing media items.toIndex
- The index of the first item to be kept (exclusive). If the index is larger than the size of the playlist, media items to the end of the playlist are removed.
-
setShuffleOrder
public void setShuffleOrder(ShuffleOrder shuffleOrder)
Deprecated.Description copied from interface:ExoPlayer
Sets the shuffle order.- Specified by:
setShuffleOrder
in interfaceExoPlayer
- Parameters:
shuffleOrder
- The shuffle order.
-
setPlayWhenReady
public void setPlayWhenReady(boolean playWhenReady)
Deprecated.Description copied from interface:Player
Sets whether playback should proceed whenPlayer.getPlaybackState()
==Player.STATE_READY
.If the player is already in the ready state then this method pauses and resumes playback.
- Specified by:
setPlayWhenReady
in interfacePlayer
- Parameters:
playWhenReady
- Whether playback should proceed when ready.
-
getPlayWhenReady
public boolean getPlayWhenReady()
Deprecated.Description copied from interface:Player
Whether playback will proceed whenPlayer.getPlaybackState()
==Player.STATE_READY
.- Specified by:
getPlayWhenReady
in interfacePlayer
- Returns:
- Whether playback will proceed when ready.
- See Also:
Player.Listener.onPlayWhenReadyChanged(boolean, int)
-
setPauseAtEndOfMediaItems
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 toPlayer.Listener.onPlayWhenReadyChanged(boolean, int)
with the reasonPlayer.PLAY_WHEN_READY_CHANGE_REASON_END_OF_MEDIA_ITEM
when this happens.- Specified by:
setPauseAtEndOfMediaItems
in interfaceExoPlayer
- Parameters:
pauseAtEndOfMediaItems
- Whether to pause playback at the end of each media item.
-
getPauseAtEndOfMediaItems
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 interfaceExoPlayer
- See Also:
ExoPlayer.setPauseAtEndOfMediaItems(boolean)
-
getRepeatMode
@RepeatMode public @com.google.android.exoplayer2.Player.RepeatMode int getRepeatMode()
Deprecated.Description copied from interface:Player
Returns the currentPlayer.RepeatMode
used for playback.- Specified by:
getRepeatMode
in interfacePlayer
- Returns:
- The current repeat mode.
- See Also:
Player.Listener.onRepeatModeChanged(int)
-
setRepeatMode
public void setRepeatMode(@RepeatMode @com.google.android.exoplayer2.Player.RepeatMode int repeatMode)
Deprecated.Description copied from interface:Player
Sets thePlayer.RepeatMode
to be used for playback.- Specified by:
setRepeatMode
in interfacePlayer
- Parameters:
repeatMode
- The repeat mode.
-
setShuffleModeEnabled
public void setShuffleModeEnabled(boolean shuffleModeEnabled)
Deprecated.Description copied from interface:Player
Sets whether shuffling of media items is enabled.- Specified by:
setShuffleModeEnabled
in interfacePlayer
- Parameters:
shuffleModeEnabled
- Whether shuffling is enabled.
-
getShuffleModeEnabled
public boolean getShuffleModeEnabled()
Deprecated.Description copied from interface:Player
Returns whether shuffling of media items is enabled.- Specified by:
getShuffleModeEnabled
in interfacePlayer
- See Also:
Player.Listener.onShuffleModeEnabledChanged(boolean)
-
isLoading
public boolean isLoading()
Deprecated.Description copied from interface:Player
Whether the player is currently loading the source.- Specified by:
isLoading
in interfacePlayer
- Returns:
- Whether the player is currently loading the source.
- See Also:
Player.Listener.onIsLoadingChanged(boolean)
-
seekTo
public void seekTo(int mediaItemIndex, long positionMs)
Deprecated.Description copied from interface:Player
Seeks to a position specified in milliseconds in the specifiedMediaItem
.- Specified by:
seekTo
in interfacePlayer
- Parameters:
mediaItemIndex
- The index of theMediaItem
.positionMs
- The seek position in the specifiedMediaItem
, orC.TIME_UNSET
to seek to the media item's default position.
-
getSeekBackIncrement
public long getSeekBackIncrement()
Deprecated.Description copied from interface:Player
Returns thePlayer.seekBack()
increment.- Specified by:
getSeekBackIncrement
in interfacePlayer
- Returns:
- The seek back increment, in milliseconds.
- See Also:
Player.Listener.onSeekBackIncrementChanged(long)
-
getSeekForwardIncrement
public long getSeekForwardIncrement()
Deprecated.Description copied from interface:Player
Returns thePlayer.seekForward()
increment.- Specified by:
getSeekForwardIncrement
in interfacePlayer
- Returns:
- The seek forward increment, in milliseconds.
- See Also:
Player.Listener.onSeekForwardIncrementChanged(long)
-
getMaxSeekToPreviousPosition
public long getMaxSeekToPreviousPosition()
Deprecated.Description copied from interface:Player
Returns the maximum position for whichPlayer.seekToPrevious()
seeks to the previousMediaItem
, in milliseconds.- Specified by:
getMaxSeekToPreviousPosition
in interfacePlayer
- Returns:
- The maximum seek to previous position, in milliseconds.
- See Also:
Player.EventListener.onMaxSeekToPreviousPositionChanged(long)
-
setPlaybackParameters
public void setPlaybackParameters(PlaybackParameters playbackParameters)
Deprecated.Description copied from interface:Player
Attempts to set the playback parameters. PassingPlaybackParameters.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.- Specified by:
setPlaybackParameters
in interfacePlayer
- Parameters:
playbackParameters
- The playback parameters.
-
getPlaybackParameters
public PlaybackParameters getPlaybackParameters()
Deprecated.Description copied from interface:Player
Returns the currently active playback parameters.- Specified by:
getPlaybackParameters
in interfacePlayer
- See Also:
Player.Listener.onPlaybackParametersChanged(PlaybackParameters)
-
setSeekParameters
public void setSeekParameters(@Nullable SeekParameters seekParameters)
Deprecated.Description copied from interface:ExoPlayer
Sets the parameters that control how seek operations are performed.- Specified by:
setSeekParameters
in interfaceExoPlayer
- Parameters:
seekParameters
- The seek parameters, ornull
to use the defaults.
-
getSeekParameters
public SeekParameters getSeekParameters()
Deprecated.Description copied from interface:ExoPlayer
Returns the currently activeSeekParameters
of the player.- Specified by:
getSeekParameters
in interfaceExoPlayer
-
setForegroundMode
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()
is called to halt one playback, andExoPlayer.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 callingExoPlayer.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 interfaceExoPlayer
- Parameters:
foregroundMode
- Whether the player is allowed to keep limited resources even when in the idle state.
-
stop
public void stop()
Deprecated.Description copied from interface:Player
Stops playback without resetting the playlist. UsePlayer.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 callingPlayer.prepare()
again, andPlayer.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.
-
stop
@Deprecated public void stop(boolean reset)
Deprecated.
-
release
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.
-
createMessage
public PlayerMessage createMessage(PlayerMessage.Target target)
Deprecated.Description copied from interface:ExoPlayer
Creates a message that can be sent to aPlayerMessage.Target
. By default, the message will be delivered immediately without blocking on the playback thread. The defaultPlayerMessage.getType()
is 0 and the defaultPlayerMessage.getPayload()
is null. If a position is specified withPlayerMessage.setPosition(long)
, the message will be delivered at this position in the current media item defined byPlayer.getCurrentMediaItemIndex()
. Alternatively, the message can be sent at a specific mediaItem usingPlayerMessage.setPosition(int, long)
.- Specified by:
createMessage
in interfaceExoPlayer
-
getRendererCount
public int getRendererCount()
Deprecated.Description copied from interface:ExoPlayer
Returns the number of renderers.- Specified by:
getRendererCount
in interfaceExoPlayer
-
getRendererType
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 returnC.TRACK_TYPE_AUDIO
and a text renderer will returnC.TRACK_TYPE_TEXT
.- Specified by:
getRendererType
in interfaceExoPlayer
- Parameters:
index
- The index of the renderer.- Returns:
- The
track type
that the renderer handles.
-
getTrackSelector
@Nullable public TrackSelector 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 interfaceExoPlayer
-
getCurrentTrackGroups
public TrackGroupArray getCurrentTrackGroups()
Deprecated.Description copied from interface:Player
Returns the available track groups.- Specified by:
getCurrentTrackGroups
in interfacePlayer
- See Also:
Player.EventListener.onTracksChanged(TrackGroupArray, TrackSelectionArray)
-
getCurrentTrackSelections
public TrackSelectionArray getCurrentTrackSelections()
Deprecated.Description copied from interface:Player
Returns the current track selections.A concrete implementation may include null elements if it has a fixed number of renderer components, wishes to report a TrackSelection for each of them, and has one or more renderer components that is not assigned any selected tracks.
- Specified by:
getCurrentTrackSelections
in interfacePlayer
- See Also:
Player.EventListener.onTracksChanged(TrackGroupArray, TrackSelectionArray)
-
getCurrentTracksInfo
public TracksInfo getCurrentTracksInfo()
Deprecated.Description copied from interface:Player
Returns the available tracks, as well as the tracks' support, type, and selection status.- Specified by:
getCurrentTracksInfo
in interfacePlayer
- See Also:
Player.EventListener.onTracksChanged(TrackGroupArray, TrackSelectionArray)
-
getTrackSelectionParameters
public TrackSelectionParameters getTrackSelectionParameters()
Deprecated.Description copied from interface:Player
Returns the parameters constraining the track selection.- Specified by:
getTrackSelectionParameters
in interfacePlayer
- See Also:
}
-
setTrackSelectionParameters
public void setTrackSelectionParameters(TrackSelectionParameters 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())
- Specified by:
setTrackSelectionParameters
in interfacePlayer
-
getMediaMetadata
public MediaMetadata getMediaMetadata()
Deprecated.Description copied from interface:Player
Returns the current combinedMediaMetadata
, orMediaMetadata.EMPTY
if not supported.This
MediaMetadata
is a combination of theMediaItem.mediaMetadata
and the static and dynamic metadata from thetrack selections' formats
andPlayer.Listener.onMetadata(Metadata)
. If a field is populated in theMediaItem.mediaMetadata
, it will be prioritised above the same field coming from static or dynamic metadata.- Specified by:
getMediaMetadata
in interfacePlayer
-
getPlaylistMetadata
public MediaMetadata getPlaylistMetadata()
Deprecated.Description copied from interface:Player
Returns the playlistMediaMetadata
, as set byPlayer.setPlaylistMetadata(MediaMetadata)
, orMediaMetadata.EMPTY
if not supported.- Specified by:
getPlaylistMetadata
in interfacePlayer
-
setPlaylistMetadata
public void setPlaylistMetadata(MediaMetadata mediaMetadata)
Deprecated.Description copied from interface:Player
Sets the playlistMediaMetadata
.- Specified by:
setPlaylistMetadata
in interfacePlayer
-
getCurrentTimeline
public Timeline getCurrentTimeline()
Deprecated.Description copied from interface:Player
Returns the currentTimeline
. Never null, but may be empty.- Specified by:
getCurrentTimeline
in interfacePlayer
- See Also:
Player.Listener.onTimelineChanged(Timeline, int)
-
getCurrentPeriodIndex
public int getCurrentPeriodIndex()
Deprecated.Description copied from interface:Player
Returns the index of the period currently being played.- Specified by:
getCurrentPeriodIndex
in interfacePlayer
-
getCurrentMediaItemIndex
public int getCurrentMediaItemIndex()
Deprecated.Description copied from interface:Player
Returns the index of the currentMediaItem
in thetimeline
, or the prospective index if thecurrent timeline
is empty.- Specified by:
getCurrentMediaItemIndex
in interfacePlayer
-
getDuration
public long getDuration()
Deprecated.Description copied from interface:Player
Returns the duration of the current content or ad in milliseconds, orC.TIME_UNSET
if the duration is not known.- Specified by:
getDuration
in interfacePlayer
-
getCurrentPosition
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 thecurrent timeline
is empty.- Specified by:
getCurrentPosition
in interfacePlayer
-
getBufferedPosition
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.- Specified by:
getBufferedPosition
in interfacePlayer
-
getTotalBufferedDuration
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 andmedia items
.- Specified by:
getTotalBufferedDuration
in interfacePlayer
-
isPlayingAd
public boolean isPlayingAd()
Deprecated.Description copied from interface:Player
Returns whether the player is currently playing an ad.- Specified by:
isPlayingAd
in interfacePlayer
-
getCurrentAdGroupIndex
public int getCurrentAdGroupIndex()
Deprecated.Description copied from interface:Player
IfPlayer.isPlayingAd()
returns true, returns the index of the ad group in the period currently being played. ReturnsC.INDEX_UNSET
otherwise.- Specified by:
getCurrentAdGroupIndex
in interfacePlayer
-
getCurrentAdIndexInAdGroup
public int getCurrentAdIndexInAdGroup()
Deprecated.Description copied from interface:Player
IfPlayer.isPlayingAd()
returns true, returns the index of the ad in its ad group. ReturnsC.INDEX_UNSET
otherwise.- Specified by:
getCurrentAdIndexInAdGroup
in interfacePlayer
-
getContentPosition
public long getContentPosition()
Deprecated.Description copied from interface:Player
IfPlayer.isPlayingAd()
returnstrue
, 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 byPlayer.getCurrentPosition()
.- Specified by:
getContentPosition
in interfacePlayer
-
getContentBufferedPosition
public long getContentBufferedPosition()
Deprecated.Description copied from interface:Player
IfPlayer.isPlayingAd()
returnstrue
, 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 byPlayer.getBufferedPosition()
.- Specified by:
getContentBufferedPosition
in interfacePlayer
-
setHandleWakeLock
@Deprecated public void setHandleWakeLock(boolean handleWakeLock)
Deprecated.- Specified by:
setHandleWakeLock
in interfaceExoPlayer
-
setWakeMode
public void setWakeMode(@WakeMode @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 foregroundService
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 thePlayer.STATE_READY
orPlayer.STATE_BUFFERING
states withplayWhenReady = true
. The locks held depends on the specifiedC.WakeMode
.- Specified by:
setWakeMode
in interfaceExoPlayer
- Parameters:
wakeMode
- TheC.WakeMode
option to keep the device awake during playback.
-
getDeviceInfo
public DeviceInfo getDeviceInfo()
Deprecated.Description copied from interface:Player
Gets the device information.- Specified by:
getDeviceInfo
in interfaceExoPlayer.DeviceComponent
- Specified by:
getDeviceInfo
in interfacePlayer
-
getDeviceVolume
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 currentstream type
. The stream type is determined byAudioAttributes.usage
which can be converted to stream type withUtil.getStreamTypeForAudioUsage(int)
.For devices with
remote playback
, the volume of the remote device is returned.- Specified by:
getDeviceVolume
in interfaceExoPlayer.DeviceComponent
- Specified by:
getDeviceVolume
in interfacePlayer
-
isDeviceMuted
public boolean isDeviceMuted()
Deprecated.Description copied from interface:Player
Gets whether the device is muted or not.- Specified by:
isDeviceMuted
in interfaceExoPlayer.DeviceComponent
- Specified by:
isDeviceMuted
in interfacePlayer
-
setDeviceVolume
public void setDeviceVolume(int volume)
Deprecated.Description copied from interface:Player
Sets the volume of the device.- Specified by:
setDeviceVolume
in interfaceExoPlayer.DeviceComponent
- Specified by:
setDeviceVolume
in interfacePlayer
- Parameters:
volume
- The volume to set.
-
increaseDeviceVolume
public void increaseDeviceVolume()
Deprecated.Description copied from interface:Player
Increases the volume of the device.- Specified by:
increaseDeviceVolume
in interfaceExoPlayer.DeviceComponent
- Specified by:
increaseDeviceVolume
in interfacePlayer
-
decreaseDeviceVolume
public void decreaseDeviceVolume()
Deprecated.Description copied from interface:Player
Decreases the volume of the device.- Specified by:
decreaseDeviceVolume
in interfaceExoPlayer.DeviceComponent
- Specified by:
decreaseDeviceVolume
in interfacePlayer
-
setDeviceMuted
public void setDeviceMuted(boolean muted)
Deprecated.Description copied from interface:Player
Sets the mute state of the device.- Specified by:
setDeviceMuted
in interfaceExoPlayer.DeviceComponent
- Specified by:
setDeviceMuted
in interfacePlayer
-
setThrowsWhenUsingWrongThread
@Deprecated public void setThrowsWhenUsingWrongThread(boolean throwsWhenUsingWrongThread)
Deprecated.Description copied from interface:ExoPlayer
Sets whether the player should throw anIllegalStateException
when methods are called from a thread other than the one associated withPlayer.getApplicationLooper()
.The default is
true
and this method will be removed in the future.- Specified by:
setThrowsWhenUsingWrongThread
in interfaceExoPlayer
- Parameters:
throwsWhenUsingWrongThread
- Whether to throw when methods are called from a wrong thread.
-
-