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.UseExoPlayerinstead.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSimpleExoPlayer.BuilderDeprecated.UseExoPlayer.Builderinstead.-
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.Events, Player.Listener, Player.MediaItemTransitionReason, Player.PlaybackSuppressionReason, Player.PlayWhenReadyChangeReason, Player.PositionInfo, Player.RepeatMode, Player.State, Player.TimelineChangeReason
-
-
Field Summary
-
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_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
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedSimpleExoPlayer(Context context, RenderersFactory renderersFactory, TrackSelector trackSelector, MediaSource.Factory mediaSourceFactory, LoadControl loadControl, BandwidthMeter bandwidthMeter, AnalyticsCollector analyticsCollector, boolean useLazyPreparation, Clock clock, Looper applicationLooper)Deprecated.Use theExoPlayer.Builder.protectedSimpleExoPlayer(SimpleExoPlayer.Builder builder)Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaddAnalyticsListener(AnalyticsListener listener)Deprecated.Adds anAnalyticsListenerto receive analytics events.voidaddAudioOffloadListener(ExoPlayer.AudioOffloadListener listener)Deprecated.Adds a listener to receive audio offload events.voidaddListener(Player.Listener listener)Deprecated.Registers a listener to receive all events from the player.voidaddMediaItems(int index, List<MediaItem> mediaItems)Deprecated.Adds a list of media items at the given index of the playlist.voidaddMediaSource(int index, MediaSource mediaSource)Deprecated.Adds a media source at the given index of the playlist.voidaddMediaSource(MediaSource mediaSource)Deprecated.Adds a media source to the end of the playlist.voidaddMediaSources(int index, List<MediaSource> mediaSources)Deprecated.Adds a list of media sources at the given index of the playlist.voidaddMediaSources(List<MediaSource> mediaSources)Deprecated.Adds a list of media sources to the end of the playlist.voidclearAuxEffectInfo()Deprecated.Detaches any previously attached auxiliary audio effect from the underlying audio track.voidclearCameraMotionListener(CameraMotionListener listener)Deprecated.Clears the listener which receives camera motion events if it matches the one passed.voidclearVideoFrameMetadataListener(VideoFrameMetadataListener listener)Deprecated.Clears the listener which receives video frame metadata events if it matches the one passed.voidclearVideoSurface()Deprecated.voidclearVideoSurface(Surface surface)Deprecated.Clears theSurfaceonto which video is being rendered if it matches the one passed.voidclearVideoSurfaceHolder(SurfaceHolder surfaceHolder)Deprecated.Clears theSurfaceHolderthat holds theSurfaceonto which video is being rendered if it matches the one passed.voidclearVideoSurfaceView(SurfaceView surfaceView)Deprecated.Clears theSurfaceViewonto which video is being rendered if it matches the one passed.voidclearVideoTextureView(TextureView textureView)Deprecated.Clears theTextureViewonto which video is being rendered if it matches the one passed.PlayerMessagecreateMessage(PlayerMessage.Target target)Deprecated.Creates a message that can be sent to aPlayerMessage.Target.voiddecreaseDeviceVolume()Deprecated.UsedecreaseDeviceVolume(int)instead.voiddecreaseDeviceVolume(@com.google.android.exoplayer2.C.VolumeFlags int flags)Deprecated.Decreases the volume of the device.booleanexperimentalIsSleepingForOffload()Deprecated.Returns whether the player has paused its main loop to save power in offload scheduling mode.voidexperimentalSetOffloadSchedulingEnabled(boolean offloadSchedulingEnabled)Deprecated.Sets whether audio offload scheduling is enabled.AnalyticsCollectorgetAnalyticsCollector()Deprecated.Returns theAnalyticsCollectorused for collecting analytics events.LoopergetApplicationLooper()Deprecated.Returns theLooperassociated with the application thread that's used to access the player and on which player events are received.AudioAttributesgetAudioAttributes()Deprecated.Returns the attributes for audio playback.ExoPlayer.AudioComponentgetAudioComponent()Deprecated.UseExoPlayer, as theExoPlayer.AudioComponentmethods are defined by that interface.DecoderCountersgetAudioDecoderCounters()Deprecated.ReturnsDecoderCountersfor audio, or null if no audio is being played.FormatgetAudioFormat()Deprecated.Returns the audio format currently being played, or null if no audio is being played.intgetAudioSessionId()Deprecated.Returns the audio session identifier, orC.AUDIO_SESSION_ID_UNSETif not set.Player.CommandsgetAvailableCommands()Deprecated.Returns the player's currently availablePlayer.Commands.longgetBufferedPosition()Deprecated.Returns an estimate of the position in the current content or ad up to which data is buffered, in milliseconds.ClockgetClock()Deprecated.Returns theClockused for playback.longgetContentBufferedPosition()Deprecated.IfPlayer.isPlayingAd()returnstrue, returns an estimate of the content position in the current content up to which data is buffered, in milliseconds.longgetContentPosition()Deprecated.IfPlayer.isPlayingAd()returnstrue, returns the content position that will be played once all ads in the ad group have finished playing, in milliseconds.intgetCurrentAdGroupIndex()Deprecated.IfPlayer.isPlayingAd()returns true, returns the index of the ad group in the period currently being played.intgetCurrentAdIndexInAdGroup()Deprecated.IfPlayer.isPlayingAd()returns true, returns the index of the ad in its ad group.CueGroupgetCurrentCues()Deprecated.Returns the currentCueGroup.intgetCurrentMediaItemIndex()Deprecated.Returns the index of the currentMediaItemin thetimeline, or the prospective index if thecurrent timelineis empty.intgetCurrentPeriodIndex()Deprecated.Returns the index of the period currently being played.longgetCurrentPosition()Deprecated.Returns the playback position in the current content or ad, in milliseconds, or the prospective position in milliseconds if thecurrent timelineis empty.TimelinegetCurrentTimeline()Deprecated.Returns the currentTimeline.TrackGroupArraygetCurrentTrackGroups()Deprecated.UsegetCurrentTracks().TracksgetCurrentTracks()Deprecated.Returns the current tracks.TrackSelectionArraygetCurrentTrackSelections()Deprecated.UsegetCurrentTracks().ExoPlayer.DeviceComponentgetDeviceComponent()Deprecated.UsePlayer, as theExoPlayer.DeviceComponentmethods are defined by that interface.DeviceInfogetDeviceInfo()Deprecated.Gets the device information.intgetDeviceVolume()Deprecated.Gets the current volume of the device.longgetDuration()Deprecated.Returns the duration of the current content or ad in milliseconds, orC.TIME_UNSETif the duration is not known.longgetMaxSeekToPreviousPosition()Deprecated.Returns the maximum position for whichPlayer.seekToPrevious()seeks to the previousMediaItem, in milliseconds.MediaMetadatagetMediaMetadata()Deprecated.Returns the current combinedMediaMetadata, orMediaMetadata.EMPTYif not supported.booleangetPauseAtEndOfMediaItems()Deprecated.Returns whether the player pauses playback at the end of each media item.LoopergetPlaybackLooper()Deprecated.Returns theLooperassociated with the playback thread.PlaybackParametersgetPlaybackParameters()Deprecated.Returns the currently active playback parameters.@com.google.android.exoplayer2.Player.State intgetPlaybackState()Deprecated.Returns the current playback state of the player.@com.google.android.exoplayer2.Player.PlaybackSuppressionReason intgetPlaybackSuppressionReason()Deprecated.Returns the reason why playback is suppressed even thoughPlayer.getPlayWhenReady()istrue, orPlayer.PLAYBACK_SUPPRESSION_REASON_NONEif playback is not suppressed.ExoPlaybackExceptiongetPlayerError()Deprecated.Equivalent toPlayer.getPlayerError(), except the exception is guaranteed to be anExoPlaybackException.MediaMetadatagetPlaylistMetadata()Deprecated.Returns the playlistMediaMetadata, as set byPlayer.setPlaylistMetadata(MediaMetadata), orMediaMetadata.EMPTYif not supported.booleangetPlayWhenReady()Deprecated.Whether playback will proceed whenPlayer.getPlaybackState()==Player.STATE_READY.RenderergetRenderer(int index)Deprecated.Returns the renderer at the given index.intgetRendererCount()Deprecated.Returns the number of renderers.@com.google.android.exoplayer2.C.TrackType intgetRendererType(int index)Deprecated.Returns the track type that the renderer at a given index handles.@com.google.android.exoplayer2.Player.RepeatMode intgetRepeatMode()Deprecated.Returns the currentPlayer.RepeatModeused for playback.longgetSeekBackIncrement()Deprecated.Returns thePlayer.seekBack()increment.longgetSeekForwardIncrement()Deprecated.Returns thePlayer.seekForward()increment.SeekParametersgetSeekParameters()Deprecated.Returns the currently activeSeekParametersof the player.booleangetShuffleModeEnabled()Deprecated.Returns whether shuffling of media items is enabled.booleangetSkipSilenceEnabled()Deprecated.Returns whether skipping silences in the audio stream is enabled.SizegetSurfaceSize()Deprecated.Gets the size of the surface on which the video is rendered.ExoPlayer.TextComponentgetTextComponent()Deprecated.UsePlayer, as theExoPlayer.TextComponentmethods are defined by that interface.longgetTotalBufferedDuration()Deprecated.Returns an estimate of the total buffered duration from the current position, in milliseconds.TrackSelectionParametersgetTrackSelectionParameters()Deprecated.Returns the parameters constraining the track selection.TrackSelectorgetTrackSelector()Deprecated.Returns the track selector that this player uses, or null if track selection is not supported.@com.google.android.exoplayer2.C.VideoChangeFrameRateStrategy intgetVideoChangeFrameRateStrategy()Deprecated.Returns theC.VideoChangeFrameRateStrategy.ExoPlayer.VideoComponentgetVideoComponent()Deprecated.UseExoPlayer, as theExoPlayer.VideoComponentmethods are defined by that interface.DecoderCountersgetVideoDecoderCounters()Deprecated.ReturnsDecoderCountersfor video, or null if no video is being played.FormatgetVideoFormat()Deprecated.Returns the video format currently being played, or null if no video is being played.@com.google.android.exoplayer2.C.VideoScalingMode intgetVideoScalingMode()Deprecated.Returns theC.VideoScalingMode.VideoSizegetVideoSize()Deprecated.Gets the size of the video.floatgetVolume()Deprecated.Returns the audio volume, with 0 being silence and 1 being unity gain (signal unchanged).voidincreaseDeviceVolume()Deprecated.UseincreaseDeviceVolume(int)instead.voidincreaseDeviceVolume(@com.google.android.exoplayer2.C.VolumeFlags int flags)Deprecated.Increases the volume of the device.booleanisDeviceMuted()Deprecated.Gets whether the device is muted or not.booleanisLoading()Deprecated.Whether the player is currently loading the source.booleanisPlayingAd()Deprecated.Returns whether the player is currently playing an ad.booleanisTunnelingEnabled()Deprecated.Returns whether tunneling is enabled for the currently selected tracks.voidmoveMediaItems(int fromIndex, int toIndex, int newIndex)Deprecated.Moves the media item range to the new index.voidprepare()Deprecated.Prepares the player.voidprepare(MediaSource mediaSource)Deprecated.UsesetMediaSource(MediaSource)andPlayer.prepare()instead.voidprepare(MediaSource mediaSource, boolean resetPosition, boolean resetState)Deprecated.UsesetMediaSource(MediaSource, boolean)andPlayer.prepare()instead.voidrelease()Deprecated.Releases the player.voidremoveAnalyticsListener(AnalyticsListener listener)Deprecated.Removes anAnalyticsListener.voidremoveAudioOffloadListener(ExoPlayer.AudioOffloadListener listener)Deprecated.Removes a listener of audio offload events.voidremoveListener(Player.Listener listener)Deprecated.Unregister a listener registered throughPlayer.addListener(Listener).voidremoveMediaItems(int fromIndex, int toIndex)Deprecated.Removes a range of media items from the playlist.voidreplaceMediaItems(int fromIndex, int toIndex, List<MediaItem> mediaItems)Deprecated.Replaces the media items at the given range of the playlist.voidseekTo(int mediaItemIndex, long positionMs, @com.google.android.exoplayer2.Player.Command int seekCommand, boolean isRepeatingCurrentItem)Deprecated.Seeks to a position in the specifiedMediaItem.voidsetAudioAttributes(AudioAttributes audioAttributes, boolean handleAudioFocus)Deprecated.Sets the attributes for audio playback, used by the underlying audio track.voidsetAudioSessionId(int audioSessionId)Deprecated.Sets the ID of the audio session to attach to the underlyingAudioTrack.voidsetAuxEffectInfo(AuxEffectInfo auxEffectInfo)Deprecated.Sets information on an auxiliary audio effect to attach to the underlying audio track.voidsetCameraMotionListener(CameraMotionListener listener)Deprecated.Sets a listener of camera motion events.voidsetDeviceMuted(boolean muted)Deprecated.UsesetDeviceMuted(boolean, int)instead.voidsetDeviceMuted(boolean muted, @com.google.android.exoplayer2.C.VolumeFlags int flags)Deprecated.Sets the mute state of the device.voidsetDeviceVolume(int volume)Deprecated.UsesetDeviceVolume(int, int)instead.voidsetDeviceVolume(int volume, @com.google.android.exoplayer2.C.VolumeFlags int flags)Deprecated.Sets the volume of the device with volume flags.voidsetForegroundMode(boolean foregroundMode)Deprecated.Sets whether the player is allowed to keep holding limited resources such as video decoders, even when in the idle state.voidsetHandleAudioBecomingNoisy(boolean handleAudioBecomingNoisy)Deprecated.Sets whether the player should pause automatically when audio is rerouted from a headset to device speakers.voidsetMediaItems(List<MediaItem> mediaItems, boolean resetPosition)Deprecated.Clears the playlist and adds the specified media items.voidsetMediaItems(List<MediaItem> mediaItems, int startIndex, long startPositionMs)Deprecated.Clears the playlist and adds the specified media items.voidsetMediaSource(MediaSource mediaSource)Deprecated.Clears the playlist, adds the specifiedMediaSourceand resets the position to the default position.voidsetMediaSource(MediaSource mediaSource, boolean resetPosition)Deprecated.Clears the playlist and adds the specifiedMediaSource.voidsetMediaSource(MediaSource mediaSource, long startPositionMs)Deprecated.Clears the playlist and adds the specifiedMediaSource.voidsetMediaSources(List<MediaSource> mediaSources)Deprecated.Clears the playlist, adds the specifiedMediaSourcesand resets the position to the default position.voidsetMediaSources(List<MediaSource> mediaSources, boolean resetPosition)Deprecated.Clears the playlist and adds the specifiedMediaSources.voidsetMediaSources(List<MediaSource> mediaSources, int startMediaItemIndex, long startPositionMs)Deprecated.Clears the playlist and adds the specifiedMediaSources.voidsetPauseAtEndOfMediaItems(boolean pauseAtEndOfMediaItems)Deprecated.Sets whether to pause playback at the end of each media item.voidsetPlaybackParameters(PlaybackParameters playbackParameters)Deprecated.Attempts to set the playback parameters.voidsetPlaylistMetadata(MediaMetadata mediaMetadata)Deprecated.Sets the playlistMediaMetadata.voidsetPlayWhenReady(boolean playWhenReady)Deprecated.Sets whether playback should proceed whenPlayer.getPlaybackState()==Player.STATE_READY.voidsetPreferredAudioDevice(AudioDeviceInfo audioDeviceInfo)Deprecated.Sets the preferred audio device.voidsetPriorityTaskManager(PriorityTaskManager priorityTaskManager)Deprecated.Sets aPriorityTaskManager, or null to clear a previously set priority task manager.voidsetRepeatMode(@com.google.android.exoplayer2.Player.RepeatMode int repeatMode)Deprecated.Sets thePlayer.RepeatModeto be used for playback.voidsetSeekParameters(SeekParameters seekParameters)Deprecated.Sets the parameters that control how seek operations are performed.voidsetShuffleModeEnabled(boolean shuffleModeEnabled)Deprecated.Sets whether shuffling of media items is enabled.voidsetShuffleOrder(ShuffleOrder shuffleOrder)Deprecated.Sets the shuffle order.voidsetSkipSilenceEnabled(boolean skipSilenceEnabled)Deprecated.Sets whether skipping silences in the audio stream is enabled.voidsetTrackSelectionParameters(TrackSelectionParameters parameters)Deprecated.Sets the parameters constraining the track selection.voidsetVideoChangeFrameRateStrategy(@com.google.android.exoplayer2.C.VideoChangeFrameRateStrategy int videoChangeFrameRateStrategy)Deprecated.Sets aC.VideoChangeFrameRateStrategythat will be used by the player when provided with a video outputSurface.voidsetVideoEffects(List<Effect> videoEffects)Deprecated.Sets aListof video effects that will be applied to each video frame.voidsetVideoFrameMetadataListener(VideoFrameMetadataListener listener)Deprecated.Sets a listener to receive video frame metadata events.voidsetVideoScalingMode(@com.google.android.exoplayer2.C.VideoScalingMode int videoScalingMode)Deprecated.Sets theC.VideoScalingMode.voidsetVideoSurface(Surface surface)Deprecated.Sets theSurfaceonto which video will be rendered.voidsetVideoSurfaceHolder(SurfaceHolder surfaceHolder)Deprecated.Sets theSurfaceHolderthat holds theSurfaceonto which video will be rendered.voidsetVideoSurfaceView(SurfaceView surfaceView)Deprecated.Sets theSurfaceViewonto which video will be rendered.voidsetVideoTextureView(TextureView textureView)Deprecated.Sets theTextureViewonto which video will be rendered.voidsetVolume(float volume)Deprecated.Sets the audio volume, valid values are between 0 (silence) and 1 (unity gain, signal unchanged), inclusive.voidsetWakeMode(@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.voidstop()Deprecated.Stops playback without resetting the playlist.-
Methods inherited from class com.google.android.exoplayer2.BasePlayer
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
-
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, replaceMediaItem, seekBack, seekForward, seekTo, seekTo, seekToDefaultPosition, seekToDefaultPosition, seekToNext, seekToNextMediaItem, seekToNextWindow, seekToPrevious, seekToPreviousMediaItem, seekToPreviousWindow, setMediaItem, setMediaItem, setMediaItem, setMediaItems, setPlaybackSpeed
-
-
-
-
Constructor Detail
-
SimpleExoPlayer
@Deprecated 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 theExoPlayer.Builder.
-
SimpleExoPlayer
protected SimpleExoPlayer(SimpleExoPlayer.Builder builder)
Deprecated.- Parameters:
builder- TheSimpleExoPlayer.Builderto obtain all construction parameters.
-
-
Method Detail
-
experimentalSetOffloadSchedulingEnabled
public void experimentalSetOffloadSchedulingEnabled(boolean offloadSchedulingEnabled)
Deprecated.Description copied from interface:ExoPlayerSets 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 = falsebefore 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.Builder.setOffloadMode(@com.google.android.exoplayer2.audio.DefaultAudioSink.OffloadMode int). - An audio track is playing in a format that the device supports offloading (for example, MP3 or AAC).
- The
AudioSinkis 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:
experimentalSetOffloadSchedulingEnabledin interfaceExoPlayer- Parameters:
offloadSchedulingEnabled- Whether to enable offload scheduling.
- Audio offload rendering is enabled in
-
experimentalIsSleepingForOffload
public boolean experimentalIsSleepingForOffload()
Deprecated.Description copied from interface:ExoPlayerReturns whether the player has paused its main loop to save power in offload scheduling mode.
-
getAudioComponent
@Deprecated @Nullable public ExoPlayer.AudioComponent getAudioComponent()
Deprecated.UseExoPlayer, as theExoPlayer.AudioComponentmethods are defined by that interface.- Specified by:
getAudioComponentin interfaceExoPlayer
-
getVideoComponent
@Deprecated @Nullable public ExoPlayer.VideoComponent getVideoComponent()
Deprecated.UseExoPlayer, as theExoPlayer.VideoComponentmethods are defined by that interface.- Specified by:
getVideoComponentin interfaceExoPlayer
-
getTextComponent
@Deprecated @Nullable public ExoPlayer.TextComponent getTextComponent()
Deprecated.UsePlayer, as theExoPlayer.TextComponentmethods are defined by that interface.- Specified by:
getTextComponentin interfaceExoPlayer
-
getDeviceComponent
@Deprecated @Nullable public ExoPlayer.DeviceComponent getDeviceComponent()
Deprecated.UsePlayer, as theExoPlayer.DeviceComponentmethods are defined by that interface.- Specified by:
getDeviceComponentin interfaceExoPlayer
-
setVideoScalingMode
public void setVideoScalingMode(@VideoScalingMode @com.google.android.exoplayer2.C.VideoScalingMode int videoScalingMode)
Deprecated.Description copied from interface:ExoPlayerSets theC.VideoScalingMode.The scaling mode only applies if a
MediaCodec-based videoRendereris enabled and if the output surface is owned by aSurfaceView.- Specified by:
setVideoScalingModein interfaceExoPlayer- Specified by:
setVideoScalingModein interfaceExoPlayer.VideoComponent- Parameters:
videoScalingMode- TheC.VideoScalingMode.
-
getVideoScalingMode
@VideoScalingMode public @com.google.android.exoplayer2.C.VideoScalingMode int getVideoScalingMode()
Deprecated.Description copied from interface:ExoPlayerReturns theC.VideoScalingMode.- Specified by:
getVideoScalingModein interfaceExoPlayer- Specified by:
getVideoScalingModein interfaceExoPlayer.VideoComponent
-
setVideoChangeFrameRateStrategy
public void setVideoChangeFrameRateStrategy(@VideoChangeFrameRateStrategy @com.google.android.exoplayer2.C.VideoChangeFrameRateStrategy int videoChangeFrameRateStrategy)
Deprecated.Description copied from interface:ExoPlayerSets aC.VideoChangeFrameRateStrategythat will be used by the player when provided with a video outputSurface.The strategy only applies if a
MediaCodec-based videoRendereris enabled. Applications wishing to useSurface.CHANGE_FRAME_RATE_ALWAYSshould set the mode toC.VIDEO_CHANGE_FRAME_RATE_STRATEGY_OFFto disable calls toSurface.setFrameRate(float, int, int)from ExoPlayer, and should then callSurface.setFrameRate(float, int, int)directly from application code.- Specified by:
setVideoChangeFrameRateStrategyin interfaceExoPlayer- Specified by:
setVideoChangeFrameRateStrategyin interfaceExoPlayer.VideoComponent- Parameters:
videoChangeFrameRateStrategy- AC.VideoChangeFrameRateStrategy.
-
getVideoChangeFrameRateStrategy
@VideoChangeFrameRateStrategy public @com.google.android.exoplayer2.C.VideoChangeFrameRateStrategy int getVideoChangeFrameRateStrategy()
Deprecated.Description copied from interface:ExoPlayerReturns theC.VideoChangeFrameRateStrategy.- Specified by:
getVideoChangeFrameRateStrategyin interfaceExoPlayer- Specified by:
getVideoChangeFrameRateStrategyin interfaceExoPlayer.VideoComponent
-
getVideoSize
public VideoSize getVideoSize()
Deprecated.Description copied from interface:PlayerGets the size of the video.The video's width and height are
0if there is no supported video track or its size has not been determined yet.- Specified by:
getVideoSizein interfaceExoPlayer.VideoComponent- Specified by:
getVideoSizein interfacePlayer- See Also:
Player.Listener.onVideoSizeChanged(VideoSize)
-
getSurfaceSize
public Size getSurfaceSize()
Deprecated.Description copied from interface:PlayerGets the size of the surface on which the video is rendered.- Specified by:
getSurfaceSizein interfacePlayer- See Also:
Player.Listener.onSurfaceSizeChanged(int, int)
-
clearVideoSurface
public void clearVideoSurface()
Deprecated.Description copied from interface:PlayerClears anySurface,SurfaceHolder,SurfaceVieworTextureViewcurrently set on the player.This method must only be called if
Player.COMMAND_SET_VIDEO_SURFACEis available.- Specified by:
clearVideoSurfacein interfaceExoPlayer.VideoComponent- Specified by:
clearVideoSurfacein interfacePlayer
-
clearVideoSurface
public void clearVideoSurface(@Nullable Surface surface)Deprecated.Description copied from interface:PlayerClears theSurfaceonto 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_SURFACEis available.- Specified by:
clearVideoSurfacein interfaceExoPlayer.VideoComponent- Specified by:
clearVideoSurfacein interfacePlayer- Parameters:
surface- The surface to clear.
-
setVideoSurface
public void setVideoSurface(@Nullable Surface surface)Deprecated.Description copied from interface:PlayerSets theSurfaceonto 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,TextureVieworSurfaceHolderthen 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.This method must only be called if
Player.COMMAND_SET_VIDEO_SURFACEis available.- Specified by:
setVideoSurfacein interfaceExoPlayer.VideoComponent- Specified by:
setVideoSurfacein interfacePlayer- Parameters:
surface- TheSurface.
-
setVideoSurfaceHolder
public void setVideoSurfaceHolder(@Nullable SurfaceHolder surfaceHolder)Deprecated.Description copied from interface:PlayerSets theSurfaceHolderthat holds theSurfaceonto which video will be rendered. The player will track the lifecycle of the surface automatically.The thread that calls the
SurfaceHolder.Callbackmethods must be the thread associated withPlayer.getApplicationLooper().This method must only be called if
Player.COMMAND_SET_VIDEO_SURFACEis available.- Specified by:
setVideoSurfaceHolderin interfaceExoPlayer.VideoComponent- Specified by:
setVideoSurfaceHolderin interfacePlayer- Parameters:
surfaceHolder- The surface holder.
-
clearVideoSurfaceHolder
public void clearVideoSurfaceHolder(@Nullable SurfaceHolder surfaceHolder)Deprecated.Description copied from interface:PlayerClears theSurfaceHolderthat holds theSurfaceonto 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_SURFACEis available.- Specified by:
clearVideoSurfaceHolderin interfaceExoPlayer.VideoComponent- Specified by:
clearVideoSurfaceHolderin interfacePlayer- Parameters:
surfaceHolder- The surface holder to clear.
-
setVideoSurfaceView
public void setVideoSurfaceView(@Nullable SurfaceView surfaceView)Deprecated.Description copied from interface:PlayerSets theSurfaceViewonto which video will be rendered. The player will track the lifecycle of the surface automatically.The thread that calls the
SurfaceHolder.Callbackmethods must be the thread associated withPlayer.getApplicationLooper().This method must only be called if
Player.COMMAND_SET_VIDEO_SURFACEis available.- Specified by:
setVideoSurfaceViewin interfaceExoPlayer.VideoComponent- Specified by:
setVideoSurfaceViewin interfacePlayer- Parameters:
surfaceView- The surface view.
-
clearVideoSurfaceView
public void clearVideoSurfaceView(@Nullable SurfaceView surfaceView)Deprecated.Description copied from interface:PlayerClears theSurfaceViewonto 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_SURFACEis available.- Specified by:
clearVideoSurfaceViewin interfaceExoPlayer.VideoComponent- Specified by:
clearVideoSurfaceViewin interfacePlayer- Parameters:
surfaceView- The texture view to clear.
-
setVideoTextureView
public void setVideoTextureView(@Nullable TextureView textureView)Deprecated.Description copied from interface:PlayerSets theTextureViewonto which video will be rendered. The player will track the lifecycle of the surface automatically.The thread that calls the
TextureView.SurfaceTextureListenermethods must be the thread associated withPlayer.getApplicationLooper().This method must only be called if
Player.COMMAND_SET_VIDEO_SURFACEis available.- Specified by:
setVideoTextureViewin interfaceExoPlayer.VideoComponent- Specified by:
setVideoTextureViewin interfacePlayer- Parameters:
textureView- The texture view.
-
clearVideoTextureView
public void clearVideoTextureView(@Nullable TextureView textureView)Deprecated.Description copied from interface:PlayerClears theTextureViewonto 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_SURFACEis available.- Specified by:
clearVideoTextureViewin interfaceExoPlayer.VideoComponent- Specified by:
clearVideoTextureViewin interfacePlayer- Parameters:
textureView- The texture view to clear.
-
addAudioOffloadListener
public void addAudioOffloadListener(ExoPlayer.AudioOffloadListener listener)
Deprecated.Description copied from interface:ExoPlayerAdds a listener to receive audio offload events.This method can be called from any thread.
- Specified by:
addAudioOffloadListenerin interfaceExoPlayer- Parameters:
listener- The listener to register.
-
removeAudioOffloadListener
public void removeAudioOffloadListener(ExoPlayer.AudioOffloadListener listener)
Deprecated.Description copied from interface:ExoPlayerRemoves a listener of audio offload events.- Specified by:
removeAudioOffloadListenerin interfaceExoPlayer- Parameters:
listener- The listener to unregister.
-
setAudioAttributes
public void setAudioAttributes(AudioAttributes audioAttributes, boolean handleAudioFocus)
Deprecated.Description copied from interface:ExoPlayerSets 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.usagemust beC.USAGE_MEDIAorC.USAGE_GAME. Other usages will throw anIllegalArgumentException.- Specified by:
setAudioAttributesin interfaceExoPlayer- Specified by:
setAudioAttributesin 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:PlayerReturns the attributes for audio playback.This method must only be called if
Player.COMMAND_GET_AUDIO_ATTRIBUTESis available.- Specified by:
getAudioAttributesin interfaceExoPlayer.AudioComponent- Specified by:
getAudioAttributesin interfacePlayer
-
setAudioSessionId
public void setAudioSessionId(int audioSessionId)
Deprecated.Description copied from interface:ExoPlayerSets 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:
setAudioSessionIdin interfaceExoPlayer- Specified by:
setAudioSessionIdin interfaceExoPlayer.AudioComponent- Parameters:
audioSessionId- The audio session ID, orC.AUDIO_SESSION_ID_UNSETif it should be generated by the framework.
-
getAudioSessionId
public int getAudioSessionId()
Deprecated.Description copied from interface:ExoPlayerReturns the audio session identifier, orC.AUDIO_SESSION_ID_UNSETif not set.- Specified by:
getAudioSessionIdin interfaceExoPlayer- Specified by:
getAudioSessionIdin interfaceExoPlayer.AudioComponent
-
setAuxEffectInfo
public void setAuxEffectInfo(AuxEffectInfo auxEffectInfo)
Deprecated.Description copied from interface:ExoPlayerSets information on an auxiliary audio effect to attach to the underlying audio track.- Specified by:
setAuxEffectInfoin interfaceExoPlayer- Specified by:
setAuxEffectInfoin interfaceExoPlayer.AudioComponent
-
clearAuxEffectInfo
public void clearAuxEffectInfo()
Deprecated.Description copied from interface:ExoPlayerDetaches any previously attached auxiliary audio effect from the underlying audio track.- Specified by:
clearAuxEffectInfoin interfaceExoPlayer- Specified by:
clearAuxEffectInfoin interfaceExoPlayer.AudioComponent
-
setPreferredAudioDevice
@RequiresApi(23) public void setPreferredAudioDevice(@Nullable AudioDeviceInfo audioDeviceInfo)Deprecated.Description copied from interface:ExoPlayerSets the preferred audio device.- Specified by:
setPreferredAudioDevicein interfaceExoPlayer- Parameters:
audioDeviceInfo- The preferred audio device, or null to restore the default.
-
setVolume
public void setVolume(float volume)
Deprecated.Description copied from interface:PlayerSets 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_VOLUMEis available.- Specified by:
setVolumein interfaceExoPlayer.AudioComponent- Specified by:
setVolumein interfacePlayer- Parameters:
volume- Linear output gain to apply to all audio channels.
-
getVolume
public float getVolume()
Deprecated.Description copied from interface:PlayerReturns the audio volume, with 0 being silence and 1 being unity gain (signal unchanged).This method must only be called if
Player.COMMAND_GET_VOLUMEis available.- Specified by:
getVolumein interfaceExoPlayer.AudioComponent- Specified by:
getVolumein interfacePlayer- Returns:
- The linear gain applied to all audio channels.
-
getSkipSilenceEnabled
public boolean getSkipSilenceEnabled()
Deprecated.Description copied from interface:ExoPlayerReturns whether skipping silences in the audio stream is enabled.- Specified by:
getSkipSilenceEnabledin interfaceExoPlayer- Specified by:
getSkipSilenceEnabledin interfaceExoPlayer.AudioComponent
-
setVideoEffects
public void setVideoEffects(List<Effect> videoEffects)
Deprecated.Description copied from interface:ExoPlayerSets aListof 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
MediaCodecVideoRendererand not custom or extension video renderers. - This feature does not work with DRM-protected contents.
- This method should be called before calling
ExoPlayer.prepare(com.google.android.exoplayer2.source.MediaSource).
- Specified by:
setVideoEffectsin interfaceExoPlayer- Parameters:
videoEffects- TheListof video effects to apply.
- This feature works only with the default
-
setSkipSilenceEnabled
public void setSkipSilenceEnabled(boolean skipSilenceEnabled)
Deprecated.Description copied from interface:ExoPlayerSets whether skipping silences in the audio stream is enabled.- Specified by:
setSkipSilenceEnabledin interfaceExoPlayer- Specified by:
setSkipSilenceEnabledin interfaceExoPlayer.AudioComponent- Parameters:
skipSilenceEnabled- Whether skipping silences in the audio stream is enabled.
-
getAnalyticsCollector
public AnalyticsCollector getAnalyticsCollector()
Deprecated.Description copied from interface:ExoPlayerReturns theAnalyticsCollectorused for collecting analytics events.- Specified by:
getAnalyticsCollectorin interfaceExoPlayer
-
addAnalyticsListener
public void addAnalyticsListener(AnalyticsListener listener)
Deprecated.Description copied from interface:ExoPlayerAdds anAnalyticsListenerto receive analytics events.This method can be called from any thread.
- Specified by:
addAnalyticsListenerin interfaceExoPlayer- Parameters:
listener- The listener to be added.
-
removeAnalyticsListener
public void removeAnalyticsListener(AnalyticsListener listener)
Deprecated.Description copied from interface:ExoPlayerRemoves anAnalyticsListener.- Specified by:
removeAnalyticsListenerin interfaceExoPlayer- Parameters:
listener- The listener to be removed.
-
setHandleAudioBecomingNoisy
public void setHandleAudioBecomingNoisy(boolean handleAudioBecomingNoisy)
Deprecated.Description copied from interface:ExoPlayerSets 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:
setHandleAudioBecomingNoisyin 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:ExoPlayerSets aPriorityTaskManager, or null to clear a previously set priority task manager.The priority
C.PRIORITY_PLAYBACKwill be set while the player is loading.- Specified by:
setPriorityTaskManagerin interfaceExoPlayer- Parameters:
priorityTaskManager- ThePriorityTaskManager, or null to clear a previously set priority task manager.
-
getVideoFormat
@Nullable public Format getVideoFormat()
Deprecated.Description copied from interface:ExoPlayerReturns the video format currently being played, or null if no video is being played.- Specified by:
getVideoFormatin interfaceExoPlayer
-
getAudioFormat
@Nullable public Format getAudioFormat()
Deprecated.Description copied from interface:ExoPlayerReturns the audio format currently being played, or null if no audio is being played.- Specified by:
getAudioFormatin interfaceExoPlayer
-
getVideoDecoderCounters
@Nullable public DecoderCounters getVideoDecoderCounters()
Deprecated.Description copied from interface:ExoPlayerReturnsDecoderCountersfor video, or null if no video is being played.- Specified by:
getVideoDecoderCountersin interfaceExoPlayer
-
getAudioDecoderCounters
@Nullable public DecoderCounters getAudioDecoderCounters()
Deprecated.Description copied from interface:ExoPlayerReturnsDecoderCountersfor audio, or null if no audio is being played.- Specified by:
getAudioDecoderCountersin interfaceExoPlayer
-
setVideoFrameMetadataListener
public void setVideoFrameMetadataListener(VideoFrameMetadataListener listener)
Deprecated.Description copied from interface:ExoPlayerSets a listener to receive video frame metadata events.This method is intended to be called by the same component that sets the
Surfaceonto which video will be rendered. If using ExoPlayer's standard UI components, this method should not be called directly from application code.- Specified by:
setVideoFrameMetadataListenerin interfaceExoPlayer- Specified by:
setVideoFrameMetadataListenerin interfaceExoPlayer.VideoComponent- Parameters:
listener- The listener.
-
clearVideoFrameMetadataListener
public void clearVideoFrameMetadataListener(VideoFrameMetadataListener listener)
Deprecated.Description copied from interface:ExoPlayerClears the listener which receives video frame metadata events if it matches the one passed. Else does nothing.- Specified by:
clearVideoFrameMetadataListenerin interfaceExoPlayer- Specified by:
clearVideoFrameMetadataListenerin interfaceExoPlayer.VideoComponent- Parameters:
listener- The listener to clear.
-
setCameraMotionListener
public void setCameraMotionListener(CameraMotionListener listener)
Deprecated.Description copied from interface:ExoPlayerSets a listener of camera motion events.- Specified by:
setCameraMotionListenerin interfaceExoPlayer- Specified by:
setCameraMotionListenerin interfaceExoPlayer.VideoComponent- Parameters:
listener- The listener.
-
clearCameraMotionListener
public void clearCameraMotionListener(CameraMotionListener listener)
Deprecated.Description copied from interface:ExoPlayerClears the listener which receives camera motion events if it matches the one passed. Else does nothing.- Specified by:
clearCameraMotionListenerin interfaceExoPlayer- Specified by:
clearCameraMotionListenerin interfaceExoPlayer.VideoComponent- Parameters:
listener- The listener to clear.
-
getCurrentCues
public CueGroup getCurrentCues()
Deprecated.Description copied from interface:PlayerReturns the currentCueGroup.This method must only be called if
Player.COMMAND_GET_TEXTis available.- Specified by:
getCurrentCuesin interfaceExoPlayer.TextComponent- Specified by:
getCurrentCuesin interfacePlayer
-
getPlaybackLooper
public Looper getPlaybackLooper()
Deprecated.Description copied from interface:ExoPlayerReturns theLooperassociated with the playback thread.This method may be called from any thread.
- Specified by:
getPlaybackLooperin interfaceExoPlayer
-
getApplicationLooper
public Looper getApplicationLooper()
Deprecated.Description copied from interface:PlayerReturns theLooperassociated 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:
getApplicationLooperin interfacePlayer
-
getClock
public Clock getClock()
Deprecated.Description copied from interface:ExoPlayerReturns theClockused for playback.This method can be called from any thread.
-
addListener
public void addListener(Player.Listener listener)
Deprecated.Description copied from interface:PlayerRegisters 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:
addListenerin interfacePlayer- Parameters:
listener- The listener to register.
-
removeListener
public void removeListener(Player.Listener listener)
Deprecated.Description copied from interface:PlayerUnregister a listener registered throughPlayer.addListener(Listener). The listener will no longer receive events.- Specified by:
removeListenerin interfacePlayer- Parameters:
listener- The listener to unregister.
-
getPlaybackState
@State public @com.google.android.exoplayer2.Player.State int getPlaybackState()
Deprecated.Description copied from interface:PlayerReturns the current playback state of the player.- Specified by:
getPlaybackStatein 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:PlayerReturns the reason why playback is suppressed even thoughPlayer.getPlayWhenReady()istrue, orPlayer.PLAYBACK_SUPPRESSION_REASON_NONEif playback is not suppressed.- Specified by:
getPlaybackSuppressionReasonin interfacePlayer- Returns:
- The current
Player.PlaybackSuppressionReason. - See Also:
Player.Listener.onPlaybackSuppressionReasonChanged(int)
-
getPlayerError
@Nullable public ExoPlaybackException getPlayerError()
Deprecated.Description copied from interface:ExoPlayerEquivalent toPlayer.getPlayerError(), except the exception is guaranteed to be anExoPlaybackException.- Specified by:
getPlayerErrorin interfaceExoPlayer- Specified by:
getPlayerErrorin interfacePlayer- Returns:
- The error, or
null. - See Also:
Player.Listener.onPlayerError(PlaybackException)
-
getAvailableCommands
public Player.Commands getAvailableCommands()
Deprecated.Description copied from interface:PlayerReturns the player's currently availablePlayer.Commands.The returned
Player.Commandsare not updated when available commands change. UsePlayer.Listener.onAvailableCommandsChanged(Commands)to get an update when the available commands change.- Specified by:
getAvailableCommandsin 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:PlayerPrepares the player.This method must only be called if
Player.COMMAND_PREPAREis available.This will move the player out of
idle stateand 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:PlayerClears the playlist and adds the specified media items.This method must only be called if
Player.COMMAND_CHANGE_MEDIA_ITEMSis available.- Specified by:
setMediaItemsin interfacePlayer- Parameters:
mediaItems- The new media items.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:PlayerClears the playlist and adds the specified media items.This method must only be called if
Player.COMMAND_CHANGE_MEDIA_ITEMSis available.- Specified by:
setMediaItemsin interfacePlayer- Parameters:
mediaItems- The new media items.startIndex- TheMediaItemindex to start playback from. IfC.INDEX_UNSETis passed, the current position is not reset.startPositionMs- The position in milliseconds to start playback from. IfC.TIME_UNSETis passed, the default position of the givenMediaItemis used. In any case, ifstartIndexis 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:ExoPlayerClears the playlist, adds the specifiedMediaSourcesand resets the position to the default position.- Specified by:
setMediaSourcesin interfaceExoPlayer- Parameters:
mediaSources- The newMediaSources.
-
setMediaSources
public void setMediaSources(List<MediaSource> mediaSources, boolean resetPosition)
Deprecated.Description copied from interface:ExoPlayerClears the playlist and adds the specifiedMediaSources.- Specified by:
setMediaSourcesin 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:ExoPlayerClears the playlist and adds the specifiedMediaSources.- Specified by:
setMediaSourcesin interfaceExoPlayer- Parameters:
mediaSources- The newMediaSources.startMediaItemIndex- The media item index to start playback from. IfC.INDEX_UNSETis passed, the current position is not reset.startPositionMs- The position in milliseconds to start playback from. IfC.TIME_UNSETis passed, the default position of the given media item is used. In any case, ifstartMediaItemIndexis 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:ExoPlayerClears the playlist, adds the specifiedMediaSourceand resets the position to the default position.- Specified by:
setMediaSourcein interfaceExoPlayer- Parameters:
mediaSource- The newMediaSource.
-
setMediaSource
public void setMediaSource(MediaSource mediaSource, boolean resetPosition)
Deprecated.Description copied from interface:ExoPlayerClears the playlist and adds the specifiedMediaSource.- Specified by:
setMediaSourcein 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:ExoPlayerClears the playlist and adds the specifiedMediaSource.- Specified by:
setMediaSourcein 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:PlayerAdds a list of media items at the given index of the playlist.This method must only be called if
Player.COMMAND_CHANGE_MEDIA_ITEMSis available.- Specified by:
addMediaItemsin 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- The media items to add.
-
addMediaSource
public void addMediaSource(MediaSource mediaSource)
Deprecated.Description copied from interface:ExoPlayerAdds a media source to the end of the playlist.- Specified by:
addMediaSourcein interfaceExoPlayer- Parameters:
mediaSource- TheMediaSourceto add.
-
addMediaSource
public void addMediaSource(int index, MediaSource mediaSource)Deprecated.Description copied from interface:ExoPlayerAdds a media source at the given index of the playlist.- Specified by:
addMediaSourcein interfaceExoPlayer- Parameters:
index- The index at which to add the source.mediaSource- TheMediaSourceto add.
-
addMediaSources
public void addMediaSources(List<MediaSource> mediaSources)
Deprecated.Description copied from interface:ExoPlayerAdds a list of media sources to the end of the playlist.- Specified by:
addMediaSourcesin interfaceExoPlayer- Parameters:
mediaSources- TheMediaSourcesto add.
-
addMediaSources
public void addMediaSources(int index, List<MediaSource> mediaSources)Deprecated.Description copied from interface:ExoPlayerAdds a list of media sources at the given index of the playlist.- Specified by:
addMediaSourcesin interfaceExoPlayer- Parameters:
index- The index at which to add the media sources.mediaSources- TheMediaSourcesto add.
-
moveMediaItems
public void moveMediaItems(int fromIndex, int toIndex, int newIndex)Deprecated.Description copied from interface:PlayerMoves the media item range to the new index.This method must only be called if
Player.COMMAND_CHANGE_MEDIA_ITEMSis available.- Specified by:
moveMediaItemsin interfacePlayer- Parameters:
fromIndex- The start of the range to move. If the index is larger than the size of the playlist, the request is ignored.toIndex- The first item not to be included in the range (exclusive). If the index is larger than the size of the playlist, items up to the end of the playlist are moved.newIndex- The new index of the first media item of the range. If the new index is larger than the size of the remaining playlist after removing the range, the range is moved to the end of the playlist.
-
replaceMediaItems
public void replaceMediaItems(int fromIndex, int toIndex, List<MediaItem> mediaItems)Deprecated.Description copied from interface:PlayerReplaces the media items at the given range of the playlist.This method must only be called if
Player.COMMAND_CHANGE_MEDIA_ITEMSis 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
fromIndexandtoIndexdoes not have to match the number of added items defined bymediaItems. As result, it may also change the index of subsequent items not touched by this operation.- Specified by:
replaceMediaItemsin interfacePlayer- Parameters:
fromIndex- The start of the range. If the index is larger than the size of the playlist, the request is ignored.toIndex- The first item not to be included in the range (exclusive). If the index is larger than the size of the playlist, items up to the end of the playlist are replaced.mediaItems- The media items to replace the range with.
-
removeMediaItems
public void removeMediaItems(int fromIndex, int toIndex)Deprecated.Description copied from interface:PlayerRemoves a range of media items from the playlist.This method must only be called if
Player.COMMAND_CHANGE_MEDIA_ITEMSis available.- Specified by:
removeMediaItemsin interfacePlayer- Parameters:
fromIndex- The index at which to start removing media items. If the index is larger than the size of the playlist, the request is ignored.toIndex- The index of the first item to be kept (exclusive). If the index is larger than the size of the playlist, media items up to the end of the playlist are removed.
-
setShuffleOrder
public void setShuffleOrder(ShuffleOrder shuffleOrder)
Deprecated.Description copied from interface:ExoPlayerSets the shuffle order.The
ShuffleOrderpassed must have the same length as the current playlist (Player.getMediaItemCount()).- Specified by:
setShuffleOrderin interfaceExoPlayer- Parameters:
shuffleOrder- The shuffle order.
-
setPlayWhenReady
public void setPlayWhenReady(boolean playWhenReady)
Deprecated.Description copied from interface:PlayerSets 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.
This method must only be called if
Player.COMMAND_PLAY_PAUSEis available.- Specified by:
setPlayWhenReadyin interfacePlayer- Parameters:
playWhenReady- Whether playback should proceed when ready.
-
getPlayWhenReady
public boolean getPlayWhenReady()
Deprecated.Description copied from interface:PlayerWhether playback will proceed whenPlayer.getPlaybackState()==Player.STATE_READY.- Specified by:
getPlayWhenReadyin 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:ExoPlayerSets 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_ITEMwhen this happens.- Specified by:
setPauseAtEndOfMediaItemsin interfaceExoPlayer- Parameters:
pauseAtEndOfMediaItems- Whether to pause playback at the end of each media item.
-
getPauseAtEndOfMediaItems
public boolean getPauseAtEndOfMediaItems()
Deprecated.Description copied from interface:ExoPlayerReturns whether the player pauses playback at the end of each media item.- Specified by:
getPauseAtEndOfMediaItemsin interfaceExoPlayer- See Also:
ExoPlayer.setPauseAtEndOfMediaItems(boolean)
-
getRepeatMode
@RepeatMode public @com.google.android.exoplayer2.Player.RepeatMode int getRepeatMode()
Deprecated.Description copied from interface:PlayerReturns the currentPlayer.RepeatModeused for playback.- Specified by:
getRepeatModein 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:PlayerSets thePlayer.RepeatModeto be used for playback.This method must only be called if
Player.COMMAND_SET_REPEAT_MODEis available.- Specified by:
setRepeatModein interfacePlayer- Parameters:
repeatMode- The repeat mode.
-
setShuffleModeEnabled
public void setShuffleModeEnabled(boolean shuffleModeEnabled)
Deprecated.Description copied from interface:PlayerSets whether shuffling of media items is enabled.This method must only be called if
Player.COMMAND_SET_SHUFFLE_MODEis available.- Specified by:
setShuffleModeEnabledin interfacePlayer- Parameters:
shuffleModeEnabled- Whether shuffling is enabled.
-
getShuffleModeEnabled
public boolean getShuffleModeEnabled()
Deprecated.Description copied from interface:PlayerReturns whether shuffling of media items is enabled.- Specified by:
getShuffleModeEnabledin interfacePlayer- See Also:
Player.Listener.onShuffleModeEnabledChanged(boolean)
-
isLoading
public boolean isLoading()
Deprecated.Description copied from interface:PlayerWhether the player is currently loading the source.- Specified by:
isLoadingin interfacePlayer- Returns:
- Whether the player is currently loading the source.
- See Also:
Player.Listener.onIsLoadingChanged(boolean)
-
seekTo
public void seekTo(int mediaItemIndex, long positionMs, @Command @com.google.android.exoplayer2.Player.Command int seekCommand, boolean isRepeatingCurrentItem)Deprecated.Description copied from class:BasePlayerSeeks to a position in the specifiedMediaItem.- Specified by:
seekToin classBasePlayer- Parameters:
mediaItemIndex- The index of theMediaItem.positionMs- The seek position in the specifiedMediaItemin milliseconds, orC.TIME_UNSETto seek to the media item's default position.seekCommand- ThePlayer.Commandused to trigger the seek.isRepeatingCurrentItem- Whether this seeks repeats the current item.
-
getSeekBackIncrement
public long getSeekBackIncrement()
Deprecated.Description copied from interface:PlayerReturns thePlayer.seekBack()increment.- Specified by:
getSeekBackIncrementin interfacePlayer- Returns:
- The seek back increment, in milliseconds.
- See Also:
Player.Listener.onSeekBackIncrementChanged(long)
-
getSeekForwardIncrement
public long getSeekForwardIncrement()
Deprecated.Description copied from interface:PlayerReturns thePlayer.seekForward()increment.- Specified by:
getSeekForwardIncrementin interfacePlayer- Returns:
- The seek forward increment, in milliseconds.
- See Also:
Player.Listener.onSeekForwardIncrementChanged(long)
-
getMaxSeekToPreviousPosition
public long getMaxSeekToPreviousPosition()
Deprecated.Description copied from interface:PlayerReturns the maximum position for whichPlayer.seekToPrevious()seeks to the previousMediaItem, in milliseconds.- Specified by:
getMaxSeekToPreviousPositionin interfacePlayer- Returns:
- The maximum seek to previous position, in milliseconds.
- See Also:
Player.Listener.onMaxSeekToPreviousPositionChanged(long)
-
setPlaybackParameters
public void setPlaybackParameters(PlaybackParameters playbackParameters)
Deprecated.Description copied from interface:PlayerAttempts to set the playback parameters. PassingPlaybackParameters.DEFAULTresets 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_PITCHis available.- Specified by:
setPlaybackParametersin interfacePlayer- Parameters:
playbackParameters- The playback parameters.
-
getPlaybackParameters
public PlaybackParameters getPlaybackParameters()
Deprecated.Description copied from interface:PlayerReturns the currently active playback parameters.- Specified by:
getPlaybackParametersin interfacePlayer- See Also:
Player.Listener.onPlaybackParametersChanged(PlaybackParameters)
-
setSeekParameters
public void setSeekParameters(@Nullable SeekParameters seekParameters)Deprecated.Description copied from interface:ExoPlayerSets the parameters that control how seek operations are performed.- Specified by:
setSeekParametersin interfaceExoPlayer- Parameters:
seekParameters- The seek parameters, ornullto use the defaults.
-
getSeekParameters
public SeekParameters getSeekParameters()
Deprecated.Description copied from interface:ExoPlayerReturns the currently activeSeekParametersof the player.- Specified by:
getSeekParametersin interfaceExoPlayer
-
setForegroundMode
public void setForegroundMode(boolean foregroundMode)
Deprecated.Description copied from interface:ExoPlayerSets 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:
setForegroundModein 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:PlayerStops 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_IDLEand 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.
This method must only be called if
Player.COMMAND_STOPis available.
-
release
public void release()
Deprecated.Description copied from interface:PlayerReleases 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_RELEASEis available.
-
createMessage
public PlayerMessage createMessage(PlayerMessage.Target target)
Deprecated.Description copied from interface:ExoPlayerCreates 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:
createMessagein interfaceExoPlayer
-
getRendererCount
public int getRendererCount()
Deprecated.Description copied from interface:ExoPlayerReturns the number of renderers.- Specified by:
getRendererCountin interfaceExoPlayer
-
getRendererType
public @com.google.android.exoplayer2.C.TrackType int getRendererType(int index)
Deprecated.Description copied from interface:ExoPlayerReturns 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_AUDIOand a text renderer will returnC.TRACK_TYPE_TEXT.- Specified by:
getRendererTypein interfaceExoPlayer- Parameters:
index- The index of the renderer.- Returns:
- The
track typethat the renderer handles.
-
getRenderer
public Renderer getRenderer(int index)
Deprecated.Description copied from interface:ExoPlayerReturns the renderer at the given index.- Specified by:
getRendererin interfaceExoPlayer- Parameters:
index- The index of the renderer.- Returns:
- The renderer at this index.
-
getTrackSelector
public TrackSelector getTrackSelector()
Deprecated.Description copied from interface:ExoPlayerReturns the track selector that this player uses, or null if track selection is not supported.- Specified by:
getTrackSelectorin interfaceExoPlayer
-
getCurrentTrackGroups
@Deprecated public TrackGroupArray getCurrentTrackGroups()
Deprecated.UsegetCurrentTracks().Description copied from interface:ExoPlayerReturns the available track groups.- Specified by:
getCurrentTrackGroupsin interfaceExoPlayer- See Also:
Player.Listener.onTracksChanged(Tracks)
-
getCurrentTrackSelections
@Deprecated public TrackSelectionArray getCurrentTrackSelections()
Deprecated.UsegetCurrentTracks().Description copied from interface:ExoPlayerReturns the current track selections for each renderer, which may includenullelements if some renderers do not have any selected tracks.- Specified by:
getCurrentTrackSelectionsin interfaceExoPlayer- See Also:
Player.Listener.onTracksChanged(Tracks)
-
getCurrentTracks
public Tracks getCurrentTracks()
Deprecated.Description copied from interface:PlayerReturns the current tracks.This method must only be called if
Player.COMMAND_GET_TRACKSis available.- Specified by:
getCurrentTracksin interfacePlayer- See Also:
Player.Listener.onTracksChanged(Tracks)
-
getTrackSelectionParameters
public TrackSelectionParameters getTrackSelectionParameters()
Deprecated.Description copied from interface:PlayerReturns the parameters constraining the track selection.- Specified by:
getTrackSelectionParametersin interfacePlayer- See Also:
}
-
setTrackSelectionParameters
public void setTrackSelectionParameters(TrackSelectionParameters parameters)
Deprecated.Description copied from interface:PlayerSets 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_PARAMETERSis available.- Specified by:
setTrackSelectionParametersin interfacePlayer
-
getMediaMetadata
public MediaMetadata getMediaMetadata()
Deprecated.Description copied from interface:PlayerReturns the current combinedMediaMetadata, orMediaMetadata.EMPTYif not supported.This
MediaMetadatais a combination of theMediaItem metadata, the static metadata in the media'sFormat, and any timed metadata that has been parsed from the media and output viaPlayer.Listener.onMetadata(Metadata). If a field is populated in theMediaItem.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_METADATAis available.- Specified by:
getMediaMetadatain interfacePlayer
-
getPlaylistMetadata
public MediaMetadata getPlaylistMetadata()
Deprecated.Description copied from interface:PlayerReturns the playlistMediaMetadata, as set byPlayer.setPlaylistMetadata(MediaMetadata), orMediaMetadata.EMPTYif not supported.This method must only be called if
Player.COMMAND_GET_METADATAis available.- Specified by:
getPlaylistMetadatain interfacePlayer
-
setPlaylistMetadata
public void setPlaylistMetadata(MediaMetadata mediaMetadata)
Deprecated.Description copied from interface:PlayerSets the playlistMediaMetadata.This method must only be called if
Player.COMMAND_SET_PLAYLIST_METADATAis available.- Specified by:
setPlaylistMetadatain interfacePlayer
-
getCurrentTimeline
public Timeline getCurrentTimeline()
Deprecated.Description copied from interface:PlayerReturns the currentTimeline. Never null, but may be empty.This method must only be called if
Player.COMMAND_GET_TIMELINEis available.- Specified by:
getCurrentTimelinein interfacePlayer- See Also:
Player.Listener.onTimelineChanged(Timeline, int)
-
getCurrentPeriodIndex
public int getCurrentPeriodIndex()
Deprecated.Description copied from interface:PlayerReturns the index of the period currently being played.This method must only be called if
Player.COMMAND_GET_TIMELINEis available.- Specified by:
getCurrentPeriodIndexin interfacePlayer
-
getCurrentMediaItemIndex
public int getCurrentMediaItemIndex()
Deprecated.Description copied from interface:PlayerReturns the index of the currentMediaItemin thetimeline, or the prospective index if thecurrent timelineis empty.This method must only be called if
Player.COMMAND_GET_TIMELINEis available.- Specified by:
getCurrentMediaItemIndexin interfacePlayer
-
getDuration
public long getDuration()
Deprecated.Description copied from interface:PlayerReturns the duration of the current content or ad in milliseconds, orC.TIME_UNSETif the duration is not known.This method must only be called if
Player.COMMAND_GET_CURRENT_MEDIA_ITEMis available.- Specified by:
getDurationin interfacePlayer
-
getCurrentPosition
public long getCurrentPosition()
Deprecated.Description copied from interface:PlayerReturns the playback position in the current content or ad, in milliseconds, or the prospective position in milliseconds if thecurrent timelineis empty.This method must only be called if
Player.COMMAND_GET_CURRENT_MEDIA_ITEMis available.- Specified by:
getCurrentPositionin interfacePlayer
-
getBufferedPosition
public long getBufferedPosition()
Deprecated.Description copied from interface:PlayerReturns 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_ITEMis available.- Specified by:
getBufferedPositionin interfacePlayer
-
getTotalBufferedDuration
public long getTotalBufferedDuration()
Deprecated.Description copied from interface:PlayerReturns 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_ITEMis available.- Specified by:
getTotalBufferedDurationin interfacePlayer
-
isPlayingAd
public boolean isPlayingAd()
Deprecated.Description copied from interface:PlayerReturns whether the player is currently playing an ad.This method must only be called if
Player.COMMAND_GET_CURRENT_MEDIA_ITEMis available.- Specified by:
isPlayingAdin interfacePlayer
-
getCurrentAdGroupIndex
public int getCurrentAdGroupIndex()
Deprecated.Description copied from interface:PlayerIfPlayer.isPlayingAd()returns true, returns the index of the ad group in the period currently being played. ReturnsC.INDEX_UNSETotherwise.This method must only be called if
Player.COMMAND_GET_CURRENT_MEDIA_ITEMis available.- Specified by:
getCurrentAdGroupIndexin interfacePlayer
-
getCurrentAdIndexInAdGroup
public int getCurrentAdIndexInAdGroup()
Deprecated.Description copied from interface:PlayerIfPlayer.isPlayingAd()returns true, returns the index of the ad in its ad group. ReturnsC.INDEX_UNSETotherwise.This method must only be called if
Player.COMMAND_GET_CURRENT_MEDIA_ITEMis available.- Specified by:
getCurrentAdIndexInAdGroupin interfacePlayer
-
getContentPosition
public long getContentPosition()
Deprecated.Description copied from interface:PlayerIfPlayer.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().This method must only be called if
Player.COMMAND_GET_CURRENT_MEDIA_ITEMis available.- Specified by:
getContentPositionin interfacePlayer
-
getContentBufferedPosition
public long getContentBufferedPosition()
Deprecated.Description copied from interface:PlayerIfPlayer.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().This method must only be called if
Player.COMMAND_GET_CURRENT_MEDIA_ITEMis available.- Specified by:
getContentBufferedPositionin interfacePlayer
-
setWakeMode
public void setWakeMode(@WakeMode @com.google.android.exoplayer2.C.WakeMode int wakeMode)
Deprecated.Description copied from interface:ExoPlayerSets how the player should keep the device awake for playback when the screen is off.Enabling this feature requires the
Manifest.permission.WAKE_LOCKpermission. It should be used together with a foregroundServicefor 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_READYorPlayer.STATE_BUFFERINGstates withplayWhenReady = true. The locks held depends on the specifiedC.WakeMode.- Specified by:
setWakeModein interfaceExoPlayer- Parameters:
wakeMode- TheC.WakeModeoption to keep the device awake during playback.
-
getDeviceInfo
public DeviceInfo getDeviceInfo()
Deprecated.Description copied from interface:PlayerGets the device information.- Specified by:
getDeviceInfoin interfaceExoPlayer.DeviceComponent- Specified by:
getDeviceInfoin interfacePlayer
-
getDeviceVolume
public int getDeviceVolume()
Deprecated.Description copied from interface:PlayerGets 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.usagewhich can be converted to stream type withUtil.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_VOLUMEis available.- Specified by:
getDeviceVolumein interfaceExoPlayer.DeviceComponent- Specified by:
getDeviceVolumein interfacePlayer
-
isDeviceMuted
public boolean isDeviceMuted()
Deprecated.Description copied from interface:PlayerGets whether the device is muted or not.This method must only be called if
Player.COMMAND_GET_DEVICE_VOLUMEis available.- Specified by:
isDeviceMutedin interfaceExoPlayer.DeviceComponent- Specified by:
isDeviceMutedin interfacePlayer
-
setDeviceVolume
@Deprecated public void setDeviceVolume(int volume)
Deprecated.UsesetDeviceVolume(int, int)instead.- Specified by:
setDeviceVolumein interfaceExoPlayer.DeviceComponent- Specified by:
setDeviceVolumein interfacePlayer
-
setDeviceVolume
public void setDeviceVolume(int volume, @com.google.android.exoplayer2.C.VolumeFlags int flags)Deprecated.Description copied from interface:PlayerSets the volume of the device with volume flags.This method must only be called if
Player.COMMAND_SET_DEVICE_VOLUME_WITH_FLAGSis available.- Specified by:
setDeviceVolumein interfacePlayer- Parameters:
volume- The volume to set.flags- Either 0 or a bitwise combination of one or moreC.VolumeFlags.
-
increaseDeviceVolume
@Deprecated public void increaseDeviceVolume()
Deprecated.UseincreaseDeviceVolume(int)instead.- Specified by:
increaseDeviceVolumein interfaceExoPlayer.DeviceComponent- Specified by:
increaseDeviceVolumein interfacePlayer
-
increaseDeviceVolume
public void increaseDeviceVolume(@com.google.android.exoplayer2.C.VolumeFlags int flags)
Deprecated.Description copied from interface:PlayerIncreases the volume of the device.The
Player.getDeviceVolume()device volume cannot be increased aboveDeviceInfo.maxVolume, if defined.This method must only be called if
Player.COMMAND_ADJUST_DEVICE_VOLUME_WITH_FLAGSis available.- Specified by:
increaseDeviceVolumein interfacePlayer- Parameters:
flags- Either 0 or a bitwise combination of one or moreC.VolumeFlags.
-
decreaseDeviceVolume
@Deprecated public void decreaseDeviceVolume()
Deprecated.UsedecreaseDeviceVolume(int)instead.- Specified by:
decreaseDeviceVolumein interfaceExoPlayer.DeviceComponent- Specified by:
decreaseDeviceVolumein interfacePlayer
-
decreaseDeviceVolume
public void decreaseDeviceVolume(@com.google.android.exoplayer2.C.VolumeFlags int flags)
Deprecated.Description copied from interface:PlayerDecreases the volume of the device.The
Player.getDeviceVolume()device volume cannot be decreased belowDeviceInfo.minVolume.This method must only be called if
Player.COMMAND_ADJUST_DEVICE_VOLUME_WITH_FLAGSis available.- Specified by:
decreaseDeviceVolumein interfacePlayer- Parameters:
flags- Either 0 or a bitwise combination of one or moreC.VolumeFlags.
-
setDeviceMuted
@Deprecated public void setDeviceMuted(boolean muted)
Deprecated.UsesetDeviceMuted(boolean, int)instead.- Specified by:
setDeviceMutedin interfaceExoPlayer.DeviceComponent- Specified by:
setDeviceMutedin interfacePlayer
-
setDeviceMuted
public void setDeviceMuted(boolean muted, @com.google.android.exoplayer2.C.VolumeFlags int flags)Deprecated.Description copied from interface:PlayerSets the mute state of the device.This method must only be called if
Player.COMMAND_ADJUST_DEVICE_VOLUME_WITH_FLAGSis available.- Specified by:
setDeviceMutedin interfacePlayer- Parameters:
muted- Whether to set the device to be muted or notflags- Either 0 or a bitwise combination of one or moreC.VolumeFlags.
-
isTunnelingEnabled
public boolean isTunnelingEnabled()
Deprecated.Description copied from interface:ExoPlayerReturns whether tunneling is enabled for the currently selected tracks.- Specified by:
isTunnelingEnabledin interfaceExoPlayer- See Also:
Player.Listener.onTracksChanged(Tracks)
-
-