Package com.google.android.exoplayer2

## Class SimpleExoPlayer

- java.lang.Object
- - com.google.android.exoplayer2.BasePlayer
  - - com.google.android.exoplayer2.SimpleExoPlayer

- All Implemented Interfaces:
    `ExoPlayer`, `ExoPlayer.AudioComponent`, `ExoPlayer.DeviceComponent`, `ExoPlayer.MetadataComponent`, `ExoPlayer.TextComponent`, `ExoPlayer.VideoComponent`, `Player`

      public class SimpleExoPlayer
      extends BasePlayer
      implements ExoPlayer, ExoPlayer.AudioComponent, ExoPlayer.VideoComponent, ExoPlayer.TextComponent, ExoPlayer.MetadataComponent, ExoPlayer.DeviceComponent

  An `ExoPlayer` implementation that uses default `Renderer` components. Instances can be obtained from `SimpleExoPlayer.Builder`.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class | Description
    --- | --- | ---
    `static class` | `SimpleExoPlayer.Builder` | A builder for `SimpleExoPlayer` instances.

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

      `ExoPlayer.AudioComponent, ExoPlayer.AudioOffloadListener, 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.EventFlags, Player.EventListener, Player.Events, Player.Listener, Player.MediaItemTransitionReason, Player.PlaybackSuppressionReason, Player.PlayWhenReadyChangeReason, Player.PositionInfo, Player.RepeatMode, Player.State, Player.TimelineChangeReason`

  - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `static long` | `DEFAULT_DETACH_SURFACE_TIMEOUT_MS` | The default timeout for detaching a surface from the player, in milliseconds.
    `protected Renderer[]` | `renderers` |

    - ### 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, COMMAND_GET_MEDIA_ITEMS_METADATA, COMMAND_GET_TEXT, COMMAND_GET_VOLUME, COMMAND_PLAY_PAUSE, COMMAND_PREPARE_STOP, COMMAND_SEEK_IN_CURRENT_MEDIA_ITEM, COMMAND_SEEK_TO_DEFAULT_POSITION, COMMAND_SEEK_TO_MEDIA_ITEM, COMMAND_SEEK_TO_NEXT_MEDIA_ITEM, COMMAND_SEEK_TO_PREVIOUS_MEDIA_ITEM, COMMAND_SET_DEVICE_VOLUME, 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_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_POSITION_DISCONTINUITY, EVENT_REPEAT_MODE_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
    Modifier | Constructor | Description
    --- | --- | ---
    `protected` | `SimpleExoPlayer​(Context context, RenderersFactory renderersFactory, TrackSelector trackSelector, MediaSourceFactory mediaSourceFactory, LoadControl loadControl, BandwidthMeter bandwidthMeter, AnalyticsCollector analyticsCollector, boolean useLazyPreparation, Clock clock, Looper applicationLooper)` | Deprecated. Use the `SimpleExoPlayer.Builder` and pass it to `SimpleExoPlayer(Builder)`.
    `protected` | `SimpleExoPlayer​(SimpleExoPlayer.Builder builder)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `addAnalyticsListener​(AnalyticsListener listener)` | Adds an `AnalyticsListener` to receive analytics events.
    `void` | `addAudioListener​(AudioListener listener)` | Adds a listener to receive audio events.
    `void` | `addAudioOffloadListener​(ExoPlayer.AudioOffloadListener listener)` | Adds a listener to receive audio offload events.
    `void` | `addDeviceListener​(DeviceListener listener)` | Adds a listener to receive device 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` | `addMetadataOutput​(MetadataOutput listener)` | Adds a `MetadataOutput` to receive metadata.
    `void` | `addTextOutput​(TextOutput listener)` | Registers an output to receive text events.
    `void` | `addVideoListener​(VideoListener listener)` | Adds a listener to receive video events.
    `void` | `clearAuxEffectInfo()` | Detaches any previously attached auxiliary audio effect from the underlying audio track.
    `void` | `clearCameraMotionListener​(CameraMotionListener listener)` | Clears the listener which receives camera motion events if it matches the one passed.
    `void` | `clearVideoFrameMetadataListener​(VideoFrameMetadataListener listener)` | Clears the listener which receives video frame metadata events if it matches the one passed.
    `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.
    `AnalyticsCollector` | `getAnalyticsCollector()` | Returns the `AnalyticsCollector` used for collecting analytics events.
    `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.
    `DecoderCounters` | `getAudioDecoderCounters()` | Returns `DecoderCounters` for audio, or null if no audio is being played.
    `Format` | `getAudioFormat()` | Returns the audio format currently being played, or null if no audio is being played.
    `int` | `getAudioSessionId()` | Returns the audio session identifier, or `C.AUDIO_SESSION_ID_UNSET` if not set.
    `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()` | Returns the current static metadata for the track selections.
    `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.
    `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()` | Returns the error that caused playback to fail.
    `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.
    `SeekParameters` | `getSeekParameters()` | Returns the currently active `SeekParameters` of the player.
    `boolean` | `getShuffleModeEnabled()` | Returns whether shuffling of windows is enabled.
    `boolean` | `getSkipSilenceEnabled()` | Returns whether skipping silences in the audio stream 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.
    `DecoderCounters` | `getVideoDecoderCounters()` | Returns `DecoderCounters` for video, or null if no video is being played.
    `Format` | `getVideoFormat()` | Returns the video format currently being played, or null if no video is being played.
    `int` | `getVideoScalingMode()` | Returns the `C.VideoScalingMode`.
    `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` | `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` | `removeAnalyticsListener​(AnalyticsListener listener)` | Removes an `AnalyticsListener`.
    `void` | `removeAudioListener​(AudioListener listener)` | Removes a listener of audio events.
    `void` | `removeAudioOffloadListener​(ExoPlayer.AudioOffloadListener listener)` | Removes a listener of audio offload events.
    `void` | `removeDeviceListener​(DeviceListener listener)` | Removes a listener of device 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` | `removeMetadataOutput​(MetadataOutput listener)` | Removes a `MetadataOutput`.
    `void` | `removeTextOutput​(TextOutput listener)` | Removes a text output.
    `void` | `removeVideoListener​(VideoListener listener)` | Removes a listener of video events.
    `void` | `retry()` | Deprecated. Use `prepare()` instead.
    `void` | `seekTo​(int windowIndex, long positionMs)` | Seeks to a position specified in milliseconds in the specified window.
    `void` | `setAudioAttributes​(AudioAttributes audioAttributes, boolean handleAudioFocus)` | Sets the attributes for audio playback, used by the underlying audio track.
    `void` | `setAudioSessionId​(int audioSessionId)` | Sets the ID of the audio session to attach to the underlying `AudioTrack`.
    `void` | `setAuxEffectInfo​(AuxEffectInfo auxEffectInfo)` | Sets information on an auxiliary audio effect to attach to the underlying audio track.
    `void` | `setCameraMotionListener​(CameraMotionListener listener)` | Sets a listener of camera motion events.
    `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` | `setHandleAudioBecomingNoisy​(boolean handleAudioBecomingNoisy)` | Sets whether the player should pause automatically when audio is rerouted from a headset to device speakers.
    `void` | `setHandleWakeLock​(boolean handleWakeLock)` | Deprecated. Use `setWakeMode(int)` instead.
    `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` | `setPlayWhenReady​(boolean playWhenReady)` | Sets whether playback should proceed when `Player.getPlaybackState()` == `Player.STATE_READY`.
    `void` | `setPriorityTaskManager​(PriorityTaskManager priorityTaskManager)` | Sets a `PriorityTaskManager`, or null to clear a previously set priority task manager.
    `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` | `setSkipSilenceEnabled​(boolean skipSilenceEnabled)` | Sets whether skipping silences in the audio stream is enabled.
    `void` | `setThrowsWhenUsingWrongThread​(boolean throwsWhenUsingWrongThread)` | Deprecated. Disabling the enforcement can result in hard-to-detect bugs.
    `void` | `setVideoFrameMetadataListener​(VideoFrameMetadataListener listener)` | Sets a listener to receive video frame metadata events.
    `void` | `setVideoScalingMode​(int videoScalingMode)` | Sets the video scaling mode.
    `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` | `setWakeMode​(int wakeMode)` | Sets how the player should keep the device awake for playback when the screen is off.
    `void` | `stop​(boolean reset)` |

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

      `addMediaItem, addMediaItem, addMediaItems, clearMediaItems, getAvailableCommands, getBufferedPercentage, getContentDuration, getCurrentLiveOffset, getCurrentManifest, getCurrentMediaItem, getCurrentTag, getMediaItemAt, getMediaItemCount, getNextWindowIndex, getPlaybackError, getPreviousWindowIndex, hasNext, hasPrevious, isCommandAvailable, isCurrentWindowDynamic, isCurrentWindowLive, isCurrentWindowSeekable, isPlaying, moveMediaItem, next, pause, play, previous, removeMediaItem, seekTo, seekToDefaultPosition, seekToDefaultPosition, 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, getCurrentTag, getMediaItemAt, getMediaItemCount, getNextWindowIndex, getPlaybackError, getPreviousWindowIndex, hasNext, hasPrevious, isCommandAvailable, isCurrentWindowDynamic, isCurrentWindowLive, isCurrentWindowSeekable, isPlaying, moveMediaItem, next, pause, play, previous, removeMediaItem, seekTo, seekToDefaultPosition, seekToDefaultPosition, setMediaItem, setMediaItem, setMediaItem, setMediaItems, setPlaybackSpeed, stop`

- - ### Field Detail

    - #### DEFAULT_DETACH_SURFACE_TIMEOUT_MS

          public static final long DEFAULT_DETACH_SURFACE_TIMEOUT_MS

      The default timeout for detaching a surface from the player, in milliseconds.
      See Also:
        Constant Field Values

    - #### renderers

          protected final Renderer[] renderers

  - ### Constructor Detail

    - #### SimpleExoPlayer

          @Deprecated
          protected SimpleExoPlayer​(Context context,
                                    RenderersFactory renderersFactory,
                                    TrackSelector trackSelector,
                                    MediaSourceFactory mediaSourceFactory,
                                    LoadControl loadControl,
                                    BandwidthMeter bandwidthMeter,
                                    AnalyticsCollector analyticsCollector,
                                    boolean useLazyPreparation,
                                    Clock clock,
                                    Looper applicationLooper)

      Deprecated.
      Use the `SimpleExoPlayer.Builder` and pass it to `SimpleExoPlayer(Builder)`.

    - #### SimpleExoPlayer

          protected SimpleExoPlayer​(SimpleExoPlayer.Builder builder)

      Parameters:
        `builder` - The `SimpleExoPlayer.Builder` to obtain all construction parameters.

  - ### Method Detail

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

    - #### getAudioComponent

          @Nullable
          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

          @Nullable
          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

          @Nullable
          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

          @Nullable
          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

          @Nullable
          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`

    - #### setVideoScalingMode

          public void setVideoScalingMode​(@VideoScalingMode
                                          int videoScalingMode)

      Sets the video scaling mode.

      Note that the scaling mode only applies if a `MediaCodec`-based video `Renderer` is enabled and if the output surface is owned by a `SurfaceView`.

      Specified by:
        `setVideoScalingMode` in interface `ExoPlayer.VideoComponent`
      Parameters:
        `videoScalingMode` - The `C.VideoScalingMode`.

    - #### getVideoScalingMode

          @VideoScalingMode
          public int getVideoScalingMode()

      Description copied from interface: `ExoPlayer.VideoComponent`
      Returns the `C.VideoScalingMode`.
      Specified by:
        `getVideoScalingMode` in interface `ExoPlayer.VideoComponent`

    - #### 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 `ExoPlayer.VideoComponent`
      Specified by:
        `getVideoSize` in interface `Player`
      See Also:
        `VideoListener.onVideoSizeChanged(VideoSize)`

    - #### 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 `ExoPlayer.VideoComponent`
      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 `ExoPlayer.VideoComponent`
      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 `ExoPlayer.VideoComponent`
      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.
      Specified by:
        `setVideoSurfaceHolder` in interface `ExoPlayer.VideoComponent`
      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 `ExoPlayer.VideoComponent`
      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.
      Specified by:
        `setVideoSurfaceView` in interface `ExoPlayer.VideoComponent`
      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 `ExoPlayer.VideoComponent`
      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.
      Specified by:
        `setVideoTextureView` in interface `ExoPlayer.VideoComponent`
      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 `ExoPlayer.VideoComponent`
      Specified by:
        `clearVideoTextureView` in interface `Player`
      Parameters:
        `textureView` - The texture view to clear.

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

    - #### addAudioListener

          public void addAudioListener​(AudioListener listener)

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

    - #### removeAudioListener

          public void removeAudioListener​(AudioListener listener)

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

    - #### setAudioAttributes

          public void setAudioAttributes​(AudioAttributes audioAttributes,
                                         boolean handleAudioFocus)

      Description copied from interface: `ExoPlayer.AudioComponent`
      Sets the attributes for audio playback, used by the underlying audio track. If not set, the default audio attributes will be used. They are suitable for general media playback.

      Setting the audio attributes during playback may introduce a short gap in audio output as the audio track is recreated. A new audio session id will also be generated.

      If tunneling is enabled by the track selector, the specified audio attributes will be ignored, but they will take effect if audio is later played without tunneling.

      If the device is running a build before platform API version 21, audio attributes cannot be set directly on the underlying audio track. In this case, the usage will be mapped onto an equivalent stream type using `Util.getStreamTypeForAudioUsage(int)`.

      If audio focus should be handled, the `AudioAttributes.usage` must be `C.USAGE_MEDIA` or `C.USAGE_GAME`. Other usages will throw an `IllegalArgumentException`.

      Specified by:
        `setAudioAttributes` in interface `ExoPlayer.AudioComponent`
      Parameters:
        `audioAttributes` - The attributes to use for audio playback.
        `handleAudioFocus` - True if the player should handle audio focus, false otherwise.

    - #### getAudioAttributes

          public AudioAttributes getAudioAttributes()

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

    - #### setAudioSessionId

          public void setAudioSessionId​(int audioSessionId)

      Description copied from interface: `ExoPlayer.AudioComponent`
      Sets the ID of the audio session to attach to the underlying `AudioTrack`.

      The audio session ID can be generated using `C.generateAudioSessionIdV21(Context)` for API 21+.

      Specified by:
        `setAudioSessionId` in interface `ExoPlayer.AudioComponent`
      Parameters:
        `audioSessionId` - The audio session ID, or `C.AUDIO_SESSION_ID_UNSET` if it should be generated by the framework.

    - #### getAudioSessionId

          public int getAudioSessionId()

      Description copied from interface: `ExoPlayer.AudioComponent`
      Returns the audio session identifier, or `C.AUDIO_SESSION_ID_UNSET` if not set.
      Specified by:
        `getAudioSessionId` in interface `ExoPlayer.AudioComponent`

    - #### setAuxEffectInfo

          public void setAuxEffectInfo​(AuxEffectInfo auxEffectInfo)

      Description copied from interface: `ExoPlayer.AudioComponent`
      Sets information on an auxiliary audio effect to attach to the underlying audio track.
      Specified by:
        `setAuxEffectInfo` in interface `ExoPlayer.AudioComponent`

    - #### clearAuxEffectInfo

          public void clearAuxEffectInfo()

      Description copied from interface: `ExoPlayer.AudioComponent`
      Detaches any previously attached auxiliary audio effect from the underlying audio track.
      Specified by:
        `clearAuxEffectInfo` in interface `ExoPlayer.AudioComponent`

    - #### 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 `ExoPlayer.AudioComponent`
      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 `ExoPlayer.AudioComponent`
      Specified by:
        `getVolume` in interface `Player`
      Returns:
        The linear gain applied to all audio channels.

    - #### getSkipSilenceEnabled

          public boolean getSkipSilenceEnabled()

      Description copied from interface: `ExoPlayer.AudioComponent`
      Returns whether skipping silences in the audio stream is enabled.
      Specified by:
        `getSkipSilenceEnabled` in interface `ExoPlayer.AudioComponent`

    - #### setSkipSilenceEnabled

          public void setSkipSilenceEnabled​(boolean skipSilenceEnabled)

      Description copied from interface: `ExoPlayer.AudioComponent`
      Sets whether skipping silences in the audio stream is enabled.
      Specified by:
        `setSkipSilenceEnabled` in interface `ExoPlayer.AudioComponent`
      Parameters:
        `skipSilenceEnabled` - Whether skipping silences in the audio stream is enabled.

    - #### getAnalyticsCollector

          public AnalyticsCollector getAnalyticsCollector()

      Returns the `AnalyticsCollector` used for collecting analytics events.

    - #### addAnalyticsListener

          public void addAnalyticsListener​(AnalyticsListener listener)

      Adds an `AnalyticsListener` to receive analytics events.
      Parameters:
        `listener` - The listener to be added.

    - #### removeAnalyticsListener

          public void removeAnalyticsListener​(AnalyticsListener listener)

      Removes an `AnalyticsListener`.
      Parameters:
        `listener` - The listener to be removed.

    - #### setHandleAudioBecomingNoisy

          public void setHandleAudioBecomingNoisy​(boolean handleAudioBecomingNoisy)

      Sets whether the player should pause automatically when audio is rerouted from a headset to device speakers. See the audio becoming noisy documentation for more information.
      Parameters:
        `handleAudioBecomingNoisy` - Whether the player should pause automatically when audio is rerouted from a headset to device speakers.

    - #### setPriorityTaskManager

          public void setPriorityTaskManager​(@Nullable
                                             PriorityTaskManager priorityTaskManager)

      Sets a `PriorityTaskManager`, or null to clear a previously set priority task manager.

      The priority `C.PRIORITY_PLAYBACK` will be set while the player is loading.

      Parameters:
        `priorityTaskManager` - The `PriorityTaskManager`, or null to clear a previously set priority task manager.

    - #### getVideoFormat

          @Nullable
          public Format getVideoFormat()

      Returns the video format currently being played, or null if no video is being played.

    - #### getAudioFormat

          @Nullable
          public Format getAudioFormat()

      Returns the audio format currently being played, or null if no audio is being played.

    - #### getVideoDecoderCounters

          @Nullable
          public DecoderCounters getVideoDecoderCounters()

      Returns `DecoderCounters` for video, or null if no video is being played.

    - #### getAudioDecoderCounters

          @Nullable
          public DecoderCounters getAudioDecoderCounters()

      Returns `DecoderCounters` for audio, or null if no audio is being played.

    - #### addVideoListener

          public void addVideoListener​(VideoListener listener)

      Description copied from interface: `ExoPlayer.VideoComponent`
      Adds a listener to receive video events.
      Specified by:
        `addVideoListener` in interface `ExoPlayer.VideoComponent`
      Parameters:
        `listener` - The listener to register.

    - #### removeVideoListener

          public void removeVideoListener​(VideoListener listener)

      Description copied from interface: `ExoPlayer.VideoComponent`
      Removes a listener of video events.
      Specified by:
        `removeVideoListener` in interface `ExoPlayer.VideoComponent`
      Parameters:
        `listener` - The listener to unregister.

    - #### setVideoFrameMetadataListener

          public void setVideoFrameMetadataListener​(VideoFrameMetadataListener listener)

      Description copied from interface: `ExoPlayer.VideoComponent`
      Sets a listener to receive video frame metadata events.

      This method is intended to be called by the same component that sets the `Surface` onto which video will be rendered. If using ExoPlayer's standard UI components, this method should not be called directly from application code.

      Specified by:
        `setVideoFrameMetadataListener` in interface `ExoPlayer.VideoComponent`
      Parameters:
        `listener` - The listener.

    - #### clearVideoFrameMetadataListener

          public void clearVideoFrameMetadataListener​(VideoFrameMetadataListener listener)

      Description copied from interface: `ExoPlayer.VideoComponent`
      Clears the listener which receives video frame metadata events if it matches the one passed. Else does nothing.
      Specified by:
        `clearVideoFrameMetadataListener` in interface `ExoPlayer.VideoComponent`
      Parameters:
        `listener` - The listener to clear.

    - #### setCameraMotionListener

          public void setCameraMotionListener​(CameraMotionListener listener)

      Description copied from interface: `ExoPlayer.VideoComponent`
      Sets a listener of camera motion events.
      Specified by:
        `setCameraMotionListener` in interface `ExoPlayer.VideoComponent`
      Parameters:
        `listener` - The listener.

    - #### clearCameraMotionListener

          public void clearCameraMotionListener​(CameraMotionListener listener)

      Description copied from interface: `ExoPlayer.VideoComponent`
      Clears the listener which receives camera motion events if it matches the one passed. Else does nothing.
      Specified by:
        `clearCameraMotionListener` in interface `ExoPlayer.VideoComponent`
      Parameters:
        `listener` - The listener to clear.

    - #### addTextOutput

          public void addTextOutput​(TextOutput listener)

      Description copied from interface: `ExoPlayer.TextComponent`
      Registers an output to receive text events.
      Specified by:
        `addTextOutput` in interface `ExoPlayer.TextComponent`
      Parameters:
        `listener` - The output to register.

    - #### removeTextOutput

          public void removeTextOutput​(TextOutput listener)

      Description copied from interface: `ExoPlayer.TextComponent`
      Removes a text output.
      Specified by:
        `removeTextOutput` in interface `ExoPlayer.TextComponent`
      Parameters:
        `listener` - The output to remove.

    - #### getCurrentCues

          public List<Cue> getCurrentCues()

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

    - #### addMetadataOutput

          public void addMetadataOutput​(MetadataOutput listener)

      Description copied from interface: `ExoPlayer.MetadataComponent`
      Adds a `MetadataOutput` to receive metadata.
      Specified by:
        `addMetadataOutput` in interface `ExoPlayer.MetadataComponent`
      Parameters:
        `listener` - The output to register.

    - #### removeMetadataOutput

          public void removeMetadataOutput​(MetadataOutput listener)

      Description copied from interface: `ExoPlayer.MetadataComponent`
      Removes a `MetadataOutput`.
      Specified by:
        `removeMetadataOutput` in interface `ExoPlayer.MetadataComponent`
      Parameters:
        `listener` - The output to remove.

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

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

    - #### getPlayerError

          @Nullable
          public ExoPlaybackException 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.EventListener.onPlayerError(ExoPlaybackException)` 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`.

      Specified by:
        `getPlayerError` in interface `Player`
      Returns:
        The error, or `null`.
      See Also:
        `Player.EventListener.onPlayerError(ExoPlaybackException)`

    - #### retry

          @Deprecated
          public void retry()

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

    - #### 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.EventListener.onAvailableCommandsChanged(Commands)` to get an update when the available commands change.

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

      `Player.COMMAND_SEEK_TO_NEXT_MEDIA_ITEM` and `Player.COMMAND_SEEK_TO_PREVIOUS_MEDIA_ITEM` are unavailable if there is no such `MediaItem`.

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

    - #### prepare

          public void prepare()

      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.

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

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

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

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

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

    - #### 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.EventListener.onPlayWhenReadyChanged(boolean, int)`

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

    - #### getRepeatMode

          @RepeatMode
          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.EventListener.onRepeatModeChanged(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.

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

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

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

    - #### 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.EventListener.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.EventListener.onTracksChanged(TrackGroupArray, TrackSelectionArray)`

    - #### getCurrentStaticMetadata

          public List<Metadata> getCurrentStaticMetadata()

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

      The returned `metadataList` is an immutable list of `Metadata` instances, where the elements correspond to the `current track selections`, or an empty list if there are no track selections or the selected tracks contain no static metadata.

      This metadata is considered static in that it comes from the tracks' declared Formats, rather than being timed (or dynamic) metadata, which is represented within a metadata track.

      Specified by:
        `getCurrentStaticMetadata` in interface `Player`
      See Also:
        `Player.EventListener.onStaticMetadataChanged(List)`

    - #### 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 sourced from `Player.EventListener.onStaticMetadataChanged(List)` and `MetadataOutput.onMetadata(Metadata)`.

      Specified by:
        `getMediaMetadata` 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.EventListener.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`

    - #### setHandleWakeLock

          @Deprecated
          public void setHandleWakeLock​(boolean handleWakeLock)

      Deprecated.
      Use `setWakeMode(int)` instead.
      Sets whether the player should use a `PowerManager.WakeLock` to ensure the device stays awake for playback, even when the screen is off.

      Enabling this feature requires the `Manifest.permission.WAKE_LOCK` permission. It should be used together with a foreground `Service` for use cases where playback can occur when the screen is off (e.g. background audio playback). It is not useful if the screen will always be on during playback (e.g. foreground video playback).

      Parameters:
        `handleWakeLock` - Whether the player should use a `PowerManager.WakeLock` to ensure the device stays awake for playback, even when the screen is off.

    - #### setWakeMode

          public void setWakeMode​(@WakeMode
                                  int wakeMode)

      Sets how the player should keep the device awake for playback when the screen is off.

      Enabling this feature requires the `Manifest.permission.WAKE_LOCK` permission. It should be used together with a foreground `Service` for use cases where playback occurs and the screen is off (e.g. background audio playback). It is not useful when the screen will be kept on during playback (e.g. foreground video playback).

      When enabled, the locks (`PowerManager.WakeLock` / `WifiManager.WifiLock`) will be held whenever the player is in the `Player.STATE_READY` or `Player.STATE_BUFFERING` states with `playWhenReady = true`. The locks held depends on the specified `C.WakeMode`.

      Parameters:
        `wakeMode` - The `C.WakeMode` option to keep the device awake during playback.

    - #### addDeviceListener

          public void addDeviceListener​(DeviceListener listener)

      Description copied from interface: `ExoPlayer.DeviceComponent`
      Adds a listener to receive device events.
      Specified by:
        `addDeviceListener` in interface `ExoPlayer.DeviceComponent`

    - #### removeDeviceListener

          public void removeDeviceListener​(DeviceListener listener)

      Description copied from interface: `ExoPlayer.DeviceComponent`
      Removes a listener of device events.
      Specified by:
        `removeDeviceListener` in interface `ExoPlayer.DeviceComponent`

    - #### getDeviceInfo

          public DeviceInfo getDeviceInfo()

      Description copied from interface: `Player`
      Gets the device information.
      Specified by:
        `getDeviceInfo` in interface `ExoPlayer.DeviceComponent`
      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 `ExoPlayer.DeviceComponent`
      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 `ExoPlayer.DeviceComponent`
      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 `ExoPlayer.DeviceComponent`
      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 `ExoPlayer.DeviceComponent`
      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 `ExoPlayer.DeviceComponent`
      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 `ExoPlayer.DeviceComponent`
      Specified by:
        `setDeviceMuted` in interface `Player`

    - #### setThrowsWhenUsingWrongThread

          @Deprecated
          public void setThrowsWhenUsingWrongThread​(boolean throwsWhenUsingWrongThread)

      Deprecated.
      Disabling the enforcement can result in hard-to-detect bugs. Do not use this method except to ease the transition while wrong thread access problems are fixed.
      Sets whether the player should throw an `IllegalStateException` when methods are called from a thread other than the one associated with `getApplicationLooper()`.

      The default is `true` and this method will be removed in the future.

      Parameters:
        `throwsWhenUsingWrongThread` - Whether to throw when methods are called from a wrong thread.