Package com.google.android.exoplayer2.testutil

## Class StubExoPlayer

- java.lang.Object
- - com.google.android.exoplayer2.BasePlayer
  - - com.google.android.exoplayer2.testutil.StubExoPlayer

- All Implemented Interfaces:
    `ExoPlayer`, `Player`

      public class StubExoPlayer
      extends BasePlayer
      implements ExoPlayer

  An abstract `ExoPlayer` implementation that throws `UnsupportedOperationException` from every method.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface com.google.android.exoplayer2.ExoPlayer

      `ExoPlayer.AudioComponent, ExoPlayer.AudioOffloadListener, ExoPlayer.Builder, ExoPlayer.DeviceComponent, ExoPlayer.MetadataComponent, ExoPlayer.TextComponent, ExoPlayer.VideoComponent`

    - ### Nested classes/interfaces inherited from interface com.google.android.exoplayer2.Player

      `Player.Command, Player.Commands, Player.DiscontinuityReason, Player.Event, Player.EventListener, Player.Events, Player.Listener, Player.MediaItemTransitionReason, Player.PlaybackSuppressionReason, Player.PlayWhenReadyChangeReason, Player.PositionInfo, Player.RepeatMode, Player.State, Player.TimelineChangeReason`

  - ### Field Summary

    - ### Fields inherited from class com.google.android.exoplayer2.BasePlayer

      `window`

    - ### Fields inherited from interface com.google.android.exoplayer2.ExoPlayer

      `DEFAULT_RELEASE_TIMEOUT_MS`

    - ### Fields inherited from interface com.google.android.exoplayer2.Player

      `COMMAND_ADJUST_DEVICE_VOLUME, COMMAND_CHANGE_MEDIA_ITEMS, COMMAND_GET_AUDIO_ATTRIBUTES, COMMAND_GET_CURRENT_MEDIA_ITEM, COMMAND_GET_DEVICE_VOLUME, COMMAND_GET_MEDIA_ITEMS_METADATA, COMMAND_GET_TEXT, COMMAND_GET_TIMELINE, COMMAND_GET_VOLUME, COMMAND_INVALID, COMMAND_PLAY_PAUSE, COMMAND_PREPARE_STOP, COMMAND_SEEK_BACK, COMMAND_SEEK_FORWARD, COMMAND_SEEK_IN_CURRENT_WINDOW, COMMAND_SEEK_TO_DEFAULT_POSITION, COMMAND_SEEK_TO_NEXT, COMMAND_SEEK_TO_NEXT_WINDOW, COMMAND_SEEK_TO_PREVIOUS, 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_VIDEO_SURFACE, COMMAND_SET_VOLUME, DISCONTINUITY_REASON_AUTO_TRANSITION, DISCONTINUITY_REASON_INTERNAL, DISCONTINUITY_REASON_REMOVE, DISCONTINUITY_REASON_SEEK, DISCONTINUITY_REASON_SEEK_ADJUSTMENT, DISCONTINUITY_REASON_SKIP, EVENT_AVAILABLE_COMMANDS_CHANGED, EVENT_IS_LOADING_CHANGED, EVENT_IS_PLAYING_CHANGED, EVENT_MAX_SEEK_TO_PREVIOUS_POSITION_CHANGED, EVENT_MEDIA_ITEM_TRANSITION, EVENT_MEDIA_METADATA_CHANGED, EVENT_PLAY_WHEN_READY_CHANGED, EVENT_PLAYBACK_PARAMETERS_CHANGED, EVENT_PLAYBACK_STATE_CHANGED, EVENT_PLAYBACK_SUPPRESSION_REASON_CHANGED, EVENT_PLAYER_ERROR, EVENT_PLAYLIST_METADATA_CHANGED, EVENT_POSITION_DISCONTINUITY, EVENT_REPEAT_MODE_CHANGED, EVENT_SEEK_BACK_INCREMENT_CHANGED, EVENT_SEEK_FORWARD_INCREMENT_CHANGED, EVENT_SHUFFLE_MODE_ENABLED_CHANGED, EVENT_STATIC_METADATA_CHANGED, EVENT_TIMELINE_CHANGED, EVENT_TRACKS_CHANGED, MEDIA_ITEM_TRANSITION_REASON_AUTO, MEDIA_ITEM_TRANSITION_REASON_PLAYLIST_CHANGED, MEDIA_ITEM_TRANSITION_REASON_REPEAT, MEDIA_ITEM_TRANSITION_REASON_SEEK, PLAY_WHEN_READY_CHANGE_REASON_AUDIO_BECOMING_NOISY, PLAY_WHEN_READY_CHANGE_REASON_AUDIO_FOCUS_LOSS, PLAY_WHEN_READY_CHANGE_REASON_END_OF_MEDIA_ITEM, PLAY_WHEN_READY_CHANGE_REASON_REMOTE, PLAY_WHEN_READY_CHANGE_REASON_USER_REQUEST, PLAYBACK_SUPPRESSION_REASON_NONE, PLAYBACK_SUPPRESSION_REASON_TRANSIENT_AUDIO_FOCUS_LOSS, REPEAT_MODE_ALL, REPEAT_MODE_OFF, REPEAT_MODE_ONE, STATE_BUFFERING, STATE_ENDED, STATE_IDLE, STATE_READY, TIMELINE_CHANGE_REASON_PLAYLIST_CHANGED, TIMELINE_CHANGE_REASON_SOURCE_UPDATE`

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `StubExoPlayer()` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `addAudioOffloadListener​(ExoPlayer.AudioOffloadListener listener)` | Adds a listener to receive audio offload events.
    `void` | `addListener​(Player.EventListener listener)` | Registers a listener to receive events from the player.
    `void` | `addListener​(Player.Listener listener)` | Registers a listener to receive all events from the player.
    `void` | `addMediaItems​(int index, List<MediaItem> mediaItems)` | Adds a list of media items at the given index of the playlist.
    `void` | `addMediaSource​(int index, MediaSource mediaSource)` | Adds a media source at the given index of the playlist.
    `void` | `addMediaSource​(MediaSource mediaSource)` | Adds a media source to the end of the playlist.
    `void` | `addMediaSources​(int index, List<MediaSource> mediaSources)` | Adds a list of media sources at the given index of the playlist.
    `void` | `addMediaSources​(List<MediaSource> mediaSources)` | Adds a list of media sources to the end of the playlist.
    `void` | `clearVideoSurface()` | Clears any `Surface`, `SurfaceHolder`, `SurfaceView` or `TextureView` currently set on the player.
    `void` | `clearVideoSurface​(Surface surface)` | Clears the `Surface` onto which video is being rendered if it matches the one passed.
    `void` | `clearVideoSurfaceHolder​(SurfaceHolder surfaceHolder)` | Clears the `SurfaceHolder` that holds the `Surface` onto which video is being rendered if it matches the one passed.
    `void` | `clearVideoSurfaceView​(SurfaceView surfaceView)` | Clears the `SurfaceView` onto which video is being rendered if it matches the one passed.
    `void` | `clearVideoTextureView​(TextureView textureView)` | Clears the `TextureView` onto which video is being rendered if it matches the one passed.
    `PlayerMessage` | `createMessage​(PlayerMessage.Target target)` | Creates a message that can be sent to a `PlayerMessage.Target`.
    `void` | `decreaseDeviceVolume()` | Decreases the volume of the device.
    `boolean` | `experimentalIsSleepingForOffload()` | Returns whether the player has paused its main loop to save power in offload scheduling mode.
    `void` | `experimentalSetOffloadSchedulingEnabled​(boolean offloadSchedulingEnabled)` | Sets whether audio offload scheduling is enabled.
    `Looper` | `getApplicationLooper()` | Returns the `Looper` associated with the application thread that's used to access the player and on which player events are received.
    `AudioAttributes` | `getAudioAttributes()` | Returns the attributes for audio playback.
    `ExoPlayer.AudioComponent` | `getAudioComponent()` | Returns the component of this player for audio output, or null if audio is not supported.
    `Player.Commands` | `getAvailableCommands()` | Returns the player's currently available `Player.Commands`.
    `long` | `getBufferedPosition()` | Returns an estimate of the position in the current content window or ad up to which data is buffered, in milliseconds.
    `Clock` | `getClock()` | Returns the `Clock` used for playback.
    `long` | `getContentBufferedPosition()` | If `Player.isPlayingAd()` returns `true`, returns an estimate of the content position in the current content window up to which data is buffered, in milliseconds.
    `long` | `getContentPosition()` | If `Player.isPlayingAd()` returns `true`, returns the content position that will be played once all ads in the ad group have finished playing, in milliseconds.
    `int` | `getCurrentAdGroupIndex()` | If `Player.isPlayingAd()` returns true, returns the index of the ad group in the period currently being played.
    `int` | `getCurrentAdIndexInAdGroup()` | If `Player.isPlayingAd()` returns true, returns the index of the ad in its ad group.
    `List<Cue>` | `getCurrentCues()` | Returns the current `Cues`.
    `int` | `getCurrentPeriodIndex()` | Returns the index of the period currently being played.
    `long` | `getCurrentPosition()` | Returns the playback position in the current content window or ad, in milliseconds, or the prospective position in milliseconds if the `current timeline` is empty.
    `List<Metadata>` | `getCurrentStaticMetadata()` | Deprecated.
    `Timeline` | `getCurrentTimeline()` | Returns the current `Timeline`.
    `TrackGroupArray` | `getCurrentTrackGroups()` | Returns the available track groups.
    `TrackSelectionArray` | `getCurrentTrackSelections()` | Returns the current track selections.
    `int` | `getCurrentWindowIndex()` | Returns the index of the current `window` in the `timeline`, or the prospective window index if the `current timeline` is empty.
    `ExoPlayer.DeviceComponent` | `getDeviceComponent()` | Returns the component of this player for playback device, or null if it's not supported.
    `DeviceInfo` | `getDeviceInfo()` | Gets the device information.
    `int` | `getDeviceVolume()` | Gets the current volume of the device.
    `long` | `getDuration()` | Returns the duration of the current content window or ad in milliseconds, or `C.TIME_UNSET` if the duration is not known.
    `int` | `getMaxSeekToPreviousPosition()` | Returns the maximum position for which `Player.seekToPrevious()` seeks to the previous window, in milliseconds.
    `MediaMetadata` | `getMediaMetadata()` | Returns the current combined `MediaMetadata`, or `MediaMetadata.EMPTY` if not supported.
    `ExoPlayer.MetadataComponent` | `getMetadataComponent()` | Returns the component of this player for metadata output, or null if metadata is not supported.
    `boolean` | `getPauseAtEndOfMediaItems()` | Returns whether the player pauses playback at the end of each media item.
    `Looper` | `getPlaybackLooper()` | Returns the `Looper` associated with the playback thread.
    `PlaybackParameters` | `getPlaybackParameters()` | Returns the currently active playback parameters.
    `int` | `getPlaybackState()` | Returns the current `playback state` of the player.
    `int` | `getPlaybackSuppressionReason()` | Returns the reason why playback is suppressed even though `Player.getPlayWhenReady()` is `true`, or `Player.PLAYBACK_SUPPRESSION_REASON_NONE` if playback is not suppressed.
    `ExoPlaybackException` | `getPlayerError()` | Equivalent to `Player.getPlayerError()`, except the exception is guaranteed to be an `ExoPlaybackException`.
    `MediaMetadata` | `getPlaylistMetadata()` | Returns the playlist `MediaMetadata`, as set by `Player.setPlaylistMetadata(MediaMetadata)`, or `MediaMetadata.EMPTY` if not supported.
    `boolean` | `getPlayWhenReady()` | Whether playback will proceed when `Player.getPlaybackState()` == `Player.STATE_READY`.
    `int` | `getRendererCount()` | Returns the number of renderers.
    `int` | `getRendererType​(int index)` | Returns the track type that the renderer at a given index handles.
    `int` | `getRepeatMode()` | Returns the current `Player.RepeatMode` used for playback.
    `long` | `getSeekBackIncrement()` | Returns the `Player.seekBack()` increment.
    `long` | `getSeekForwardIncrement()` | Returns the `Player.seekForward()` increment.
    `SeekParameters` | `getSeekParameters()` | Returns the currently active `SeekParameters` of the player.
    `boolean` | `getShuffleModeEnabled()` | Returns whether shuffling of windows is enabled.
    `ExoPlayer.TextComponent` | `getTextComponent()` | Returns the component of this player for text output, or null if text is not supported.
    `long` | `getTotalBufferedDuration()` | Returns an estimate of the total buffered duration from the current position, in milliseconds.
    `TrackSelector` | `getTrackSelector()` | Returns the track selector that this player uses, or null if track selection is not supported.
    `ExoPlayer.VideoComponent` | `getVideoComponent()` | Returns the component of this player for video output, or null if video is not supported.
    `VideoSize` | `getVideoSize()` | Gets the size of the video.
    `float` | `getVolume()` | Returns the audio volume, with 0 being silence and 1 being unity gain (signal unchanged).
    `void` | `increaseDeviceVolume()` | Increases the volume of the device.
    `boolean` | `isDeviceMuted()` | Gets whether the device is muted or not.
    `boolean` | `isLoading()` | Whether the player is currently loading the source.
    `boolean` | `isPlayingAd()` | Returns whether the player is currently playing an ad.
    `void` | `moveMediaItems​(int fromIndex, int toIndex, int newIndex)` | Moves the media item range to the new index.
    `void` | `prepare()` | Deprecated. Use `setMediaSource(MediaSource)` and `Player.prepare()` instead.
    `void` | `prepare​(MediaSource mediaSource)` | Deprecated. Use `setMediaSource(MediaSource)` and `Player.prepare()` instead.
    `void` | `prepare​(MediaSource mediaSource, boolean resetPosition, boolean resetState)` | Deprecated. Use `setMediaSource(MediaSource, boolean)` and `Player.prepare()` instead.
    `void` | `release()` | Releases the player.
    `void` | `removeAudioOffloadListener​(ExoPlayer.AudioOffloadListener listener)` | Removes a listener of audio offload events.
    `void` | `removeListener​(Player.EventListener listener)` | Unregister a listener registered through `Player.addListener(EventListener)`.
    `void` | `removeListener​(Player.Listener listener)` | Unregister a listener registered through `Player.addListener(Listener)`.
    `void` | `removeMediaItems​(int fromIndex, int toIndex)` | Removes a range of media items from the playlist.
    `void` | `retry()` | Deprecated. Use `prepare()` instead.
    `void` | `seekTo​(int windowIndex, long positionMs)` | Seeks to a position specified in milliseconds in the specified window.
    `void` | `setDeviceMuted​(boolean muted)` | Sets the mute state of the device.
    `void` | `setDeviceVolume​(int volume)` | Sets the volume of the device.
    `void` | `setForegroundMode​(boolean foregroundMode)` | Sets whether the player is allowed to keep holding limited resources such as video decoders, even when in the idle state.
    `void` | `setMediaItems​(List<MediaItem> mediaItems, boolean resetPosition)` | Clears the playlist and adds the specified `MediaItems`.
    `void` | `setMediaItems​(List<MediaItem> mediaItems, int startWindowIndex, long startPositionMs)` | Clears the playlist and adds the specified `MediaItems`.
    `void` | `setMediaSource​(MediaSource mediaSource)` | Clears the playlist, adds the specified `MediaSource` and resets the position to the default position.
    `void` | `setMediaSource​(MediaSource mediaSource, boolean resetPosition)` | Clears the playlist and adds the specified `MediaSource`.
    `void` | `setMediaSource​(MediaSource mediaSource, long startPositionMs)` | Clears the playlist and adds the specified `MediaSource`.
    `void` | `setMediaSources​(List<MediaSource> mediaSources)` | Clears the playlist, adds the specified `MediaSources` and resets the position to the default position.
    `void` | `setMediaSources​(List<MediaSource> mediaSources, boolean resetPosition)` | Clears the playlist and adds the specified `MediaSources`.
    `void` | `setMediaSources​(List<MediaSource> mediaSources, int startWindowIndex, long startPositionMs)` | Clears the playlist and adds the specified `MediaSources`.
    `void` | `setPauseAtEndOfMediaItems​(boolean pauseAtEndOfMediaItems)` | Sets whether to pause playback at the end of each media item.
    `void` | `setPlaybackParameters​(PlaybackParameters playbackParameters)` | Attempts to set the playback parameters.
    `void` | `setPlaylistMetadata​(MediaMetadata mediaMetadata)` | Sets the playlist `MediaMetadata`.
    `void` | `setPlayWhenReady​(boolean playWhenReady)` | Sets whether playback should proceed when `Player.getPlaybackState()` == `Player.STATE_READY`.
    `void` | `setRepeatMode​(int repeatMode)` | Sets the `Player.RepeatMode` to be used for playback.
    `void` | `setSeekParameters​(SeekParameters seekParameters)` | Sets the parameters that control how seek operations are performed.
    `void` | `setShuffleModeEnabled​(boolean shuffleModeEnabled)` | Sets whether shuffling of windows is enabled.
    `void` | `setShuffleOrder​(ShuffleOrder shuffleOrder)` | Sets the shuffle order.
    `void` | `setVideoSurface​(Surface surface)` | Sets the `Surface` onto which video will be rendered.
    `void` | `setVideoSurfaceHolder​(SurfaceHolder surfaceHolder)` | Sets the `SurfaceHolder` that holds the `Surface` onto which video will be rendered.
    `void` | `setVideoSurfaceView​(SurfaceView surfaceView)` | Sets the `SurfaceView` onto which video will be rendered.
    `void` | `setVideoTextureView​(TextureView textureView)` | Sets the `TextureView` onto which video will be rendered.
    `void` | `setVolume​(float audioVolume)` | Sets the audio volume, with 0 being silence and 1 being unity gain (signal unchanged).
    `void` | `stop​(boolean reset)` |

    - ### Methods inherited from class com.google.android.exoplayer2.BasePlayer

      `addMediaItem, addMediaItem, addMediaItems, clearMediaItems, getAvailableCommands, getBufferedPercentage, getContentDuration, getCurrentLiveOffset, getCurrentManifest, getCurrentMediaItem, getMediaItemAt, getMediaItemCount, getNextWindowIndex, getPreviousWindowIndex, hasNext, hasNextWindow, hasPrevious, hasPreviousWindow, isCommandAvailable, isCurrentWindowDynamic, isCurrentWindowLive, isCurrentWindowSeekable, isPlaying, moveMediaItem, next, pause, play, previous, removeMediaItem, seekBack, seekForward, seekTo, seekToDefaultPosition, seekToDefaultPosition, seekToNext, seekToNextWindow, seekToPrevious, seekToPreviousWindow, setMediaItem, setMediaItem, setMediaItem, setMediaItems, setPlaybackSpeed, stop`

    - ### 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, clearMediaItems, getBufferedPercentage, getContentDuration, getCurrentLiveOffset, getCurrentManifest, getCurrentMediaItem, getMediaItemAt, getMediaItemCount, getNextWindowIndex, getPreviousWindowIndex, hasNext, hasNextWindow, hasPrevious, hasPreviousWindow, isCommandAvailable, isCurrentWindowDynamic, isCurrentWindowLive, isCurrentWindowSeekable, isPlaying, moveMediaItem, next, pause, play, previous, removeMediaItem, seekBack, seekForward, seekTo, seekToDefaultPosition, seekToDefaultPosition, seekToNext, seekToNextWindow, seekToPrevious, seekToPreviousWindow, setMediaItem, setMediaItem, setMediaItem, setMediaItems, setPlaybackSpeed, stop`

- - ### Constructor Detail

    - #### StubExoPlayer

          public StubExoPlayer()

  - ### Method Detail

    - #### getAudioComponent

          public ExoPlayer.AudioComponent getAudioComponent()

      Description copied from interface: `ExoPlayer`
      Returns the component of this player for audio output, or null if audio is not supported.
      Specified by:
        `getAudioComponent` in interface `ExoPlayer`

    - #### getVideoComponent

          public ExoPlayer.VideoComponent getVideoComponent()

      Description copied from interface: `ExoPlayer`
      Returns the component of this player for video output, or null if video is not supported.
      Specified by:
        `getVideoComponent` in interface `ExoPlayer`

    - #### getTextComponent

          public ExoPlayer.TextComponent getTextComponent()

      Description copied from interface: `ExoPlayer`
      Returns the component of this player for text output, or null if text is not supported.
      Specified by:
        `getTextComponent` in interface `ExoPlayer`

    - #### getMetadataComponent

          public ExoPlayer.MetadataComponent getMetadataComponent()

      Description copied from interface: `ExoPlayer`
      Returns the component of this player for metadata output, or null if metadata is not supported.
      Specified by:
        `getMetadataComponent` in interface `ExoPlayer`

    - #### getDeviceComponent

          public ExoPlayer.DeviceComponent getDeviceComponent()

      Description copied from interface: `ExoPlayer`
      Returns the component of this player for playback device, or null if it's not supported.
      Specified by:
        `getDeviceComponent` in interface `ExoPlayer`

    - #### getPlaybackLooper

          public Looper getPlaybackLooper()

      Description copied from interface: `ExoPlayer`
      Returns the `Looper` associated with the playback thread.
      Specified by:
        `getPlaybackLooper` in interface `ExoPlayer`

    - #### getApplicationLooper

          public Looper getApplicationLooper()

      Description copied from interface: `Player`
      Returns the `Looper` associated with the application thread that's used to access the player and on which player events are received.
      Specified by:
        `getApplicationLooper` in interface `Player`

    - #### getClock

          public Clock getClock()

      Description copied from interface: `ExoPlayer`
      Returns the `Clock` used for playback.
      Specified by:
        `getClock` in interface `ExoPlayer`

    - #### addListener

          public void addListener​(Player.Listener listener)

      Description copied from interface: `Player`
      Registers a listener to receive all events from the player.

      The listener's methods will be called on the thread that was used to construct the player. However, if the thread used to construct the player does not have a `Looper`, then the listener will be called on the main thread.

      Specified by:
        `addListener` in interface `Player`
      Parameters:
        `listener` - The listener to register.

    - #### addListener

          public void addListener​(Player.EventListener listener)

      Description copied from interface: `Player`
      Registers a listener to receive events from the player.

      The listener's methods will be called on the thread that was used to construct the player. However, if the thread used to construct the player does not have a `Looper`, then the listener will be called on the main thread.

      Specified by:
        `addListener` in interface `Player`
      Parameters:
        `listener` - The listener to register.

    - #### removeListener

          public void removeListener​(Player.Listener listener)

      Description copied from interface: `Player`
      Unregister a listener registered through `Player.addListener(Listener)`. The listener will no longer receive events.
      Specified by:
        `removeListener` in interface `Player`
      Parameters:
        `listener` - The listener to unregister.

    - #### removeListener

          public void removeListener​(Player.EventListener listener)

      Description copied from interface: `Player`
      Unregister a listener registered through `Player.addListener(EventListener)`. The listener will no longer receive events from the player.
      Specified by:
        `removeListener` in interface `Player`
      Parameters:
        `listener` - The listener to unregister.

    - #### addAudioOffloadListener

          public void addAudioOffloadListener​(ExoPlayer.AudioOffloadListener listener)

      Description copied from interface: `ExoPlayer`
      Adds a listener to receive audio offload events.
      Specified by:
        `addAudioOffloadListener` in interface `ExoPlayer`
      Parameters:
        `listener` - The listener to register.

    - #### removeAudioOffloadListener

          public void removeAudioOffloadListener​(ExoPlayer.AudioOffloadListener listener)

      Description copied from interface: `ExoPlayer`
      Removes a listener of audio offload events.
      Specified by:
        `removeAudioOffloadListener` in interface `ExoPlayer`
      Parameters:
        `listener` - The listener to unregister.

    - #### getPlaybackState

          @State
          public int getPlaybackState()

      Description copied from interface: `Player`
      Returns the current `playback state` of the player.
      Specified by:
        `getPlaybackState` in interface `Player`
      Returns:
        The current `playback state`.
      See Also:
        `Player.Listener.onPlaybackStateChanged(int)`

    - #### getPlaybackSuppressionReason

          @PlaybackSuppressionReason
          public int getPlaybackSuppressionReason()

      Description copied from interface: `Player`
      Returns the reason why playback is suppressed even though `Player.getPlayWhenReady()` is `true`, or `Player.PLAYBACK_SUPPRESSION_REASON_NONE` if playback is not suppressed.
      Specified by:
        `getPlaybackSuppressionReason` in interface `Player`
      Returns:
        The current `playback suppression reason`.
      See Also:
        `Player.Listener.onPlaybackSuppressionReasonChanged(int)`

    - #### getPlayerError

          public ExoPlaybackException getPlayerError()

      Description copied from interface: `ExoPlayer`
      Equivalent to `Player.getPlayerError()`, except the exception is guaranteed to be an `ExoPlaybackException`.
      Specified by:
        `getPlayerError` in interface `ExoPlayer`
      Specified by:
        `getPlayerError` in interface `Player`
      Returns:
        The error, or `null`.
      See Also:
        `Player.Listener.onPlayerError(PlaybackException)`

    - #### retry

          @Deprecated
          public void retry()

      Deprecated.
      Use `prepare()` instead.
      Specified by:
        `retry` in interface `ExoPlayer`

    - #### prepare

          @Deprecated
          public void prepare()

      Deprecated.
      Use `setMediaSource(MediaSource)` and `Player.prepare()` instead.
      Description copied from interface: `Player`
      Prepares the player.
      Specified by:
        `prepare` in interface `Player`

    - #### prepare

          @Deprecated
          public void prepare​(MediaSource mediaSource)

      Deprecated.
      Use `setMediaSource(MediaSource)` and `Player.prepare()` instead.
      Specified by:
        `prepare` in interface `ExoPlayer`

    - #### prepare

          @Deprecated
          public void prepare​(MediaSource mediaSource,
                              boolean resetPosition,
                              boolean resetState)

      Deprecated.
      Use `setMediaSource(MediaSource, boolean)` and `Player.prepare()` instead.
      Specified by:
        `prepare` in interface `ExoPlayer`

    - #### setMediaItems

          public void setMediaItems​(List<MediaItem> mediaItems,
                                    boolean resetPosition)

      Description copied from interface: `Player`
      Clears the playlist and adds the specified `MediaItems`.
      Specified by:
        `setMediaItems` in interface `Player`
      Parameters:
        `mediaItems` - The new `MediaItems`.
        `resetPosition` - Whether the playback position should be reset to the default position in the first `Timeline.Window`. If false, playback will start from the position defined by `Player.getCurrentWindowIndex()` and `Player.getCurrentPosition()`.

    - #### setMediaItems

          public void setMediaItems​(List<MediaItem> mediaItems,
                                    int startWindowIndex,
                                    long startPositionMs)

      Description copied from interface: `Player`
      Clears the playlist and adds the specified `MediaItems`.
      Specified by:
        `setMediaItems` in interface `Player`
      Parameters:
        `mediaItems` - The new `MediaItems`.
        `startWindowIndex` - The window index to start playback from. If `C.INDEX_UNSET` is passed, the current position is not reset.
        `startPositionMs` - The position in milliseconds to start playback from. If `C.TIME_UNSET` is passed, the default position of the given window is used. In any case, if `startWindowIndex` is set to `C.INDEX_UNSET`, this parameter is ignored and the position is not reset at all.

    - #### setMediaSource

          public void setMediaSource​(MediaSource mediaSource)

      Description copied from interface: `ExoPlayer`
      Clears the playlist, adds the specified `MediaSource` and resets the position to the default position.
      Specified by:
        `setMediaSource` in interface `ExoPlayer`
      Parameters:
        `mediaSource` - The new `MediaSource`.

    - #### setMediaSource

          public void setMediaSource​(MediaSource mediaSource,
                                     long startPositionMs)

      Description copied from interface: `ExoPlayer`
      Clears the playlist and adds the specified `MediaSource`.
      Specified by:
        `setMediaSource` in interface `ExoPlayer`
      Parameters:
        `mediaSource` - The new `MediaSource`.
        `startPositionMs` - The position in milliseconds to start playback from.

    - #### setMediaSource

          public void setMediaSource​(MediaSource mediaSource,
                                     boolean resetPosition)

      Description copied from interface: `ExoPlayer`
      Clears the playlist and adds the specified `MediaSource`.
      Specified by:
        `setMediaSource` in interface `ExoPlayer`
      Parameters:
        `mediaSource` - The new `MediaSource`.
        `resetPosition` - Whether the playback position should be reset to the default position. If false, playback will start from the position defined by `Player.getCurrentWindowIndex()` and `Player.getCurrentPosition()`.

    - #### setMediaSources

          public void setMediaSources​(List<MediaSource> mediaSources)

      Description copied from interface: `ExoPlayer`
      Clears the playlist, adds the specified `MediaSources` and resets the position to the default position.
      Specified by:
        `setMediaSources` in interface `ExoPlayer`
      Parameters:
        `mediaSources` - The new `MediaSources`.

    - #### setMediaSources

          public void setMediaSources​(List<MediaSource> mediaSources,
                                      boolean resetPosition)

      Description copied from interface: `ExoPlayer`
      Clears the playlist and adds the specified `MediaSources`.
      Specified by:
        `setMediaSources` in interface `ExoPlayer`
      Parameters:
        `mediaSources` - The new `MediaSources`.
        `resetPosition` - Whether the playback position should be reset to the default position in the first `Timeline.Window`. If false, playback will start from the position defined by `Player.getCurrentWindowIndex()` and `Player.getCurrentPosition()`.

    - #### setMediaSources

          public void setMediaSources​(List<MediaSource> mediaSources,
                                      int startWindowIndex,
                                      long startPositionMs)

      Description copied from interface: `ExoPlayer`
      Clears the playlist and adds the specified `MediaSources`.
      Specified by:
        `setMediaSources` in interface `ExoPlayer`
      Parameters:
        `mediaSources` - The new `MediaSources`.
        `startWindowIndex` - The window index to start playback from. If `C.INDEX_UNSET` is passed, the current position is not reset.
        `startPositionMs` - The position in milliseconds to start playback from. If `C.TIME_UNSET` is passed, the default position of the given window is used. In any case, if `startWindowIndex` is set to `C.INDEX_UNSET`, this parameter is ignored and the position is not reset at all.

    - #### addMediaItems

          public void addMediaItems​(int index,
                                    List<MediaItem> mediaItems)

      Description copied from interface: `Player`
      Adds a list of media items at the given index of the playlist.
      Specified by:
        `addMediaItems` in interface `Player`
      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 `MediaItems` to add.

    - #### addMediaSource

          public void addMediaSource​(MediaSource mediaSource)

      Description copied from interface: `ExoPlayer`
      Adds a media source to the end of the playlist.
      Specified by:
        `addMediaSource` in interface `ExoPlayer`
      Parameters:
        `mediaSource` - The `MediaSource` to add.

    - #### addMediaSource

          public void addMediaSource​(int index,
                                     MediaSource mediaSource)

      Description copied from interface: `ExoPlayer`
      Adds a media source at the given index of the playlist.
      Specified by:
        `addMediaSource` in interface `ExoPlayer`
      Parameters:
        `index` - The index at which to add the source.
        `mediaSource` - The `MediaSource` to add.

    - #### addMediaSources

          public void addMediaSources​(List<MediaSource> mediaSources)

      Description copied from interface: `ExoPlayer`
      Adds a list of media sources to the end of the playlist.
      Specified by:
        `addMediaSources` in interface `ExoPlayer`
      Parameters:
        `mediaSources` - The `MediaSources` to add.

    - #### addMediaSources

          public void addMediaSources​(int index,
                                      List<MediaSource> mediaSources)

      Description copied from interface: `ExoPlayer`
      Adds a list of media sources at the given index of the playlist.
      Specified by:
        `addMediaSources` in interface `ExoPlayer`
      Parameters:
        `index` - The index at which to add the media sources.
        `mediaSources` - The `MediaSources` to add.

    - #### moveMediaItems

          public void moveMediaItems​(int fromIndex,
                                     int toIndex,
                                     int newIndex)

      Description copied from interface: `Player`
      Moves the media item range to the new index.
      Specified by:
        `moveMediaItems` in interface `Player`
      Parameters:
        `fromIndex` - The start of the range to move.
        `toIndex` - The first item not to be included in the range (exclusive).
        `newIndex` - The new index of the first media item of the range. If the new index is larger than the size of the remaining playlist after removing the range, the range is moved to the end of the playlist.

    - #### removeMediaItems

          public void removeMediaItems​(int fromIndex,
                                       int toIndex)

      Description copied from interface: `Player`
      Removes a range of media items from the playlist.
      Specified by:
        `removeMediaItems` in interface `Player`
      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.

    - #### getAvailableCommands

          public Player.Commands getAvailableCommands()

      Description copied from interface: `Player`
      Returns the player's currently available `Player.Commands`.

      The returned `Player.Commands` are not updated when available commands change. Use `Player.Listener.onAvailableCommandsChanged(Commands)` to get an update when the available commands change.

      Executing a command that is not available (for example, calling `Player.seekToNextWindow()` if `Player.COMMAND_SEEK_TO_NEXT_WINDOW` is unavailable) will neither throw an exception nor generate a `Player.getPlayerError()` player error}.

      `Player.COMMAND_SEEK_TO_PREVIOUS_WINDOW` and `Player.COMMAND_SEEK_TO_NEXT_WINDOW` are unavailable if there is no such `MediaItem`.

      Specified by:
        `getAvailableCommands` in interface `Player`
      Returns:
        The currently available `Player.Commands`.
      See Also:
        `Player.Listener.onAvailableCommandsChanged(com.google.android.exoplayer2.Player.Commands)`

    - #### setPlayWhenReady

          public void setPlayWhenReady​(boolean playWhenReady)

      Description copied from interface: `Player`
      Sets whether playback should proceed when `Player.getPlaybackState()` == `Player.STATE_READY`.

      If the player is already in the ready state then this method pauses and resumes playback.

      Specified by:
        `setPlayWhenReady` in interface `Player`
      Parameters:
        `playWhenReady` - Whether playback should proceed when ready.

    - #### getPlayWhenReady

          public boolean getPlayWhenReady()

      Description copied from interface: `Player`
      Whether playback will proceed when `Player.getPlaybackState()` == `Player.STATE_READY`.
      Specified by:
        `getPlayWhenReady` in interface `Player`
      Returns:
        Whether playback will proceed when ready.
      See Also:
        `Player.Listener.onPlayWhenReadyChanged(boolean, int)`

    - #### setRepeatMode

          public void setRepeatMode​(@RepeatMode
                                    int repeatMode)

      Description copied from interface: `Player`
      Sets the `Player.RepeatMode` to be used for playback.
      Specified by:
        `setRepeatMode` in interface `Player`
      Parameters:
        `repeatMode` - The repeat mode.

    - #### getRepeatMode

          public int getRepeatMode()

      Description copied from interface: `Player`
      Returns the current `Player.RepeatMode` used for playback.
      Specified by:
        `getRepeatMode` in interface `Player`
      Returns:
        The current repeat mode.
      See Also:
        `Player.Listener.onRepeatModeChanged(int)`

    - #### setShuffleOrder

          public void setShuffleOrder​(ShuffleOrder shuffleOrder)

      Description copied from interface: `ExoPlayer`
      Sets the shuffle order.
      Specified by:
        `setShuffleOrder` in interface `ExoPlayer`
      Parameters:
        `shuffleOrder` - The shuffle order.

    - #### setShuffleModeEnabled

          public void setShuffleModeEnabled​(boolean shuffleModeEnabled)

      Description copied from interface: `Player`
      Sets whether shuffling of windows is enabled.
      Specified by:
        `setShuffleModeEnabled` in interface `Player`
      Parameters:
        `shuffleModeEnabled` - Whether shuffling is enabled.

    - #### getShuffleModeEnabled

          public boolean getShuffleModeEnabled()

      Description copied from interface: `Player`
      Returns whether shuffling of windows is enabled.
      Specified by:
        `getShuffleModeEnabled` in interface `Player`
      See Also:
        `Player.Listener.onShuffleModeEnabledChanged(boolean)`

    - #### isLoading

          public boolean isLoading()

      Description copied from interface: `Player`
      Whether the player is currently loading the source.
      Specified by:
        `isLoading` in interface `Player`
      Returns:
        Whether the player is currently loading the source.
      See Also:
        `Player.Listener.onIsLoadingChanged(boolean)`

    - #### seekTo

          public void seekTo​(int windowIndex,
                             long positionMs)

      Description copied from interface: `Player`
      Seeks to a position specified in milliseconds in the specified window.
      Specified by:
        `seekTo` in interface `Player`
      Parameters:
        `windowIndex` - The index of the window.
        `positionMs` - The seek position in the specified window, or `C.TIME_UNSET` to seek to the window's default position.

    - #### getSeekBackIncrement

          public long getSeekBackIncrement()

      Description copied from interface: `Player`
      Returns the `Player.seekBack()` increment.
      Specified by:
        `getSeekBackIncrement` in interface `Player`
      Returns:
        The seek back increment, in milliseconds.
      See Also:
        `Player.Listener.onSeekBackIncrementChanged(long)`

    - #### getSeekForwardIncrement

          public long getSeekForwardIncrement()

      Description copied from interface: `Player`
      Returns the `Player.seekForward()` increment.
      Specified by:
        `getSeekForwardIncrement` in interface `Player`
      Returns:
        The seek forward increment, in milliseconds.
      See Also:
        `Player.Listener.onSeekForwardIncrementChanged(long)`

    - #### getMaxSeekToPreviousPosition

          public int getMaxSeekToPreviousPosition()

      Description copied from interface: `Player`
      Returns the maximum position for which `Player.seekToPrevious()` seeks to the previous window, in milliseconds.
      Specified by:
        `getMaxSeekToPreviousPosition` in interface `Player`
      Returns:
        The maximum seek to previous position, in milliseconds.
      See Also:
        `Player.EventListener.onMaxSeekToPreviousPositionChanged(int)`

    - #### setPlaybackParameters

          public void setPlaybackParameters​(PlaybackParameters playbackParameters)

      Description copied from interface: `Player`
      Attempts to set the playback parameters. Passing `PlaybackParameters.DEFAULT` resets the player to the default, which means there is no speed or pitch adjustment.

      Playback parameters changes may cause the player to buffer. `Player.Listener.onPlaybackParametersChanged(PlaybackParameters)` will be called whenever the currently active playback parameters change.

      Specified by:
        `setPlaybackParameters` in interface `Player`
      Parameters:
        `playbackParameters` - The playback parameters.

    - #### getPlaybackParameters

          public PlaybackParameters getPlaybackParameters()

      Description copied from interface: `Player`
      Returns the currently active playback parameters.
      Specified by:
        `getPlaybackParameters` in interface `Player`
      See Also:
        `Player.Listener.onPlaybackParametersChanged(PlaybackParameters)`

    - #### setSeekParameters

          public void setSeekParameters​(@Nullable
                                        SeekParameters seekParameters)

      Description copied from interface: `ExoPlayer`
      Sets the parameters that control how seek operations are performed.
      Specified by:
        `setSeekParameters` in interface `ExoPlayer`
      Parameters:
        `seekParameters` - The seek parameters, or `null` to use the defaults.

    - #### getSeekParameters

          public SeekParameters getSeekParameters()

      Description copied from interface: `ExoPlayer`
      Returns the currently active `SeekParameters` of the player.
      Specified by:
        `getSeekParameters` in interface `ExoPlayer`

    - #### stop

          public void stop​(boolean reset)

      Specified by:
        `stop` in interface `Player`

    - #### release

          public void release()

      Description copied from interface: `Player`
      Releases the player. This method must be called when the player is no longer required. The player must not be used after calling this method.
      Specified by:
        `release` in interface `Player`

    - #### createMessage

          public PlayerMessage createMessage​(PlayerMessage.Target target)

      Description copied from interface: `ExoPlayer`
      Creates a message that can be sent to a `PlayerMessage.Target`. By default, the message will be delivered immediately without blocking on the playback thread. The default `PlayerMessage.getType()` is 0 and the default `PlayerMessage.getPayload()` is null. If a position is specified with `PlayerMessage.setPosition(long)`, the message will be delivered at this position in the current window defined by `Player.getCurrentWindowIndex()`. Alternatively, the message can be sent at a specific window using `PlayerMessage.setPosition(int, long)`.
      Specified by:
        `createMessage` in interface `ExoPlayer`

    - #### getRendererCount

          public int getRendererCount()

      Description copied from interface: `ExoPlayer`
      Returns the number of renderers.
      Specified by:
        `getRendererCount` in interface `ExoPlayer`

    - #### getRendererType

          public int getRendererType​(int index)

      Description copied from interface: `ExoPlayer`
      Returns the track type that the renderer at a given index handles.

      For example, a video renderer will return `C.TRACK_TYPE_VIDEO`, an audio renderer will return `C.TRACK_TYPE_AUDIO` and a text renderer will return `C.TRACK_TYPE_TEXT`.

      Specified by:
        `getRendererType` in interface `ExoPlayer`
      Parameters:
        `index` - The index of the renderer.
      Returns:
        One of the `TRACK_TYPE_*` constants defined in `C`.

    - #### getTrackSelector

          @Nullable
          public TrackSelector getTrackSelector()

      Description copied from interface: `ExoPlayer`
      Returns the track selector that this player uses, or null if track selection is not supported.
      Specified by:
        `getTrackSelector` in interface `ExoPlayer`

    - #### getCurrentTrackGroups

          public TrackGroupArray getCurrentTrackGroups()

      Description copied from interface: `Player`
      Returns the available track groups.
      Specified by:
        `getCurrentTrackGroups` in interface `Player`
      See Also:
        `Player.Listener.onTracksChanged(TrackGroupArray, TrackSelectionArray)`

    - #### getCurrentTrackSelections

          public TrackSelectionArray getCurrentTrackSelections()

      Description copied from interface: `Player`
      Returns the current track selections.

      A concrete implementation may include null elements if it has a fixed number of renderer components, wishes to report a TrackSelection for each of them, and has one or more renderer components that is not assigned any selected tracks.

      Specified by:
        `getCurrentTrackSelections` in interface `Player`
      See Also:
        `Player.Listener.onTracksChanged(TrackGroupArray, TrackSelectionArray)`

    - #### getCurrentStaticMetadata

          @Deprecated
          public List<Metadata> getCurrentStaticMetadata()

      Deprecated.
      Specified by:
        `getCurrentStaticMetadata` in interface `Player`

    - #### getMediaMetadata

          public MediaMetadata getMediaMetadata()

      Description copied from interface: `Player`
      Returns the current combined `MediaMetadata`, or `MediaMetadata.EMPTY` if not supported.

      This `MediaMetadata` is a combination of the `MediaItem.mediaMetadata` and the static and dynamic metadata from the `track selections' formats` and `MetadataOutput.onMetadata(Metadata)`.

      Specified by:
        `getMediaMetadata` in interface `Player`

    - #### getPlaylistMetadata

          public MediaMetadata getPlaylistMetadata()

      Description copied from interface: `Player`
      Returns the playlist `MediaMetadata`, as set by `Player.setPlaylistMetadata(MediaMetadata)`, or `MediaMetadata.EMPTY` if not supported.
      Specified by:
        `getPlaylistMetadata` in interface `Player`

    - #### setPlaylistMetadata

          public void setPlaylistMetadata​(MediaMetadata mediaMetadata)

      Description copied from interface: `Player`
      Sets the playlist `MediaMetadata`.
      Specified by:
        `setPlaylistMetadata` in interface `Player`

    - #### getCurrentTimeline

          public Timeline getCurrentTimeline()

      Description copied from interface: `Player`
      Returns the current `Timeline`. Never null, but may be empty.
      Specified by:
        `getCurrentTimeline` in interface `Player`
      See Also:
        `Player.Listener.onTimelineChanged(Timeline, int)`

    - #### getCurrentPeriodIndex

          public int getCurrentPeriodIndex()

      Description copied from interface: `Player`
      Returns the index of the period currently being played.
      Specified by:
        `getCurrentPeriodIndex` in interface `Player`

    - #### getCurrentWindowIndex

          public int getCurrentWindowIndex()

      Description copied from interface: `Player`
      Returns the index of the current `window` in the `timeline`, or the prospective window index if the `current timeline` is empty.
      Specified by:
        `getCurrentWindowIndex` in interface `Player`

    - #### getDuration

          public long getDuration()

      Description copied from interface: `Player`
      Returns the duration of the current content window or ad in milliseconds, or `C.TIME_UNSET` if the duration is not known.
      Specified by:
        `getDuration` in interface `Player`

    - #### getCurrentPosition

          public long getCurrentPosition()

      Description copied from interface: `Player`
      Returns the playback position in the current content window or ad, in milliseconds, or the prospective position in milliseconds if the `current timeline` is empty.
      Specified by:
        `getCurrentPosition` in interface `Player`

    - #### getBufferedPosition

          public long getBufferedPosition()

      Description copied from interface: `Player`
      Returns an estimate of the position in the current content window or ad up to which data is buffered, in milliseconds.
      Specified by:
        `getBufferedPosition` in interface `Player`

    - #### getTotalBufferedDuration

          public long getTotalBufferedDuration()

      Description copied from interface: `Player`
      Returns an estimate of the total buffered duration from the current position, in milliseconds. This includes pre-buffered data for subsequent ads and windows.
      Specified by:
        `getTotalBufferedDuration` in interface `Player`

    - #### isPlayingAd

          public boolean isPlayingAd()

      Description copied from interface: `Player`
      Returns whether the player is currently playing an ad.
      Specified by:
        `isPlayingAd` in interface `Player`

    - #### getCurrentAdGroupIndex

          public int getCurrentAdGroupIndex()

      Description copied from interface: `Player`
      If `Player.isPlayingAd()` returns true, returns the index of the ad group in the period currently being played. Returns `C.INDEX_UNSET` otherwise.
      Specified by:
        `getCurrentAdGroupIndex` in interface `Player`

    - #### getCurrentAdIndexInAdGroup

          public int getCurrentAdIndexInAdGroup()

      Description copied from interface: `Player`
      If `Player.isPlayingAd()` returns true, returns the index of the ad in its ad group. Returns `C.INDEX_UNSET` otherwise.
      Specified by:
        `getCurrentAdIndexInAdGroup` in interface `Player`

    - #### getContentPosition

          public long getContentPosition()

      Description copied from interface: `Player`
      If `Player.isPlayingAd()` returns `true`, returns the content position that will be played once all ads in the ad group have finished playing, in milliseconds. If there is no ad playing, the returned position is the same as that returned by `Player.getCurrentPosition()`.
      Specified by:
        `getContentPosition` in interface `Player`

    - #### getContentBufferedPosition

          public long getContentBufferedPosition()

      Description copied from interface: `Player`
      If `Player.isPlayingAd()` returns `true`, returns an estimate of the content position in the current content window up to which data is buffered, in milliseconds. If there is no ad playing, the returned position is the same as that returned by `Player.getBufferedPosition()`.
      Specified by:
        `getContentBufferedPosition` in interface `Player`

    - #### getAudioAttributes

          public AudioAttributes getAudioAttributes()

      Description copied from interface: `Player`
      Returns the attributes for audio playback.
      Specified by:
        `getAudioAttributes` in interface `Player`

    - #### setVolume

          public void setVolume​(float audioVolume)

      Description copied from interface: `Player`
      Sets the audio volume, with 0 being silence and 1 being unity gain (signal unchanged).
      Specified by:
        `setVolume` in interface `Player`
      Parameters:
        `audioVolume` - Linear output gain to apply to all audio channels.

    - #### getVolume

          public float getVolume()

      Description copied from interface: `Player`
      Returns the audio volume, with 0 being silence and 1 being unity gain (signal unchanged).
      Specified by:
        `getVolume` in interface `Player`
      Returns:
        The linear gain applied to all audio channels.

    - #### clearVideoSurface

          public void clearVideoSurface()

      Description copied from interface: `Player`
      Clears any `Surface`, `SurfaceHolder`, `SurfaceView` or `TextureView` currently set on the player.
      Specified by:
        `clearVideoSurface` in interface `Player`

    - #### clearVideoSurface

          public void clearVideoSurface​(@Nullable
                                        Surface surface)

      Description copied from interface: `Player`
      Clears the `Surface` onto which video is being rendered if it matches the one passed. Else does nothing.
      Specified by:
        `clearVideoSurface` in interface `Player`
      Parameters:
        `surface` - The surface to clear.

    - #### setVideoSurface

          public void setVideoSurface​(@Nullable
                                      Surface surface)

      Description copied from interface: `Player`
      Sets the `Surface` onto which video will be rendered. The caller is responsible for tracking the lifecycle of the surface, and must clear the surface by calling `setVideoSurface(null)` if the surface is destroyed.

      If the surface is held by a `SurfaceView`, `TextureView` or `SurfaceHolder` then it's recommended to use `Player.setVideoSurfaceView(SurfaceView)`, `Player.setVideoTextureView(TextureView)` or `Player.setVideoSurfaceHolder(SurfaceHolder)` rather than this method, since passing the holder allows the player to track the lifecycle of the surface automatically.

      Specified by:
        `setVideoSurface` in interface `Player`
      Parameters:
        `surface` - The `Surface`.

    - #### setVideoSurfaceHolder

          public void setVideoSurfaceHolder​(@Nullable
                                            SurfaceHolder surfaceHolder)

      Description copied from interface: `Player`
      Sets the `SurfaceHolder` that holds the `Surface` onto which video will be rendered. The player will track the lifecycle of the surface automatically.

      The thread that calls the `SurfaceHolder.Callback` methods must be the thread associated with `Player.getApplicationLooper()`.

      Specified by:
        `setVideoSurfaceHolder` in interface `Player`
      Parameters:
        `surfaceHolder` - The surface holder.

    - #### clearVideoSurfaceHolder

          public void clearVideoSurfaceHolder​(@Nullable
                                              SurfaceHolder surfaceHolder)

      Description copied from interface: `Player`
      Clears the `SurfaceHolder` that holds the `Surface` onto which video is being rendered if it matches the one passed. Else does nothing.
      Specified by:
        `clearVideoSurfaceHolder` in interface `Player`
      Parameters:
        `surfaceHolder` - The surface holder to clear.

    - #### setVideoSurfaceView

          public void setVideoSurfaceView​(@Nullable
                                          SurfaceView surfaceView)

      Description copied from interface: `Player`
      Sets the `SurfaceView` onto which video will be rendered. The player will track the lifecycle of the surface automatically.

      The thread that calls the `SurfaceHolder.Callback` methods must be the thread associated with `Player.getApplicationLooper()`.

      Specified by:
        `setVideoSurfaceView` in interface `Player`
      Parameters:
        `surfaceView` - The surface view.

    - #### clearVideoSurfaceView

          public void clearVideoSurfaceView​(@Nullable
                                            SurfaceView surfaceView)

      Description copied from interface: `Player`
      Clears the `SurfaceView` onto which video is being rendered if it matches the one passed. Else does nothing.
      Specified by:
        `clearVideoSurfaceView` in interface `Player`
      Parameters:
        `surfaceView` - The texture view to clear.

    - #### setVideoTextureView

          public void setVideoTextureView​(@Nullable
                                          TextureView textureView)

      Description copied from interface: `Player`
      Sets the `TextureView` onto which video will be rendered. The player will track the lifecycle of the surface automatically.

      The thread that calls the `TextureView.SurfaceTextureListener` methods must be the thread associated with `Player.getApplicationLooper()`.

      Specified by:
        `setVideoTextureView` in interface `Player`
      Parameters:
        `textureView` - The texture view.

    - #### clearVideoTextureView

          public void clearVideoTextureView​(@Nullable
                                            TextureView textureView)

      Description copied from interface: `Player`
      Clears the `TextureView` onto which video is being rendered if it matches the one passed. Else does nothing.
      Specified by:
        `clearVideoTextureView` in interface `Player`
      Parameters:
        `textureView` - The texture view to clear.

    - #### getVideoSize

          public VideoSize getVideoSize()

      Description copied from interface: `Player`
      Gets the size of the video.

      The video's width and height are `0` if there is no video or its size has not been determined yet.

      Specified by:
        `getVideoSize` in interface `Player`
      See Also:
        `Player.Listener.onVideoSizeChanged(VideoSize)`

    - #### getCurrentCues

          public List<Cue> getCurrentCues()

      Description copied from interface: `Player`
      Returns the current `Cues`. This list may be empty.
      Specified by:
        `getCurrentCues` in interface `Player`

    - #### getDeviceInfo

          public DeviceInfo getDeviceInfo()

      Description copied from interface: `Player`
      Gets the device information.
      Specified by:
        `getDeviceInfo` in interface `Player`

    - #### getDeviceVolume

          public int getDeviceVolume()

      Description copied from interface: `Player`
      Gets the current volume of the device.

      For devices with `local playback`, the volume returned by this method varies according to the current `stream type`. The stream type is determined by `AudioAttributes.usage` which can be converted to stream type with `Util.getStreamTypeForAudioUsage(int)`.

      For devices with `remote playback`, the volume of the remote device is returned.

      Specified by:
        `getDeviceVolume` in interface `Player`

    - #### isDeviceMuted

          public boolean isDeviceMuted()

      Description copied from interface: `Player`
      Gets whether the device is muted or not.
      Specified by:
        `isDeviceMuted` in interface `Player`

    - #### setDeviceVolume

          public void setDeviceVolume​(int volume)

      Description copied from interface: `Player`
      Sets the volume of the device.
      Specified by:
        `setDeviceVolume` in interface `Player`
      Parameters:
        `volume` - The volume to set.

    - #### increaseDeviceVolume

          public void increaseDeviceVolume()

      Description copied from interface: `Player`
      Increases the volume of the device.
      Specified by:
        `increaseDeviceVolume` in interface `Player`

    - #### decreaseDeviceVolume

          public void decreaseDeviceVolume()

      Description copied from interface: `Player`
      Decreases the volume of the device.
      Specified by:
        `decreaseDeviceVolume` in interface `Player`

    - #### setDeviceMuted

          public void setDeviceMuted​(boolean muted)

      Description copied from interface: `Player`
      Sets the mute state of the device.
      Specified by:
        `setDeviceMuted` in interface `Player`

    - #### setForegroundMode

          public void setForegroundMode​(boolean foregroundMode)

      Description copied from interface: `ExoPlayer`
      Sets whether the player is allowed to keep holding limited resources such as video decoders, even when in the idle state. By doing so, the player may be able to reduce latency when starting to play another piece of content for which the same resources are required.

      This mode should be used with caution, since holding limited resources may prevent other players of media components from acquiring them. It should only be enabled when both of the following conditions are true:

      - The application that owns the player is in the foreground.
      - The player is used in a way that may benefit from foreground mode. For this to be true, the same player instance must be used to play multiple pieces of content, and there must be gaps between the playbacks (i.e. `Player.stop()` is called to halt one playback, and `ExoPlayer.prepare(com.google.android.exoplayer2.source.MediaSource)` is called some time later to start a new one).

      Note that foreground mode is not useful for switching between content without gaps between the playbacks. For this use case `Player.stop()` does not need to be called, and simply calling `ExoPlayer.prepare(com.google.android.exoplayer2.source.MediaSource)` for the new media will cause limited resources to be retained even if foreground mode is not enabled.

      If foreground mode is enabled, it's the application's responsibility to disable it when the conditions described above no longer hold.

      Specified by:
        `setForegroundMode` in interface `ExoPlayer`
      Parameters:
        `foregroundMode` - Whether the player is allowed to keep limited resources even when in the idle state.

    - #### setPauseAtEndOfMediaItems

          public void setPauseAtEndOfMediaItems​(boolean pauseAtEndOfMediaItems)

      Description copied from interface: `ExoPlayer`
      Sets whether to pause playback at the end of each media item.

      This means the player will pause at the end of each window in the current `timeline`. Listeners will be informed by a call to `Player.Listener.onPlayWhenReadyChanged(boolean, int)` with the reason `Player.PLAY_WHEN_READY_CHANGE_REASON_END_OF_MEDIA_ITEM` when this happens.

      Specified by:
        `setPauseAtEndOfMediaItems` in interface `ExoPlayer`
      Parameters:
        `pauseAtEndOfMediaItems` - Whether to pause playback at the end of each media item.

    - #### getPauseAtEndOfMediaItems

          public boolean getPauseAtEndOfMediaItems()

      Description copied from interface: `ExoPlayer`
      Returns whether the player pauses playback at the end of each media item.
      Specified by:
        `getPauseAtEndOfMediaItems` in interface `ExoPlayer`
      See Also:
        `ExoPlayer.setPauseAtEndOfMediaItems(boolean)`

    - #### experimentalSetOffloadSchedulingEnabled

          public void experimentalSetOffloadSchedulingEnabled​(boolean offloadSchedulingEnabled)

      Description copied from interface: `ExoPlayer`
      Sets whether audio offload scheduling is enabled. If enabled, ExoPlayer's main loop will run as rarely as possible when playing an audio stream using audio offload.

      Only use this scheduling mode if the player is not displaying anything to the user. For example when the application is in the background, or the screen is off. The player state (including position) is rarely updated (roughly between every 10 seconds and 1 minute).

      While offload scheduling is enabled, player events may be delivered severely delayed and apps should not interact with the player. When returning to the foreground, disable offload scheduling and wait for `ExoPlayer.AudioOffloadListener.onExperimentalOffloadSchedulingEnabledChanged(boolean)` to be called with `offloadSchedulingEnabled = false` before interacting with the player.

      This mode should save significant power when the phone is playing offload audio with the screen off.

      This mode only has an effect when playing an audio track in offload mode, which requires all the following:

      - Audio offload rendering is enabled in `DefaultRenderersFactory.setEnableAudioOffload(boolean)` or the equivalent option passed to `DefaultAudioSink(AudioCapabilities, DefaultAudioSink.AudioProcessorChain, boolean, boolean, int)`.
      - An audio track is playing in a format that the device supports offloading (for example, MP3 or AAC).
      - The `AudioSink` is playing with an offload `AudioTrack`.

      The state where ExoPlayer main loop has been paused to save power during offload playback can be queried with `ExoPlayer.experimentalIsSleepingForOffload()`.

      This method is experimental, and will be renamed or removed in a future release.

      Specified by:
        `experimentalSetOffloadSchedulingEnabled` in interface `ExoPlayer`
      Parameters:
        `offloadSchedulingEnabled` - Whether to enable offload scheduling.

    - #### experimentalIsSleepingForOffload

          public boolean experimentalIsSleepingForOffload()

      Description copied from interface: `ExoPlayer`
      Returns whether the player has paused its main loop to save power in offload scheduling mode.
      Specified by:
        `experimentalIsSleepingForOffload` in interface `ExoPlayer`
      See Also:
        `ExoPlayer.experimentalSetOffloadSchedulingEnabled(boolean)`, `ExoPlayer.AudioOffloadListener.onExperimentalSleepingForOffloadChanged(boolean)`