Package com.google.android.exoplayer2.testutil

## Class StubPlayer

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

- All Implemented Interfaces:
    `Player`
  Direct Known Subclasses:
    `StubExoPlayer`

      public class StubPlayer
      extends BasePlayer

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

- - ### 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 class com.google.android.exoplayer2.BasePlayer

      `window`

    - ### 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_TRACKS, 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_ITEM, 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
    --- | ---
    `StubPlayer()` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `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` | `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.
    `void` | `decreaseDeviceVolume()` | Decreases the volume of the device.
    `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.
    `Player.Commands` | `getAvailableCommands()` | Returns the player's currently available `Player.Commands`.
    `long` | `getBufferedPosition()` | Returns an estimate of the position in the current content or ad up to which data is buffered, in milliseconds.
    `long` | `getContentBufferedPosition()` | If `Player.isPlayingAd()` returns `true`, returns an estimate of the content position in the current content up to which data is buffered, in milliseconds.
    `long` | `getContentPosition()` | 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.
    `CueGroup` | `getCurrentCues()` | Returns the current `CueGroup`.
    `int` | `getCurrentMediaItemIndex()` | Returns the index of the current `MediaItem` in the `timeline`, or the prospective index if the `current timeline` is empty.
    `int` | `getCurrentPeriodIndex()` | Returns the index of the period currently being played.
    `long` | `getCurrentPosition()` | Returns the playback position in the current content or ad, in milliseconds, or the prospective position in milliseconds if the `current timeline` is empty.
    `Timeline` | `getCurrentTimeline()` | Returns the current `Timeline`.
    `Tracks` | `getCurrentTracks()` | Returns the current tracks.
    `DeviceInfo` | `getDeviceInfo()` | Gets the device information.
    `int` | `getDeviceVolume()` | Gets the current volume of the device.
    `long` | `getDuration()` | Returns the duration of the current content or ad in milliseconds, or `C.TIME_UNSET` if the duration is not known.
    `long` | `getMaxSeekToPreviousPosition()` | Returns the maximum position for which `Player.seekToPrevious()` seeks to the previous `MediaItem`, in milliseconds.
    `MediaMetadata` | `getMediaMetadata()` | Returns the current combined `MediaMetadata`, or `MediaMetadata.EMPTY` if not supported.
    `PlaybackParameters` | `getPlaybackParameters()` | Returns the currently active playback parameters.
    `@com.google.android.exoplayer2.Player.State int` | `getPlaybackState()` | Returns the current playback state of the player.
    `@com.google.android.exoplayer2.Player.PlaybackSuppressionReason 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.
    `PlaybackException` | `getPlayerError()` | Returns the error that caused playback to fail.
    `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` | `getRepeatMode()` | Returns the current `Player.RepeatMode` used for playback.
    `long` | `getSeekBackIncrement()` | Returns the `Player.seekBack()` increment.
    `long` | `getSeekForwardIncrement()` | Returns the `Player.seekForward()` increment.
    `boolean` | `getShuffleModeEnabled()` | Returns whether shuffling of media items is enabled.
    `Size` | `getSurfaceSize()` | Gets the size of the surface on which the video is rendered.
    `long` | `getTotalBufferedDuration()` | Returns an estimate of the total buffered duration from the current position, in milliseconds.
    `TrackSelectionParameters` | `getTrackSelectionParameters()` | Returns the parameters constraining the track selection.
    `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()` | Prepares the player.
    `void` | `release()` | Releases the player.
    `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` | `seekTo​(int mediaItemIndex, long positionMs, @com.google.android.exoplayer2.Player.Command int seekCommand, boolean isRepeatingCurrentItem)` | Seeks to a position in the specified `MediaItem`.
    `void` | `setDeviceMuted​(boolean muted)` | Sets the mute state of the device.
    `void` | `setDeviceVolume​(int volume)` | Sets the volume of the device.
    `void` | `setMediaItems​(List<MediaItem> mediaItems, boolean resetPosition)` | Clears the playlist and adds the specified media items.
    `void` | `setMediaItems​(List<MediaItem> mediaItems, int startIndex, long startPositionMs)` | Clears the playlist and adds the specified media items.
    `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​(@com.google.android.exoplayer2.Player.RepeatMode int repeatMode)` | Sets the `Player.RepeatMode` to be used for playback.
    `void` | `setShuffleModeEnabled​(boolean shuffleModeEnabled)` | Sets whether shuffling of media items is enabled.
    `void` | `setTrackSelectionParameters​(TrackSelectionParameters parameters)` | Sets the parameters constraining the track selection.
    `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 volume)` | Sets the audio volume, valid values are between 0 (silence) and 1 (unity gain, signal unchanged), inclusive.
    `void` | `stop()` | Stops playback without resetting the playlist.
    `void` | `stop​(boolean reset)` | Deprecated. Use `stop()` and `BasePlayer.clearMediaItems()` (if `reset` is true) or just `stop()` (if `reset` is false).

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

      `addMediaItem, addMediaItem, addMediaItems, canAdvertiseSession, clearMediaItems, getBufferedPercentage, getContentDuration, getCurrentLiveOffset, getCurrentManifest, getCurrentMediaItem, getCurrentWindowIndex, getMediaItemAt, getMediaItemCount, getNextMediaItemIndex, getNextWindowIndex, getPreviousMediaItemIndex, getPreviousWindowIndex, hasNext, hasNextMediaItem, hasNextWindow, hasPrevious, hasPreviousMediaItem, hasPreviousWindow, isCommandAvailable, isCurrentMediaItemDynamic, isCurrentMediaItemLive, isCurrentMediaItemSeekable, isCurrentWindowDynamic, isCurrentWindowLive, isCurrentWindowSeekable, isPlaying, moveMediaItem, next, pause, play, previous, removeMediaItem, seekBack, seekForward, seekTo, seekTo, seekToDefaultPosition, seekToDefaultPosition, seekToNext, seekToNextMediaItem, seekToNextWindow, seekToPrevious, seekToPreviousMediaItem, seekToPreviousWindow, setMediaItem, setMediaItem, setMediaItem, setMediaItems, setPlaybackSpeed`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### StubPlayer

          public StubPlayer()

  - ### Method Detail

    - #### 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.

      This method can be called from any thread.

    - #### 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 associated with `Player.getApplicationLooper()`.

      This method can be called from any thread.

      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.
      Parameters:
        `listener` - The listener to unregister.

    - #### getPlaybackState

          @State
          public @com.google.android.exoplayer2.Player.State int getPlaybackState()

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

    - #### getPlaybackSuppressionReason

          @PlaybackSuppressionReason
          public @com.google.android.exoplayer2.Player.PlaybackSuppressionReason 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.
      Returns:
        The current `Player.PlaybackSuppressionReason`.
      See Also:
        `Player.Listener.onPlaybackSuppressionReasonChanged(int)`

    - #### getPlayerError

          @Nullable
          public PlaybackException getPlayerError()

      Description copied from interface: `Player`
      Returns the error that caused playback to fail. This is the same error that will have been reported via `Player.Listener.onPlayerError(PlaybackException)` at the time of failure. It can be queried using this method until the player is re-prepared.

      Note that this method will always return `null` if `Player.getPlaybackState()` is not `Player.STATE_IDLE`.

      Returns:
        The error, or `null`.
      See Also:
        `Player.Listener.onPlayerError(PlaybackException)`

    - #### prepare

          public void prepare()

      Description copied from interface: `Player`
      Prepares the player.

      This method must only be called if `Player.COMMAND_PREPARE` is available.

      This will move the player out of `idle state` and the player will start loading media and acquire resources needed for playback.

    - #### setMediaItems

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

      Description copied from interface: `Player`
      Clears the playlist and adds the specified media items.

      This method must only be called if `Player.COMMAND_CHANGE_MEDIA_ITEMS` is available.

      Parameters:
        `mediaItems` - The new media items.
        `resetPosition` - Whether the playback position should be reset to the default position in the first `Timeline.Window`. If false, playback will start from the position defined by `Player.getCurrentMediaItemIndex()` and `Player.getCurrentPosition()`.

    - #### setMediaItems

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

      Description copied from interface: `Player`
      Clears the playlist and adds the specified media items.

      This method must only be called if `Player.COMMAND_CHANGE_MEDIA_ITEMS` is available.

      Parameters:
        `mediaItems` - The new media items.
        `startIndex` - The `MediaItem` index to start playback from. If `C.INDEX_UNSET` is passed, the current position is not reset.
        `startPositionMs` - The position in milliseconds to start playback from. If `C.TIME_UNSET` is passed, the default position of the given `MediaItem` is used. In any case, if `startIndex` is set to `C.INDEX_UNSET`, this parameter is ignored and the position is not reset at all.

    - #### 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.

      This method must only be called if `Player.COMMAND_CHANGE_MEDIA_ITEMS` is available.

      Parameters:
        `index` - The index at which to add the media items. If the index is larger than the size of the playlist, the media items are added to the end of the playlist.
        `mediaItems` - The media items to add.

    - #### moveMediaItems

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

      Description copied from interface: `Player`
      Moves the media item range to the new index.

      This method must only be called if `Player.COMMAND_CHANGE_MEDIA_ITEMS` is available.

      Parameters:
        `fromIndex` - The start of the range to move. If the index is larger than the size of the playlist, the request is ignored.
        `toIndex` - The first item not to be included in the range (exclusive). If the index is larger than the size of the playlist, items up to the end of the playlist are moved.
        `newIndex` - The new index of the first media item of the range. If the new index is larger than the size of the remaining playlist after removing the range, the range is moved to the end of the playlist.

    - #### removeMediaItems

          public void removeMediaItems​(int fromIndex,
                                       int toIndex)

      Description copied from interface: `Player`
      Removes a range of media items from the playlist.

      This method must only be called if `Player.COMMAND_CHANGE_MEDIA_ITEMS` is available.

      Parameters:
        `fromIndex` - The index at which to start removing media items. If the index is larger than the size of the playlist, the request is ignored.
        `toIndex` - The index of the first item to be kept (exclusive). If the index is larger than the size of the playlist, media items up to the end of the playlist are removed.

    - #### 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.

      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.

      This method must only be called if `Player.COMMAND_PLAY_PAUSE` is available.

      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`.
      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)

      Description copied from interface: `Player`
      Sets the `Player.RepeatMode` to be used for playback.

      This method must only be called if `Player.COMMAND_SET_REPEAT_MODE` is available.

      Parameters:
        `repeatMode` - The repeat mode.

    - #### getRepeatMode

          public int getRepeatMode()

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

    - #### setShuffleModeEnabled

          public void setShuffleModeEnabled​(boolean shuffleModeEnabled)

      Description copied from interface: `Player`
      Sets whether shuffling of media items is enabled.

      This method must only be called if `Player.COMMAND_SET_SHUFFLE_MODE` is available.

      Parameters:
        `shuffleModeEnabled` - Whether shuffling is enabled.

    - #### getShuffleModeEnabled

          public boolean getShuffleModeEnabled()

      Description copied from interface: `Player`
      Returns whether shuffling of media items is enabled.
      See Also:
        `Player.Listener.onShuffleModeEnabledChanged(boolean)`

    - #### isLoading

          public boolean isLoading()

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

    - #### seekTo

          public void seekTo​(int mediaItemIndex,
                             long positionMs,
                             @Command
                             @com.google.android.exoplayer2.Player.Command int seekCommand,
                             boolean isRepeatingCurrentItem)

      Description copied from class: `BasePlayer`
      Seeks to a position in the specified `MediaItem`.
      Specified by:
        `seekTo` in class `BasePlayer`
      Parameters:
        `mediaItemIndex` - The index of the `MediaItem`.
        `positionMs` - The seek position in the specified `MediaItem` in milliseconds, or `C.TIME_UNSET` to seek to the media item's default position.
        `seekCommand` - The `Player.Command` used to trigger the seek.
        `isRepeatingCurrentItem` - Whether this seeks repeats the current item.

    - #### getSeekBackIncrement

          public long getSeekBackIncrement()

      Description copied from interface: `Player`
      Returns the `Player.seekBack()` increment.
      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.
      Returns:
        The seek forward increment, in milliseconds.
      See Also:
        `Player.Listener.onSeekForwardIncrementChanged(long)`

    - #### getMaxSeekToPreviousPosition

          public long getMaxSeekToPreviousPosition()

      Description copied from interface: `Player`
      Returns the maximum position for which `Player.seekToPrevious()` seeks to the previous `MediaItem`, in milliseconds.
      Returns:
        The maximum seek to previous position, in milliseconds.
      See Also:
        `Player.Listener.onMaxSeekToPreviousPositionChanged(long)`

    - #### 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.

      This method must only be called if `Player.COMMAND_SET_SPEED_AND_PITCH` is available.

      Parameters:
        `playbackParameters` - The playback parameters.

    - #### getPlaybackParameters

          public PlaybackParameters getPlaybackParameters()

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

    - #### stop

          public void stop()

      Description copied from interface: `Player`
      Stops playback without resetting the playlist. Use `Player.pause()` rather than this method if the intention is to pause playback.

      Calling this method will cause the playback state to transition to `Player.STATE_IDLE` and the player will release the loaded media and resources required for playback. The player instance can still be used by calling `Player.prepare()` again, and `Player.release()` must still be called on the player if it's no longer required.

      Calling this method does not clear the playlist, reset the playback position or the playback error.

      This method must only be called if `Player.COMMAND_STOP` is available.

    - #### stop

          @Deprecated
          public void stop​(boolean reset)

      Deprecated.
      Use `stop()` and `BasePlayer.clearMediaItems()` (if `reset` is true) or just `stop()` (if `reset` is false). Any player error will be cleared when `re-preparing` the 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.

    - #### getCurrentTracks

          public Tracks getCurrentTracks()

      Description copied from interface: `Player`
      Returns the current tracks.

      This method must only be called if `Player.COMMAND_GET_TRACKS` is available.

      See Also:
        `Player.Listener.onTracksChanged(Tracks)`

    - #### getTrackSelectionParameters

          public TrackSelectionParameters getTrackSelectionParameters()

      Description copied from interface: `Player`
      Returns the parameters constraining the track selection.
      See Also:
        `}`

    - #### setTrackSelectionParameters

          public void setTrackSelectionParameters​(TrackSelectionParameters parameters)

      Description copied from interface: `Player`
      Sets the parameters constraining the track selection.

      Unsupported parameters will be silently ignored.

      Use `Player.getTrackSelectionParameters()` to retrieve the current parameters. For example, the following snippet restricts video to SD whilst keep other track selection parameters unchanged:

           player.setTrackSelectionParameters(
             player.getTrackSelectionParameters()
                   .buildUpon()
                   .setMaxVideoSizeSd()
                   .build())

      This method must only be called if `Player.COMMAND_SET_TRACK_SELECTION_PARAMETERS` is available.

    - #### 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 metadata`, the static metadata in the media's `Format`, and any timed metadata that has been parsed from the media and output via `Player.Listener.onMetadata(Metadata)`. If a field is populated in the `MediaItem.mediaMetadata`, it will be prioritised above the same field coming from static or timed metadata.

      This method must only be called if `Player.COMMAND_GET_MEDIA_ITEMS_METADATA` is available.

    - #### 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.

      This method must only be called if `Player.COMMAND_GET_MEDIA_ITEMS_METADATA` is available.

    - #### setPlaylistMetadata

          public void setPlaylistMetadata​(MediaMetadata mediaMetadata)

      Description copied from interface: `Player`
      Sets the playlist `MediaMetadata`.

      This method must only be called if `Player.COMMAND_SET_MEDIA_ITEMS_METADATA` is available.

    - #### getCurrentTimeline

          public Timeline getCurrentTimeline()

      Description copied from interface: `Player`
      Returns the current `Timeline`. Never null, but may be empty.

      This method must only be called if `Player.COMMAND_GET_TIMELINE` is available.

      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.

      This method must only be called if `Player.COMMAND_GET_TIMELINE` is available.

    - #### getCurrentMediaItemIndex

          public int getCurrentMediaItemIndex()

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

      This method must only be called if `Player.COMMAND_GET_TIMELINE` is available.

    - #### getDuration

          public long getDuration()

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

      This method must only be called if `Player.COMMAND_GET_CURRENT_MEDIA_ITEM` is available.

    - #### getCurrentPosition

          public long getCurrentPosition()

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

      This method must only be called if `Player.COMMAND_GET_CURRENT_MEDIA_ITEM` is available.

    - #### getBufferedPosition

          public long getBufferedPosition()

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

      This method must only be called if `Player.COMMAND_GET_CURRENT_MEDIA_ITEM` is available.

    - #### 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 media items.

      This method must only be called if `Player.COMMAND_GET_CURRENT_MEDIA_ITEM` is available.

    - #### isPlayingAd

          public boolean isPlayingAd()

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

      This method must only be called if `Player.COMMAND_GET_CURRENT_MEDIA_ITEM` is available.

    - #### 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.

      This method must only be called if `Player.COMMAND_GET_CURRENT_MEDIA_ITEM` is available.

    - #### 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.

      This method must only be called if `Player.COMMAND_GET_CURRENT_MEDIA_ITEM` is available.

    - #### 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()`.

      This method must only be called if `Player.COMMAND_GET_CURRENT_MEDIA_ITEM` is available.

    - #### 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 up to which data is buffered, in milliseconds. If there is no ad playing, the returned position is the same as that returned by `Player.getBufferedPosition()`.

      This method must only be called if `Player.COMMAND_GET_CURRENT_MEDIA_ITEM` is available.

    - #### getAudioAttributes

          public AudioAttributes getAudioAttributes()

      Description copied from interface: `Player`
      Returns the attributes for audio playback.

      This method must only be called if `Player.COMMAND_GET_AUDIO_ATTRIBUTES` is available.

    - #### setVolume

          public void setVolume​(float volume)

      Description copied from interface: `Player`
      Sets the audio volume, valid values are between 0 (silence) and 1 (unity gain, signal unchanged), inclusive.

      This method must only be called if `Player.COMMAND_SET_VOLUME` is available.

      Parameters:
        `volume` - 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).

      This method must only be called if `Player.COMMAND_GET_VOLUME` is available.

      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.

      This method must only be called if `Player.COMMAND_SET_VIDEO_SURFACE` is available.

    - #### 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.

      This method must only be called if `Player.COMMAND_SET_VIDEO_SURFACE` is available.

      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.

      This method must only be called if `Player.COMMAND_SET_VIDEO_SURFACE` is available.

      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()`.

      This method must only be called if `Player.COMMAND_SET_VIDEO_SURFACE` is available.

      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.

      This method must only be called if `Player.COMMAND_SET_VIDEO_SURFACE` is available.

      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()`.

      This method must only be called if `Player.COMMAND_SET_VIDEO_SURFACE` is available.

      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.

      This method must only be called if `Player.COMMAND_SET_VIDEO_SURFACE` is available.

      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()`.

      This method must only be called if `Player.COMMAND_SET_VIDEO_SURFACE` is available.

      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.

      This method must only be called if `Player.COMMAND_SET_VIDEO_SURFACE` is available.

      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.

      See Also:
        `Player.Listener.onVideoSizeChanged(VideoSize)`

    - #### getSurfaceSize

          public Size getSurfaceSize()

      Description copied from interface: `Player`
      Gets the size of the surface on which the video is rendered.
      See Also:
        `Player.Listener.onSurfaceSizeChanged(int, int)`

    - #### getCurrentCues

          public CueGroup getCurrentCues()

      Description copied from interface: `Player`
      Returns the current `CueGroup`.

      This method must only be called if `Player.COMMAND_GET_TEXT` is available.

    - #### getDeviceInfo

          public DeviceInfo getDeviceInfo()

      Description copied from interface: `Player`
      Gets the device information.

    - #### 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.

      This method must only be called if `Player.COMMAND_GET_DEVICE_VOLUME` is available.

    - #### isDeviceMuted

          public boolean isDeviceMuted()

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

      This method must only be called if `Player.COMMAND_GET_DEVICE_VOLUME` is available.

    - #### setDeviceVolume

          public void setDeviceVolume​(int volume)

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

      This method must only be called if `Player.COMMAND_SET_DEVICE_VOLUME` is available.

      Parameters:
        `volume` - The volume to set.

    - #### increaseDeviceVolume

          public void increaseDeviceVolume()

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

      This method must only be called if `Player.COMMAND_ADJUST_DEVICE_VOLUME` is available.

    - #### decreaseDeviceVolume

          public void decreaseDeviceVolume()

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

      This method must only be called if `Player.COMMAND_ADJUST_DEVICE_VOLUME` is available.

    - #### setDeviceMuted

          public void setDeviceMuted​(boolean muted)

      Description copied from interface: `Player`
      Sets the mute state of the device.

      This method must only be called if `Player.COMMAND_ADJUST_DEVICE_VOLUME` is available.