Package com.google.android.exoplayer2
Class ForwardingPlayer
- java.lang.Object
-
- com.google.android.exoplayer2.ForwardingPlayer
-
-
Nested Class Summary
-
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 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_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_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 Constructor Description ForwardingPlayer(Player player)Creates a new instance that forwards all operations toplayer.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaddListener(Player.Listener listener)CallsPlayer.addListener(Listener)on the delegate.voidaddMediaItem(int index, MediaItem mediaItem)CallsPlayer.addMediaItem(int, MediaItem)on the delegate.voidaddMediaItem(MediaItem mediaItem)CallsPlayer.addMediaItem(MediaItem)on the delegate.voidaddMediaItems(int index, List<MediaItem> mediaItems)CallsPlayer.addMediaItems(int, List)on the delegate.voidaddMediaItems(List<MediaItem> mediaItems)CallsPlayer.addMediaItems(List)on the delegate.booleancanAdvertiseSession()CallsPlayer.canAdvertiseSession()on the delegate and returns the result.voidclearMediaItems()CallsPlayer.clearMediaItems()on the delegate.voidclearVideoSurface()CallsPlayer.clearVideoSurface()on the delegate.voidclearVideoSurface(Surface surface)CallsPlayer.clearVideoSurface(Surface)on the delegate.voidclearVideoSurfaceHolder(SurfaceHolder surfaceHolder)CallsPlayer.clearVideoSurfaceHolder(SurfaceHolder)on the delegate.voidclearVideoSurfaceView(SurfaceView surfaceView)CallsPlayer.clearVideoSurfaceView(SurfaceView)on the delegate.voidclearVideoTextureView(TextureView textureView)CallsPlayer.clearVideoTextureView(TextureView)on the delegate.voiddecreaseDeviceVolume()CallsPlayer.decreaseDeviceVolume()on the delegate.LoopergetApplicationLooper()CallsPlayer.getApplicationLooper()on the delegate and returns the result.AudioAttributesgetAudioAttributes()CallsPlayer.getAudioAttributes()on the delegate and returns the result.Player.CommandsgetAvailableCommands()CallsPlayer.getAvailableCommands()on the delegate and returns the result.intgetBufferedPercentage()CallsPlayer.getBufferedPercentage()on the delegate and returns the result.longgetBufferedPosition()CallsPlayer.getBufferedPosition()on the delegate and returns the result.longgetContentBufferedPosition()CallsPlayer.getContentBufferedPosition()on the delegate and returns the result.longgetContentDuration()CallsPlayer.getContentDuration()on the delegate and returns the result.longgetContentPosition()CallsPlayer.getContentPosition()on the delegate and returns the result.intgetCurrentAdGroupIndex()CallsPlayer.getCurrentAdGroupIndex()on the delegate and returns the result.intgetCurrentAdIndexInAdGroup()CallsPlayer.getCurrentAdIndexInAdGroup()on the delegate and returns the result.List<Cue>getCurrentCues()CallsPlayer.getCurrentCues()on the delegate and returns the result.longgetCurrentLiveOffset()CallsPlayer.getCurrentLiveOffset()on the delegate and returns the result.ObjectgetCurrentManifest()CallsPlayer.getCurrentManifest()on the delegate and returns the result.MediaItemgetCurrentMediaItem()CallsPlayer.getCurrentMediaItem()on the delegate and returns the result.intgetCurrentMediaItemIndex()CallsPlayer.getCurrentMediaItemIndex()on the delegate and returns the result.intgetCurrentPeriodIndex()CallsPlayer.getCurrentPeriodIndex()on the delegate and returns the result.longgetCurrentPosition()CallsPlayer.getCurrentPosition()on the delegate and returns the result.TimelinegetCurrentTimeline()CallsPlayer.getCurrentTimeline()on the delegate and returns the result.TrackGroupArraygetCurrentTrackGroups()Deprecated.TrackSelectionArraygetCurrentTrackSelections()Deprecated.TracksInfogetCurrentTracksInfo()CallsPlayer.getCurrentTracksInfo()on the delegate and returns the result.intgetCurrentWindowIndex()Deprecated.DeviceInfogetDeviceInfo()CallsPlayer.getDeviceInfo()on the delegate and returns the result.intgetDeviceVolume()CallsPlayer.getDeviceVolume()on the delegate and returns the result.longgetDuration()CallsPlayer.getDuration()on the delegate and returns the result.longgetMaxSeekToPreviousPosition()CallsPlayer.getMaxSeekToPreviousPosition()on the delegate and returns the result.MediaItemgetMediaItemAt(int index)CallsPlayer.getMediaItemAt(int)on the delegate and returns the result.intgetMediaItemCount()CallsPlayer.getMediaItemCount()on the delegate and returns the result.MediaMetadatagetMediaMetadata()CallsPlayer.getMediaMetadata()on the delegate and returns the result.intgetNextMediaItemIndex()CallsPlayer.getNextMediaItemIndex()on the delegate and returns the result.intgetNextWindowIndex()Deprecated.PlaybackParametersgetPlaybackParameters()CallsPlayer.getPlaybackParameters()on the delegate and returns the result.intgetPlaybackState()CallsPlayer.getPlaybackState()on the delegate and returns the result.intgetPlaybackSuppressionReason()CallsPlayer.getPlaybackSuppressionReason()on the delegate and returns the result.PlaybackExceptiongetPlayerError()CallsPlayer.getPlayerError()on the delegate and returns the result.MediaMetadatagetPlaylistMetadata()CallsPlayer.getPlaylistMetadata()on the delegate and returns the result.booleangetPlayWhenReady()CallsPlayer.getPlayWhenReady()on the delegate and returns the result.intgetPreviousMediaItemIndex()CallsPlayer.getPreviousMediaItemIndex()on the delegate and returns the result.intgetPreviousWindowIndex()Deprecated.intgetRepeatMode()CallsPlayer.getRepeatMode()on the delegate and returns the result.longgetSeekBackIncrement()CallsPlayer.getSeekBackIncrement()on the delegate and returns the result.longgetSeekForwardIncrement()CallsPlayer.getSeekForwardIncrement()on the delegate and returns the result.booleangetShuffleModeEnabled()CallsPlayer.getShuffleModeEnabled()on the delegate and returns the result.longgetTotalBufferedDuration()CallsPlayer.getTotalBufferedDuration()on the delegate and returns the result.TrackSelectionParametersgetTrackSelectionParameters()CallsPlayer.getTrackSelectionParameters()on the delegate and returns the result.VideoSizegetVideoSize()CallsPlayer.getVideoSize()on the delegate and returns the result.floatgetVolume()CallsPlayer.getVolume()on the delegate and returns the result.PlayergetWrappedPlayer()Returns thePlayerto which operations are forwarded.booleanhasNext()Deprecated.booleanhasNextMediaItem()CallsPlayer.hasNextMediaItem()on the delegate and returns the result.booleanhasNextWindow()Deprecated.booleanhasPrevious()Deprecated.booleanhasPreviousMediaItem()CallsPlayer.hasPreviousMediaItem()on the delegate and returns the result.booleanhasPreviousWindow()Deprecated.voidincreaseDeviceVolume()CallsPlayer.increaseDeviceVolume()on the delegate.booleanisCommandAvailable(@com.google.android.exoplayer2.Player.Command int command)CallsPlayer.isCommandAvailable(int)on the delegate and returns the result.booleanisCurrentMediaItemDynamic()CallsPlayer.isCurrentMediaItemDynamic()on the delegate and returns the result.booleanisCurrentMediaItemLive()CallsPlayer.isCurrentMediaItemLive()on the delegate and returns the result.booleanisCurrentMediaItemSeekable()CallsPlayer.isCurrentMediaItemSeekable()on the delegate and returns the result.booleanisCurrentWindowDynamic()Deprecated.booleanisCurrentWindowLive()Deprecated.booleanisCurrentWindowSeekable()Deprecated.booleanisDeviceMuted()CallsPlayer.isDeviceMuted()on the delegate and returns the result.booleanisLoading()CallsPlayer.isLoading()on the delegate and returns the result.booleanisPlaying()CallsPlayer.isPlaying()on the delegate and returns the result.booleanisPlayingAd()CallsPlayer.isPlayingAd()on the delegate and returns the result.voidmoveMediaItem(int currentIndex, int newIndex)CallsPlayer.moveMediaItem(int, int)on the delegate.voidmoveMediaItems(int fromIndex, int toIndex, int newIndex)CallsPlayer.moveMediaItems(int, int, int)on the delegate.voidnext()Deprecated.voidpause()CallsPlayer.pause()on the delegate.voidplay()CallsPlayer.play()on the delegate.voidprepare()CallsPlayer.prepare()on the delegate.voidprevious()Deprecated.voidrelease()CallsPlayer.release()on the delegate.voidremoveListener(Player.Listener listener)CallsPlayer.removeListener(Listener)on the delegate.voidremoveMediaItem(int index)CallsPlayer.removeMediaItem(int)on the delegate.voidremoveMediaItems(int fromIndex, int toIndex)CallsPlayer.removeMediaItems(int, int)on the delegate.voidseekBack()CallsPlayer.seekBack()on the delegate.voidseekForward()CallsPlayer.seekForward()on the delegate.voidseekTo(int mediaItemIndex, long positionMs)CallsPlayer.seekTo(int, long)on the delegate.voidseekTo(long positionMs)CallsPlayer.seekTo(long)on the delegate.voidseekToDefaultPosition()CallsPlayer.seekToDefaultPosition()on the delegate.voidseekToDefaultPosition(int mediaItemIndex)CallsPlayer.seekToDefaultPosition(int)on the delegate.voidseekToNext()CallsPlayer.seekToNext()on the delegate.voidseekToNextMediaItem()CallsPlayer.seekToNextMediaItem()on the delegate.voidseekToNextWindow()Deprecated.voidseekToPrevious()CallsPlayer.seekToPrevious()on the delegate.voidseekToPreviousMediaItem()CallsPlayer.seekToPreviousMediaItem()on the delegate.voidseekToPreviousWindow()Deprecated.voidsetDeviceMuted(boolean muted)CallsPlayer.setDeviceMuted(boolean)on the delegate.voidsetDeviceVolume(int volume)CallsPlayer.setDeviceVolume(int)on the delegate.voidsetMediaItem(MediaItem mediaItem)CallsPlayer.setMediaItem(MediaItem)on the delegate.voidsetMediaItem(MediaItem mediaItem, boolean resetPosition)CallsPlayer.setMediaItem(MediaItem, boolean)on the delegate.voidsetMediaItem(MediaItem mediaItem, long startPositionMs)CallsPlayer.setMediaItem(MediaItem, long)on the delegate.voidsetMediaItems(List<MediaItem> mediaItems)CallsPlayer.setMediaItems(List)on the delegate.voidsetMediaItems(List<MediaItem> mediaItems, boolean resetPosition)CallsPlayer.setMediaItems(List, boolean)()} on the delegate.voidsetMediaItems(List<MediaItem> mediaItems, int startIndex, long startPositionMs)CallsPlayer.setMediaItems(List, int, long)on the delegate.voidsetPlaybackParameters(PlaybackParameters playbackParameters)CallsPlayer.setPlaybackParameters(PlaybackParameters)on the delegate.voidsetPlaybackSpeed(float speed)CallsPlayer.setPlaybackSpeed(float)on the delegate.voidsetPlaylistMetadata(MediaMetadata mediaMetadata)CallsPlayer.setPlaylistMetadata(MediaMetadata)on the delegate.voidsetPlayWhenReady(boolean playWhenReady)CallsPlayer.setPlayWhenReady(boolean)on the delegate.voidsetRepeatMode(@com.google.android.exoplayer2.Player.RepeatMode int repeatMode)CallsPlayer.setRepeatMode(int)on the delegate.voidsetShuffleModeEnabled(boolean shuffleModeEnabled)CallsPlayer.setShuffleModeEnabled(boolean)on the delegate.voidsetTrackSelectionParameters(TrackSelectionParameters parameters)CallsPlayer.setTrackSelectionParameters(TrackSelectionParameters)on the delegate.voidsetVideoSurface(Surface surface)CallsPlayer.setVideoSurface(Surface)on the delegate.voidsetVideoSurfaceHolder(SurfaceHolder surfaceHolder)CallsPlayer.setVideoSurfaceHolder(SurfaceHolder)on the delegate.voidsetVideoSurfaceView(SurfaceView surfaceView)CallsPlayer.setVideoSurfaceView(SurfaceView)on the delegate.voidsetVideoTextureView(TextureView textureView)CallsPlayer.setVideoTextureView(TextureView)on the delegate.voidsetVolume(float volume)CallsPlayer.setVolume(float)on the delegate.voidstop()CallsPlayer.stop()on the delegate.voidstop(boolean reset)Deprecated.
-
-
-
Constructor Detail
-
ForwardingPlayer
public ForwardingPlayer(Player player)
Creates a new instance that forwards all operations toplayer.
-
-
Method Detail
-
getApplicationLooper
public Looper getApplicationLooper()
CallsPlayer.getApplicationLooper()on the delegate and returns the result.- Specified by:
getApplicationLooperin interfacePlayer
-
addListener
public void addListener(Player.Listener listener)
CallsPlayer.addListener(Listener)on the delegate.- Specified by:
addListenerin interfacePlayer- Parameters:
listener- The listener to register.
-
removeListener
public void removeListener(Player.Listener listener)
CallsPlayer.removeListener(Listener)on the delegate.- Specified by:
removeListenerin interfacePlayer- Parameters:
listener- The listener to unregister.
-
setMediaItems
public void setMediaItems(List<MediaItem> mediaItems)
CallsPlayer.setMediaItems(List)on the delegate.- Specified by:
setMediaItemsin interfacePlayer- Parameters:
mediaItems- The newMediaItems.
-
setMediaItems
public void setMediaItems(List<MediaItem> mediaItems, boolean resetPosition)
CallsPlayer.setMediaItems(List, boolean)()} on the delegate.- Specified by:
setMediaItemsin 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)
CallsPlayer.setMediaItems(List, int, long)on the delegate.- Specified by:
setMediaItemsin interfacePlayer- Parameters:
mediaItems- The newMediaItems.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.
-
setMediaItem
public void setMediaItem(MediaItem mediaItem)
CallsPlayer.setMediaItem(MediaItem)on the delegate.- Specified by:
setMediaItemin interfacePlayer- Parameters:
mediaItem- The newMediaItem.
-
setMediaItem
public void setMediaItem(MediaItem mediaItem, long startPositionMs)
CallsPlayer.setMediaItem(MediaItem, long)on the delegate.- Specified by:
setMediaItemin interfacePlayer- Parameters:
mediaItem- The newMediaItem.startPositionMs- The position in milliseconds to start playback from.
-
setMediaItem
public void setMediaItem(MediaItem mediaItem, boolean resetPosition)
CallsPlayer.setMediaItem(MediaItem, boolean)on the delegate.- Specified by:
setMediaItemin interfacePlayer- Parameters:
mediaItem- The newMediaItem.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().
-
addMediaItem
public void addMediaItem(MediaItem mediaItem)
CallsPlayer.addMediaItem(MediaItem)on the delegate.- Specified by:
addMediaItemin interfacePlayer- Parameters:
mediaItem- TheMediaItemto add.
-
addMediaItem
public void addMediaItem(int index, MediaItem mediaItem)CallsPlayer.addMediaItem(int, MediaItem)on the delegate.- Specified by:
addMediaItemin interfacePlayer- Parameters:
index- The index at which to add the media item. If the index is larger than the size of the playlist, the media item is added to the end of the playlist.mediaItem- TheMediaItemto add.
-
addMediaItems
public void addMediaItems(List<MediaItem> mediaItems)
CallsPlayer.addMediaItems(List)on the delegate.- Specified by:
addMediaItemsin interfacePlayer- Parameters:
mediaItems- TheMediaItemsto add.
-
addMediaItems
public void addMediaItems(int index, List<MediaItem> mediaItems)CallsPlayer.addMediaItems(int, List)on the delegate.- 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- TheMediaItemsto add.
-
moveMediaItem
public void moveMediaItem(int currentIndex, int newIndex)CallsPlayer.moveMediaItem(int, int)on the delegate.- Specified by:
moveMediaItemin interfacePlayer- Parameters:
currentIndex- The current index of the media item to move.newIndex- The new index of the media item. If the new index is larger than the size of the playlist the item is moved to the end of the playlist.
-
moveMediaItems
public void moveMediaItems(int fromIndex, int toIndex, int newIndex)CallsPlayer.moveMediaItems(int, int, int)on the delegate.- Specified by:
moveMediaItemsin 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.
-
removeMediaItem
public void removeMediaItem(int index)
CallsPlayer.removeMediaItem(int)on the delegate.- Specified by:
removeMediaItemin interfacePlayer- Parameters:
index- The index at which to remove the media item.
-
removeMediaItems
public void removeMediaItems(int fromIndex, int toIndex)CallsPlayer.removeMediaItems(int, int)on the delegate.- Specified by:
removeMediaItemsin 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.
-
clearMediaItems
public void clearMediaItems()
CallsPlayer.clearMediaItems()on the delegate.- Specified by:
clearMediaItemsin interfacePlayer
-
isCommandAvailable
public boolean isCommandAvailable(@Command @com.google.android.exoplayer2.Player.Command int command)
CallsPlayer.isCommandAvailable(int)on the delegate and returns the result.- Specified by:
isCommandAvailablein interfacePlayer- Parameters:
command- APlayer.Command.- Returns:
- Whether the
Player.Commandis available. - See Also:
Player.Listener.onAvailableCommandsChanged(Commands)
-
canAdvertiseSession
public boolean canAdvertiseSession()
CallsPlayer.canAdvertiseSession()on the delegate and returns the result.- Specified by:
canAdvertiseSessionin interfacePlayer
-
getAvailableCommands
public Player.Commands getAvailableCommands()
CallsPlayer.getAvailableCommands()on the delegate and returns the result.- 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()
CallsPlayer.prepare()on the delegate.
-
getPlaybackState
public int getPlaybackState()
CallsPlayer.getPlaybackState()on the delegate and returns the result.- Specified by:
getPlaybackStatein interfacePlayer- Returns:
- The current
playback state. - See Also:
Player.Listener.onPlaybackStateChanged(int)
-
getPlaybackSuppressionReason
public int getPlaybackSuppressionReason()
CallsPlayer.getPlaybackSuppressionReason()on the delegate and returns the result.- Specified by:
getPlaybackSuppressionReasonin interfacePlayer- Returns:
- The current
playback suppression reason. - See Also:
Player.Listener.onPlaybackSuppressionReasonChanged(int)
-
isPlaying
public boolean isPlaying()
CallsPlayer.isPlaying()on the delegate and returns the result.- Specified by:
isPlayingin interfacePlayer- Returns:
- Whether the player is playing.
- See Also:
Player.Listener.onIsPlayingChanged(boolean)
-
getPlayerError
@Nullable public PlaybackException getPlayerError()
CallsPlayer.getPlayerError()on the delegate and returns the result.- Specified by:
getPlayerErrorin interfacePlayer- Returns:
- The error, or
null. - See Also:
Player.Listener.onPlayerError(PlaybackException)
-
play
public void play()
CallsPlayer.play()on the delegate.
-
pause
public void pause()
CallsPlayer.pause()on the delegate.
-
setPlayWhenReady
public void setPlayWhenReady(boolean playWhenReady)
CallsPlayer.setPlayWhenReady(boolean)on the delegate.- Specified by:
setPlayWhenReadyin interfacePlayer- Parameters:
playWhenReady- Whether playback should proceed when ready.
-
getPlayWhenReady
public boolean getPlayWhenReady()
CallsPlayer.getPlayWhenReady()on the delegate and returns the result.- Specified by:
getPlayWhenReadyin interfacePlayer- Returns:
- Whether playback will proceed when ready.
- See Also:
Player.Listener.onPlayWhenReadyChanged(boolean, int)
-
setRepeatMode
public void setRepeatMode(@RepeatMode @com.google.android.exoplayer2.Player.RepeatMode int repeatMode)
CallsPlayer.setRepeatMode(int)on the delegate.- Specified by:
setRepeatModein interfacePlayer- Parameters:
repeatMode- The repeat mode.
-
getRepeatMode
public int getRepeatMode()
CallsPlayer.getRepeatMode()on the delegate and returns the result.- Specified by:
getRepeatModein interfacePlayer- Returns:
- The current repeat mode.
- See Also:
Player.Listener.onRepeatModeChanged(int)
-
setShuffleModeEnabled
public void setShuffleModeEnabled(boolean shuffleModeEnabled)
CallsPlayer.setShuffleModeEnabled(boolean)on the delegate.- Specified by:
setShuffleModeEnabledin interfacePlayer- Parameters:
shuffleModeEnabled- Whether shuffling is enabled.
-
getShuffleModeEnabled
public boolean getShuffleModeEnabled()
CallsPlayer.getShuffleModeEnabled()on the delegate and returns the result.- Specified by:
getShuffleModeEnabledin interfacePlayer- See Also:
Player.Listener.onShuffleModeEnabledChanged(boolean)
-
isLoading
public boolean isLoading()
CallsPlayer.isLoading()on the delegate and returns the result.- Specified by:
isLoadingin interfacePlayer- Returns:
- Whether the player is currently loading the source.
- See Also:
Player.Listener.onIsLoadingChanged(boolean)
-
seekToDefaultPosition
public void seekToDefaultPosition()
CallsPlayer.seekToDefaultPosition()on the delegate.- Specified by:
seekToDefaultPositionin interfacePlayer
-
seekToDefaultPosition
public void seekToDefaultPosition(int mediaItemIndex)
CallsPlayer.seekToDefaultPosition(int)on the delegate.- Specified by:
seekToDefaultPositionin interfacePlayer- Parameters:
mediaItemIndex- The index of theMediaItemwhose associated default position should be seeked to.
-
seekTo
public void seekTo(long positionMs)
CallsPlayer.seekTo(long)on the delegate.- Specified by:
seekToin interfacePlayer- Parameters:
positionMs- The seek position in the currentMediaItem, orC.TIME_UNSETto seek to the media item's default position.
-
seekTo
public void seekTo(int mediaItemIndex, long positionMs)CallsPlayer.seekTo(int, long)on the delegate.- Specified by:
seekToin interfacePlayer- Parameters:
mediaItemIndex- The index of theMediaItem.positionMs- The seek position in the specifiedMediaItem, orC.TIME_UNSETto seek to the media item's default position.
-
getSeekBackIncrement
public long getSeekBackIncrement()
CallsPlayer.getSeekBackIncrement()on the delegate and returns the result.- Specified by:
getSeekBackIncrementin interfacePlayer- Returns:
- The seek back increment, in milliseconds.
- See Also:
Player.Listener.onSeekBackIncrementChanged(long)
-
seekBack
public void seekBack()
CallsPlayer.seekBack()on the delegate.
-
getSeekForwardIncrement
public long getSeekForwardIncrement()
CallsPlayer.getSeekForwardIncrement()on the delegate and returns the result.- Specified by:
getSeekForwardIncrementin interfacePlayer- Returns:
- The seek forward increment, in milliseconds.
- See Also:
Player.Listener.onSeekForwardIncrementChanged(long)
-
seekForward
public void seekForward()
CallsPlayer.seekForward()on the delegate.- Specified by:
seekForwardin interfacePlayer
-
hasPrevious
@Deprecated public boolean hasPrevious()
Deprecated.CallsPlayer.hasPrevious()on the delegate and returns the result.- Specified by:
hasPreviousin interfacePlayer
-
hasPreviousWindow
@Deprecated public boolean hasPreviousWindow()
Deprecated.CallsPlayer.hasPreviousWindow()on the delegate and returns the result.- Specified by:
hasPreviousWindowin interfacePlayer
-
hasPreviousMediaItem
public boolean hasPreviousMediaItem()
CallsPlayer.hasPreviousMediaItem()on the delegate and returns the result.- Specified by:
hasPreviousMediaItemin interfacePlayer
-
previous
@Deprecated public void previous()
Deprecated.CallsPlayer.previous()on the delegate.
-
seekToPreviousWindow
@Deprecated public void seekToPreviousWindow()
Deprecated.CallsPlayer.seekToPreviousWindow()on the delegate.- Specified by:
seekToPreviousWindowin interfacePlayer
-
seekToPreviousMediaItem
public void seekToPreviousMediaItem()
CallsPlayer.seekToPreviousMediaItem()on the delegate.- Specified by:
seekToPreviousMediaItemin interfacePlayer
-
seekToPrevious
public void seekToPrevious()
CallsPlayer.seekToPrevious()on the delegate.- Specified by:
seekToPreviousin interfacePlayer
-
getMaxSeekToPreviousPosition
public long getMaxSeekToPreviousPosition()
CallsPlayer.getMaxSeekToPreviousPosition()on the delegate and returns the result.- Specified by:
getMaxSeekToPreviousPositionin interfacePlayer- Returns:
- The maximum seek to previous position, in milliseconds.
- See Also:
Player.Listener.onMaxSeekToPreviousPositionChanged(long)
-
hasNext
@Deprecated public boolean hasNext()
Deprecated.CallsPlayer.hasNext()on the delegate and returns the result.
-
hasNextWindow
@Deprecated public boolean hasNextWindow()
Deprecated.CallsPlayer.hasNextWindow()on the delegate and returns the result.- Specified by:
hasNextWindowin interfacePlayer
-
hasNextMediaItem
public boolean hasNextMediaItem()
CallsPlayer.hasNextMediaItem()on the delegate and returns the result.- Specified by:
hasNextMediaItemin interfacePlayer
-
next
@Deprecated public void next()
Deprecated.CallsPlayer.next()on the delegate.
-
seekToNextWindow
@Deprecated public void seekToNextWindow()
Deprecated.CallsPlayer.seekToNextWindow()on the delegate.- Specified by:
seekToNextWindowin interfacePlayer
-
seekToNextMediaItem
public void seekToNextMediaItem()
CallsPlayer.seekToNextMediaItem()on the delegate.- Specified by:
seekToNextMediaItemin interfacePlayer
-
seekToNext
public void seekToNext()
CallsPlayer.seekToNext()on the delegate.- Specified by:
seekToNextin interfacePlayer
-
setPlaybackParameters
public void setPlaybackParameters(PlaybackParameters playbackParameters)
CallsPlayer.setPlaybackParameters(PlaybackParameters)on the delegate.- Specified by:
setPlaybackParametersin interfacePlayer- Parameters:
playbackParameters- The playback parameters.
-
setPlaybackSpeed
public void setPlaybackSpeed(float speed)
CallsPlayer.setPlaybackSpeed(float)on the delegate.- Specified by:
setPlaybackSpeedin interfacePlayer- Parameters:
speed- The linear factor by which playback will be sped up. Must be higher than 0. 1 is normal speed, 2 is twice as fast, 0.5 is half normal speed...
-
getPlaybackParameters
public PlaybackParameters getPlaybackParameters()
CallsPlayer.getPlaybackParameters()on the delegate and returns the result.- Specified by:
getPlaybackParametersin interfacePlayer- See Also:
Player.Listener.onPlaybackParametersChanged(PlaybackParameters)
-
stop
public void stop()
CallsPlayer.stop()on the delegate.
-
stop
@Deprecated public void stop(boolean reset)
Deprecated.CallsPlayer.stop(boolean)on the delegate.
-
release
public void release()
CallsPlayer.release()on the delegate.
-
getCurrentTrackGroups
@Deprecated public TrackGroupArray getCurrentTrackGroups()
Deprecated.CallsPlayer.getCurrentTrackGroups()on the delegate and returns the result.- Specified by:
getCurrentTrackGroupsin interfacePlayer- See Also:
Player.Listener.onTracksChanged(TrackGroupArray, TrackSelectionArray)
-
getCurrentTrackSelections
@Deprecated public TrackSelectionArray getCurrentTrackSelections()
Deprecated.CallsPlayer.getCurrentTrackSelections()on the delegate and returns the result.- Specified by:
getCurrentTrackSelectionsin interfacePlayer- See Also:
Player.Listener.onTracksChanged(TrackGroupArray, TrackSelectionArray)
-
getCurrentTracksInfo
public TracksInfo getCurrentTracksInfo()
CallsPlayer.getCurrentTracksInfo()on the delegate and returns the result.- Specified by:
getCurrentTracksInfoin interfacePlayer- See Also:
Player.Listener.onTracksChanged(TrackGroupArray, TrackSelectionArray)
-
getTrackSelectionParameters
public TrackSelectionParameters getTrackSelectionParameters()
CallsPlayer.getTrackSelectionParameters()on the delegate and returns the result.- Specified by:
getTrackSelectionParametersin interfacePlayer- See Also:
}
-
setTrackSelectionParameters
public void setTrackSelectionParameters(TrackSelectionParameters parameters)
CallsPlayer.setTrackSelectionParameters(TrackSelectionParameters)on the delegate.- Specified by:
setTrackSelectionParametersin interfacePlayer
-
getMediaMetadata
public MediaMetadata getMediaMetadata()
CallsPlayer.getMediaMetadata()on the delegate and returns the result.- Specified by:
getMediaMetadatain interfacePlayer
-
getPlaylistMetadata
public MediaMetadata getPlaylistMetadata()
CallsPlayer.getPlaylistMetadata()on the delegate and returns the result.- Specified by:
getPlaylistMetadatain interfacePlayer
-
setPlaylistMetadata
public void setPlaylistMetadata(MediaMetadata mediaMetadata)
CallsPlayer.setPlaylistMetadata(MediaMetadata)on the delegate.- Specified by:
setPlaylistMetadatain interfacePlayer
-
getCurrentManifest
@Nullable public Object getCurrentManifest()
CallsPlayer.getCurrentManifest()on the delegate and returns the result.- Specified by:
getCurrentManifestin interfacePlayer
-
getCurrentTimeline
public Timeline getCurrentTimeline()
CallsPlayer.getCurrentTimeline()on the delegate and returns the result.- Specified by:
getCurrentTimelinein interfacePlayer- See Also:
Player.Listener.onTimelineChanged(Timeline, int)
-
getCurrentPeriodIndex
public int getCurrentPeriodIndex()
CallsPlayer.getCurrentPeriodIndex()on the delegate and returns the result.- Specified by:
getCurrentPeriodIndexin interfacePlayer
-
getCurrentWindowIndex
@Deprecated public int getCurrentWindowIndex()
Deprecated.CallsPlayer.getCurrentWindowIndex()on the delegate and returns the result.- Specified by:
getCurrentWindowIndexin interfacePlayer
-
getCurrentMediaItemIndex
public int getCurrentMediaItemIndex()
CallsPlayer.getCurrentMediaItemIndex()on the delegate and returns the result.- Specified by:
getCurrentMediaItemIndexin interfacePlayer
-
getNextWindowIndex
@Deprecated public int getNextWindowIndex()
Deprecated.CallsPlayer.getNextWindowIndex()on the delegate and returns the result.- Specified by:
getNextWindowIndexin interfacePlayer
-
getNextMediaItemIndex
public int getNextMediaItemIndex()
CallsPlayer.getNextMediaItemIndex()on the delegate and returns the result.- Specified by:
getNextMediaItemIndexin interfacePlayer
-
getPreviousWindowIndex
@Deprecated public int getPreviousWindowIndex()
Deprecated.CallsPlayer.getPreviousWindowIndex()on the delegate and returns the result.- Specified by:
getPreviousWindowIndexin interfacePlayer
-
getPreviousMediaItemIndex
public int getPreviousMediaItemIndex()
CallsPlayer.getPreviousMediaItemIndex()on the delegate and returns the result.- Specified by:
getPreviousMediaItemIndexin interfacePlayer
-
getCurrentMediaItem
@Nullable public MediaItem getCurrentMediaItem()
CallsPlayer.getCurrentMediaItem()on the delegate and returns the result.- Specified by:
getCurrentMediaItemin interfacePlayer- See Also:
Player.Listener.onMediaItemTransition(MediaItem, int)
-
getMediaItemCount
public int getMediaItemCount()
CallsPlayer.getMediaItemCount()on the delegate and returns the result.- Specified by:
getMediaItemCountin interfacePlayer
-
getMediaItemAt
public MediaItem getMediaItemAt(int index)
CallsPlayer.getMediaItemAt(int)on the delegate and returns the result.- Specified by:
getMediaItemAtin interfacePlayer
-
getDuration
public long getDuration()
CallsPlayer.getDuration()on the delegate and returns the result.- Specified by:
getDurationin interfacePlayer
-
getCurrentPosition
public long getCurrentPosition()
CallsPlayer.getCurrentPosition()on the delegate and returns the result.- Specified by:
getCurrentPositionin interfacePlayer
-
getBufferedPosition
public long getBufferedPosition()
CallsPlayer.getBufferedPosition()on the delegate and returns the result.- Specified by:
getBufferedPositionin interfacePlayer
-
getBufferedPercentage
public int getBufferedPercentage()
CallsPlayer.getBufferedPercentage()on the delegate and returns the result.- Specified by:
getBufferedPercentagein interfacePlayer
-
getTotalBufferedDuration
public long getTotalBufferedDuration()
CallsPlayer.getTotalBufferedDuration()on the delegate and returns the result.- Specified by:
getTotalBufferedDurationin interfacePlayer
-
isCurrentWindowDynamic
@Deprecated public boolean isCurrentWindowDynamic()
Deprecated.CallsPlayer.isCurrentWindowDynamic()on the delegate and returns the result.- Specified by:
isCurrentWindowDynamicin interfacePlayer
-
isCurrentMediaItemDynamic
public boolean isCurrentMediaItemDynamic()
CallsPlayer.isCurrentMediaItemDynamic()on the delegate and returns the result.- Specified by:
isCurrentMediaItemDynamicin interfacePlayer- See Also:
Timeline.Window.isDynamic
-
isCurrentWindowLive
@Deprecated public boolean isCurrentWindowLive()
Deprecated.CallsPlayer.isCurrentWindowLive()on the delegate and returns the result.- Specified by:
isCurrentWindowLivein interfacePlayer
-
isCurrentMediaItemLive
public boolean isCurrentMediaItemLive()
CallsPlayer.isCurrentMediaItemLive()on the delegate and returns the result.- Specified by:
isCurrentMediaItemLivein interfacePlayer- See Also:
Timeline.Window.isLive()
-
getCurrentLiveOffset
public long getCurrentLiveOffset()
CallsPlayer.getCurrentLiveOffset()on the delegate and returns the result.- Specified by:
getCurrentLiveOffsetin interfacePlayer
-
isCurrentWindowSeekable
@Deprecated public boolean isCurrentWindowSeekable()
Deprecated.CallsPlayer.isCurrentWindowSeekable()on the delegate and returns the result.- Specified by:
isCurrentWindowSeekablein interfacePlayer
-
isCurrentMediaItemSeekable
public boolean isCurrentMediaItemSeekable()
CallsPlayer.isCurrentMediaItemSeekable()on the delegate and returns the result.- Specified by:
isCurrentMediaItemSeekablein interfacePlayer- See Also:
Timeline.Window.isSeekable
-
isPlayingAd
public boolean isPlayingAd()
CallsPlayer.isPlayingAd()on the delegate and returns the result.- Specified by:
isPlayingAdin interfacePlayer
-
getCurrentAdGroupIndex
public int getCurrentAdGroupIndex()
CallsPlayer.getCurrentAdGroupIndex()on the delegate and returns the result.- Specified by:
getCurrentAdGroupIndexin interfacePlayer
-
getCurrentAdIndexInAdGroup
public int getCurrentAdIndexInAdGroup()
CallsPlayer.getCurrentAdIndexInAdGroup()on the delegate and returns the result.- Specified by:
getCurrentAdIndexInAdGroupin interfacePlayer
-
getContentDuration
public long getContentDuration()
CallsPlayer.getContentDuration()on the delegate and returns the result.- Specified by:
getContentDurationin interfacePlayer
-
getContentPosition
public long getContentPosition()
CallsPlayer.getContentPosition()on the delegate and returns the result.- Specified by:
getContentPositionin interfacePlayer
-
getContentBufferedPosition
public long getContentBufferedPosition()
CallsPlayer.getContentBufferedPosition()on the delegate and returns the result.- Specified by:
getContentBufferedPositionin interfacePlayer
-
getAudioAttributes
public AudioAttributes getAudioAttributes()
CallsPlayer.getAudioAttributes()on the delegate and returns the result.- Specified by:
getAudioAttributesin interfacePlayer
-
setVolume
public void setVolume(float volume)
CallsPlayer.setVolume(float)on the delegate.
-
getVolume
public float getVolume()
CallsPlayer.getVolume()on the delegate and returns the result.
-
getVideoSize
public VideoSize getVideoSize()
CallsPlayer.getVideoSize()on the delegate and returns the result.- Specified by:
getVideoSizein interfacePlayer- See Also:
Player.Listener.onVideoSizeChanged(VideoSize)
-
clearVideoSurface
public void clearVideoSurface()
CallsPlayer.clearVideoSurface()on the delegate.- Specified by:
clearVideoSurfacein interfacePlayer
-
clearVideoSurface
public void clearVideoSurface(@Nullable Surface surface)CallsPlayer.clearVideoSurface(Surface)on the delegate.- Specified by:
clearVideoSurfacein interfacePlayer- Parameters:
surface- The surface to clear.
-
setVideoSurface
public void setVideoSurface(@Nullable Surface surface)CallsPlayer.setVideoSurface(Surface)on the delegate.- Specified by:
setVideoSurfacein interfacePlayer- Parameters:
surface- TheSurface.
-
setVideoSurfaceHolder
public void setVideoSurfaceHolder(@Nullable SurfaceHolder surfaceHolder)CallsPlayer.setVideoSurfaceHolder(SurfaceHolder)on the delegate.- Specified by:
setVideoSurfaceHolderin interfacePlayer- Parameters:
surfaceHolder- The surface holder.
-
clearVideoSurfaceHolder
public void clearVideoSurfaceHolder(@Nullable SurfaceHolder surfaceHolder)CallsPlayer.clearVideoSurfaceHolder(SurfaceHolder)on the delegate.- Specified by:
clearVideoSurfaceHolderin interfacePlayer- Parameters:
surfaceHolder- The surface holder to clear.
-
setVideoSurfaceView
public void setVideoSurfaceView(@Nullable SurfaceView surfaceView)CallsPlayer.setVideoSurfaceView(SurfaceView)on the delegate.- Specified by:
setVideoSurfaceViewin interfacePlayer- Parameters:
surfaceView- The surface view.
-
clearVideoSurfaceView
public void clearVideoSurfaceView(@Nullable SurfaceView surfaceView)CallsPlayer.clearVideoSurfaceView(SurfaceView)on the delegate.- Specified by:
clearVideoSurfaceViewin interfacePlayer- Parameters:
surfaceView- The texture view to clear.
-
setVideoTextureView
public void setVideoTextureView(@Nullable TextureView textureView)CallsPlayer.setVideoTextureView(TextureView)on the delegate.- Specified by:
setVideoTextureViewin interfacePlayer- Parameters:
textureView- The texture view.
-
clearVideoTextureView
public void clearVideoTextureView(@Nullable TextureView textureView)CallsPlayer.clearVideoTextureView(TextureView)on the delegate.- Specified by:
clearVideoTextureViewin interfacePlayer- Parameters:
textureView- The texture view to clear.
-
getCurrentCues
public List<Cue> getCurrentCues()
CallsPlayer.getCurrentCues()on the delegate and returns the result.- Specified by:
getCurrentCuesin interfacePlayer
-
getDeviceInfo
public DeviceInfo getDeviceInfo()
CallsPlayer.getDeviceInfo()on the delegate and returns the result.- Specified by:
getDeviceInfoin interfacePlayer
-
getDeviceVolume
public int getDeviceVolume()
CallsPlayer.getDeviceVolume()on the delegate and returns the result.- Specified by:
getDeviceVolumein interfacePlayer
-
isDeviceMuted
public boolean isDeviceMuted()
CallsPlayer.isDeviceMuted()on the delegate and returns the result.- Specified by:
isDeviceMutedin interfacePlayer
-
setDeviceVolume
public void setDeviceVolume(int volume)
CallsPlayer.setDeviceVolume(int)on the delegate.- Specified by:
setDeviceVolumein interfacePlayer- Parameters:
volume- The volume to set.
-
increaseDeviceVolume
public void increaseDeviceVolume()
CallsPlayer.increaseDeviceVolume()on the delegate.- Specified by:
increaseDeviceVolumein interfacePlayer
-
decreaseDeviceVolume
public void decreaseDeviceVolume()
CallsPlayer.decreaseDeviceVolume()on the delegate.- Specified by:
decreaseDeviceVolumein interfacePlayer
-
setDeviceMuted
public void setDeviceMuted(boolean muted)
CallsPlayer.setDeviceMuted(boolean)on the delegate.- Specified by:
setDeviceMutedin interfacePlayer
-
-