# ExoPlayer.Builder

Artifact: [androidx.media3:media3-exoplayer](https://developer.android.com/jetpack/androidx/releases/media3) [View Source](https://cs.android.com/search?q=file:androidx/media3/exoplayer/ExoPlayer.java+class:androidx.media3.exoplayer.ExoPlayer.Builder)

*** ** * ** ***


```
class ExoPlayer.Builder
```

<br />

*** ** * ** ***

A builder for `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer` instances.

See `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder#Builder(android.content.Context)` for the list of default values.

## Summary

| ### Constants |
|---|---|
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `@https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder#DEFAULT_DETACH_SURFACE_TIMEOUT_MS() = 2000` The default timeout for detaching a surface from the player, in milliseconds. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `@https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder#DEFAULT_RELEASE_TIMEOUT_MS() = 500` The default timeout for calls to `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer#release()` and `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer#setForegroundMode(boolean)`, in milliseconds. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `@https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder#DEFAULT_STUCK_BUFFERING_DETECTION_TIMEOUT_MS() = 600000` The default timeout for detecting whether playback is stuck buffering, in milliseconds. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `@https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder#DEFAULT_STUCK_PLAYING_DETECTION_TIMEOUT_MS()` The default timeout for detecting whether playback is stuck playing, in milliseconds. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `@https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder#DEFAULT_STUCK_PLAYING_NOT_ENDING_TIMEOUT_MS() = 60000` The default timeout for detecting whether playback is stuck playing but not ending, in milliseconds. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `@https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder#DEFAULT_STUCK_SUPPRESSED_DETECTION_TIMEOUT_MS() = 600000` The default timeout for detecting whether playback is stuck in a suppressed state, in milliseconds. |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder#Builder(android.content.Context)(context: https://developer.android.com/reference/android/content/Context.html!)` Creates a builder. |
| `@https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder#Builder(android.content.Context,androidx.media3.exoplayer.source.MediaSource.Factory)(context: https://developer.android.com/reference/android/content/Context.html!, mediaSourceFactory: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.Factory!)` Creates a builder with a custom `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.Factory`. |
| `@https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder#Builder(android.content.Context,androidx.media3.exoplayer.RenderersFactory)(context: https://developer.android.com/reference/android/content/Context.html!, renderersFactory: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/RenderersFactory!)` Creates a builder with a custom `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/RenderersFactory`. |
| `@https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder#Builder(android.content.Context,androidx.media3.exoplayer.RenderersFactory,androidx.media3.exoplayer.source.MediaSource.Factory)( context: https://developer.android.com/reference/android/content/Context.html!, renderersFactory: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/RenderersFactory!, mediaSourceFactory: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.Factory! )` Creates a builder with a custom `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/RenderersFactory` and `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.Factory`. |
| `@https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder#Builder(android.content.Context,androidx.media3.exoplayer.RenderersFactory,androidx.media3.exoplayer.source.MediaSource.Factory,androidx.media3.exoplayer.trackselection.TrackSelector,androidx.media3.exoplayer.LoadControl,androidx.media3.exoplayer.upstream.BandwidthMeter,androidx.media3.exoplayer.analytics.AnalyticsCollector)( context: https://developer.android.com/reference/android/content/Context.html!, renderersFactory: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/RenderersFactory!, mediaSourceFactory: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.Factory!, trackSelector: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/trackselection/TrackSelector!, loadControl: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/LoadControl!, bandwidthMeter: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/BandwidthMeter!, analyticsCollector: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/AnalyticsCollector! )` Creates a builder with the specified custom components. |

| ### Public functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer!` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder#build()()` Builds an `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer` instance. |
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html @https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi @https://developer.android.com/reference/kotlin/androidx/media3/common/util/ExperimentalApi https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder#experimentalSetForegroundModeTimeoutMs(long)(timeoutMs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)` Sets a limit on the time a call to `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer#setForegroundMode(boolean)` can spend. |
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html @https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder#setAnalyticsCollector(androidx.media3.exoplayer.analytics.AnalyticsCollector)(analyticsCollector: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/AnalyticsCollector!)` Sets the `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/AnalyticsCollector` that will collect and forward all player events. |
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder#setAudioAttributes(androidx.media3.common.AudioAttributes,boolean)( audioAttributes: https://developer.android.com/reference/kotlin/androidx/media3/common/AudioAttributes!, handleAudioFocus: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html )` Sets `https://developer.android.com/reference/kotlin/androidx/media3/common/AudioAttributes` that will be used by the player and whether to handle audio focus. |
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder#setAudioOutputProvider(androidx.media3.exoplayer.audio.AudioOutputProvider)(audioOutputProvider: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/audio/AudioOutputProvider!)` Sets the `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/audio/AudioOutputProvider` that will be used to play out audio data. |
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html @https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder#setBandwidthMeter(androidx.media3.exoplayer.upstream.BandwidthMeter)(bandwidthMeter: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/BandwidthMeter!)` Sets the `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/BandwidthMeter` that will be used by the player. |
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html @https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi @https://developer.android.com/reference/kotlin/androidx/annotation/VisibleForTesting https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder#setClock(androidx.media3.common.util.Clock)(clock: https://developer.android.com/reference/kotlin/androidx/media3/common/util/Clock!)` Sets the `https://developer.android.com/reference/kotlin/androidx/media3/common/util/Clock` that will be used by the player. |
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html @https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder#setDetachSurfaceTimeoutMs(long)(detachSurfaceTimeoutMs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)` Sets a timeout for detaching a surface from the player. |
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html @https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder#setDeviceVolumeControlEnabled(boolean)(deviceVolumeControlEnabled: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)` Sets whether the player is allowed to set, increase, decrease or mute device volume. |
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html @https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder#setEnforceAdPlaybackOnTimelineRefresh(boolean)( enforceAdPlaybackOnTimelineRefresh: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html )` Sets whether to enforce ad playback when the timeline is refreshed by a source update. |
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder#setHandleAudioBecomingNoisy(boolean)(handleAudioBecomingNoisy: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)` Sets whether the player should pause automatically when audio is rerouted from a headset to device speakers. |
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html @https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder#setLivePlaybackSpeedControl(androidx.media3.exoplayer.LivePlaybackSpeedControl)( livePlaybackSpeedControl: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/LivePlaybackSpeedControl! )` Sets the `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/LivePlaybackSpeedControl` that will control the playback speed when playing live streams, in order to maintain a steady target offset from the live stream edge. |
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html @https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder#setLoadControl(androidx.media3.exoplayer.LoadControl)(loadControl: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/LoadControl!)` Sets the `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/LoadControl` that will be used by the player. |
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html @https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder#setLooper(android.os.Looper)(looper: https://developer.android.com/reference/android/os/Looper.html!)` Sets the `https://developer.android.com/reference/android/os/Looper.html` that must be used for all calls to the player and that is used to call listeners on. |
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html @https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder#setMaxSeekToPreviousPositionMs(long)( maxSeekToPreviousPositionMs: @https://developer.android.com/reference/kotlin/androidx/annotation/IntRange(from = 0) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html )` Sets the maximum position for which `https://developer.android.com/reference/kotlin/androidx/media3/common/Player#seekToPrevious()` seeks to the previous `https://developer.android.com/reference/kotlin/androidx/media3/common/MediaItem`. |
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder#setMediaSourceFactory(androidx.media3.exoplayer.source.MediaSource.Factory)(mediaSourceFactory: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.Factory!)` Sets the `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.Factory` that will be used by the player. |
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html @https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder#setName(java.lang.String)(playerName: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!)` Sets the player name that is included in the `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlayerId` to recognize the player by its `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlayerId`. |
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html @https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder#setPauseAtEndOfMediaItems(boolean)(pauseAtEndOfMediaItems: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)` Sets whether to pause playback at the end of each media item. |
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html @https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder#setPlaybackLooper(android.os.Looper)(playbackLooper: https://developer.android.com/reference/android/os/Looper.html!)` Sets the `https://developer.android.com/reference/android/os/Looper.html` that will be used for playback. |
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html @https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder#setPriority(int)(@https://developer.android.com/reference/kotlin/androidx/media3/common/C.Priority priority: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Sets the `https://developer.android.com/reference/kotlin/androidx/media3/common/C.Priority` for this player. |
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html @https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder#setPriorityTaskManager(androidx.media3.common.PriorityTaskManager)(priorityTaskManager: https://developer.android.com/reference/kotlin/androidx/media3/common/PriorityTaskManager?)` Sets an `https://developer.android.com/reference/kotlin/androidx/media3/common/PriorityTaskManager` that will be used by the player. |
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html @https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder#setReleaseTimeoutMs(long)(releaseTimeoutMs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)` Sets a timeout for calls to `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer#release()` and `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer#setForegroundMode(boolean)`. |
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html @https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder#setRenderersFactory(androidx.media3.exoplayer.RenderersFactory)(renderersFactory: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/RenderersFactory!)` Sets the `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/RenderersFactory` that will be used by the player. |
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html @https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder#setScrubbingModeParameters(androidx.media3.exoplayer.ScrubbingModeParameters)( scrubbingModeParameters: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ScrubbingModeParameters! )` Sets the parameters that control the behavior in `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer#setScrubbingModeEnabled(boolean)`. |
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder#setSeekBackIncrementMs(long)(seekBackIncrementMs: @https://developer.android.com/reference/kotlin/androidx/annotation/IntRange(from = 1) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)` Sets the `https://developer.android.com/reference/kotlin/androidx/media3/common/Player#seekBack()` increment. |
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder#setSeekForwardIncrementMs(long)(seekForwardIncrementMs: @https://developer.android.com/reference/kotlin/androidx/annotation/IntRange(from = 1) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)` Sets the `https://developer.android.com/reference/kotlin/androidx/media3/common/Player#seekForward()` increment. |
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html @https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder#setSeekParameters(androidx.media3.exoplayer.SeekParameters)(seekParameters: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/SeekParameters!)` Sets the parameters that control how seek operations are performed. |
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html @https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder#setSkipSilenceEnabled(boolean)(skipSilenceEnabled: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)` Sets whether silences silences in the audio stream is enabled. |
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html @https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder#setStuckBufferingDetectionTimeoutMs(int)( stuckBufferingDetectionTimeoutMs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html )` Sets the timeout after which the player is assumed stuck buffering if it's in `https://developer.android.com/reference/kotlin/androidx/media3/common/Player#STATE_BUFFERING()` and no loading progress is made, in milliseconds. |
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html @https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder#setStuckPlayingDetectionTimeoutMs(int)(stuckPlayingDetectionTimeoutMs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Sets the timeout after which the player is assumed stuck playing if it's in `https://developer.android.com/reference/kotlin/androidx/media3/common/Player#STATE_READY()` and no playback progress is made, in milliseconds. |
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html @https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder#setStuckPlayingNotEndingTimeoutMs(int)(stuckPlayingNotEndingTimeoutMs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Sets the timeout after which the player is assumed stuck playing if it's in `https://developer.android.com/reference/kotlin/androidx/media3/common/Player#STATE_READY()` and the playback is not ending despite exceeding the declared duration, in milliseconds. |
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html @https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder#setStuckSuppressedDetectionTimeoutMs(int)( stuckSuppressedDetectionTimeoutMs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html )` Sets the timeout after which the player is assumed stuck in a suppressed state if it has a `https://developer.android.com/reference/kotlin/androidx/media3/common/Player#getPlaybackSuppressionReason()` other than `https://developer.android.com/reference/kotlin/androidx/media3/common/Player#PLAYBACK_SUPPRESSION_REASON_NONE()` or `https://developer.android.com/reference/kotlin/androidx/media3/common/Player#PLAYBACK_SUPPRESSION_REASON_TRANSIENT_AUDIO_FOCUS_LOSS()`, in milliseconds. |
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html @https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder#setSuppressPlaybackOnUnsuitableOutput(boolean)( suppressPlaybackOnUnsuitableOutput: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html )` Sets whether the player should suppress playback that is attempted on an unsuitable output. |
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html @https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder#setTrackSelector(androidx.media3.exoplayer.trackselection.TrackSelector)(trackSelector: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/trackselection/TrackSelector!)` Sets the `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/trackselection/TrackSelector` that will be used by the player. |
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html @https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder#setUseLazyPreparation(boolean)(useLazyPreparation: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)` Sets whether media sources should be initialized lazily. |
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html @https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder#setUsePlatformDiagnostics(boolean)(usePlatformDiagnostics: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)` Sets whether the player reports diagnostics data to the Android platform. |
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html @https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder#setVideoChangeFrameRateStrategy(int)( @https://developer.android.com/reference/kotlin/androidx/media3/common/C.VideoChangeFrameRateStrategy videoChangeFrameRateStrategy: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html )` Sets a `https://developer.android.com/reference/kotlin/androidx/media3/common/C.VideoChangeFrameRateStrategy` that will be used by the player when provided with a video output `https://developer.android.com/reference/android/view/Surface.html`. |
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html @https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder#setVideoScalingMode(int)(@https://developer.android.com/reference/kotlin/androidx/media3/common/C.VideoScalingMode videoScalingMode: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Sets the `https://developer.android.com/reference/kotlin/androidx/media3/common/C.VideoScalingMode` that will be used by the player. |
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder#setWakeMode(int)(@https://developer.android.com/reference/kotlin/androidx/media3/common/C.WakeMode wakeMode: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Sets the `https://developer.android.com/reference/kotlin/androidx/media3/common/C.WakeMode` that will be used by the player. |

## Constants

### DEFAULT_DETACH_SURFACE_TIMEOUT_MS

```
@UnstableApi
const val DEFAULT_DETACH_SURFACE_TIMEOUT_MS = 2000: Long
```

The default timeout for detaching a surface from the player, in milliseconds.

### DEFAULT_RELEASE_TIMEOUT_MS

```
@UnstableApi
const val DEFAULT_RELEASE_TIMEOUT_MS = 500: Long
```

The default timeout for calls to `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer#release()` and `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer#setForegroundMode(boolean)`, in milliseconds.

### DEFAULT_STUCK_BUFFERING_DETECTION_TIMEOUT_MS

```
@UnstableApi
const val DEFAULT_STUCK_BUFFERING_DETECTION_TIMEOUT_MS = 600000: Int
```

The default timeout for detecting whether playback is stuck buffering, in milliseconds.

### DEFAULT_STUCK_PLAYING_DETECTION_TIMEOUT_MS

```
@UnstableApi
const val DEFAULT_STUCK_PLAYING_DETECTION_TIMEOUT_MS: Int
```

The default timeout for detecting whether playback is stuck playing, in milliseconds.

### DEFAULT_STUCK_PLAYING_NOT_ENDING_TIMEOUT_MS

```
@UnstableApi
const val DEFAULT_STUCK_PLAYING_NOT_ENDING_TIMEOUT_MS = 60000: Int
```

The default timeout for detecting whether playback is stuck playing but not ending, in milliseconds.

### DEFAULT_STUCK_SUPPRESSED_DETECTION_TIMEOUT_MS

```
@UnstableApi
const val DEFAULT_STUCK_SUPPRESSED_DETECTION_TIMEOUT_MS = 600000: Int
```

The default timeout for detecting whether playback is stuck in a suppressed state, in milliseconds.

## Public constructors

### Builder

```
Builder(context: Context!)
```

Creates a builder.

Use `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder#Builder(android.content.Context,androidx.media3.exoplayer.RenderersFactory)`, `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder#Builder(android.content.Context,androidx.media3.exoplayer.source.MediaSource.Factory)` or `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder#Builder(android.content.Context,androidx.media3.exoplayer.RenderersFactory,androidx.media3.exoplayer.source.MediaSource.Factory)` instead, if you intend to provide a custom `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/RenderersFactory`, `https://developer.android.com/reference/kotlin/androidx/media3/extractor/ExtractorsFactory` or `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/DefaultMediaSourceFactory`. This is to ensure that ProGuard or R8 can remove ExoPlayer's `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DefaultRenderersFactory`, `https://developer.android.com/reference/kotlin/androidx/media3/extractor/DefaultExtractorsFactory` and `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/DefaultMediaSourceFactory` from the APK.

The builder uses the following default values:

- `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/RenderersFactory`: `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DefaultRenderersFactory`
- `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/trackselection/TrackSelector`: `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/trackselection/DefaultTrackSelector`
- `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.Factory`: `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/DefaultMediaSourceFactory`
- `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/LoadControl`: `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DefaultLoadControl`
- `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/BandwidthMeter`: `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/DefaultBandwidthMeter#getSingletonInstance(android.content.Context)`
- `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/LivePlaybackSpeedControl`: `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DefaultLivePlaybackSpeedControl`
- `https://developer.android.com/reference/android/os/Looper.html`: The `https://developer.android.com/reference/android/os/Looper.html` associated with the current thread, or the `https://developer.android.com/reference/android/os/Looper.html` of the application's main thread if the current thread doesn't have a `https://developer.android.com/reference/android/os/Looper.html`
- `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/AnalyticsCollector`: `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/AnalyticsCollector` with `https://developer.android.com/reference/kotlin/androidx/media3/common/util/Clock#DEFAULT()`
- `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/audio/AudioOutputProvider`: The `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/audio/AudioOutputProvider` configured by the `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/RenderersFactory`.
- `https://developer.android.com/reference/kotlin/androidx/media3/common/C.Priority`: `https://developer.android.com/reference/kotlin/androidx/media3/common/C#PRIORITY_PLAYBACK()`
- `https://developer.android.com/reference/kotlin/androidx/media3/common/PriorityTaskManager`: `null` (not used)
- `https://developer.android.com/reference/kotlin/androidx/media3/common/AudioAttributes`: `https://developer.android.com/reference/kotlin/androidx/media3/common/AudioAttributes#DEFAULT()`, not handling audio focus
- `https://developer.android.com/reference/kotlin/androidx/media3/common/C.WakeMode`: `https://developer.android.com/reference/kotlin/androidx/media3/common/C#WAKE_MODE_LOCAL()`, or `https://developer.android.com/reference/kotlin/androidx/media3/common/C#WAKE_MODE_NONE()` if any of the `stuck...DetectionTimeoutMs` values are set to `https://developer.android.com/reference/java/lang/Integer.html#MAX_VALUE`.
- `handleAudioBecomingNoisy`: `false`
- `suppressPlaybackOnUnsuitableOutput`: `false`
- `skipSilenceEnabled`: `false`
- `https://developer.android.com/reference/kotlin/androidx/media3/common/C.VideoScalingMode`: `https://developer.android.com/reference/kotlin/androidx/media3/common/C#VIDEO_SCALING_MODE_DEFAULT()`
- `https://developer.android.com/reference/kotlin/androidx/media3/common/C.VideoChangeFrameRateStrategy`: `https://developer.android.com/reference/kotlin/androidx/media3/common/C#VIDEO_CHANGE_FRAME_RATE_STRATEGY_ONLY_IF_SEAMLESS()`
- `useLazyPreparation`: `true`
- `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/SeekParameters`: `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/SeekParameters#DEFAULT()`
- `seekBackIncrementMs`: `https://developer.android.com/reference/kotlin/androidx/media3/common/C#DEFAULT_SEEK_BACK_INCREMENT_MS()`
- `seekForwardIncrementMs`: `https://developer.android.com/reference/kotlin/androidx/media3/common/C#DEFAULT_SEEK_FORWARD_INCREMENT_MS()`
- `maxSeekToPreviousPositionMs`: `https://developer.android.com/reference/kotlin/androidx/media3/common/C#DEFAULT_MAX_SEEK_TO_PREVIOUS_POSITION_MS()`
- `releaseTimeoutMs`: `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder#DEFAULT_RELEASE_TIMEOUT_MS()`
- `detachSurfaceTimeoutMs`: `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder#DEFAULT_DETACH_SURFACE_TIMEOUT_MS()`
- `stuckBufferingDetectionTimeoutMs`: `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder#DEFAULT_STUCK_BUFFERING_DETECTION_TIMEOUT_MS()`
- `stuckPlayingDetectionTimeoutMs`: `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder#DEFAULT_STUCK_PLAYING_DETECTION_TIMEOUT_MS()`
- `stuckPlayingNotEndingTimeoutMs`: `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder#DEFAULT_STUCK_PLAYING_NOT_ENDING_TIMEOUT_MS()`
- `stuckSuppressedDetectionTimeoutMs`: `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder#DEFAULT_STUCK_SUPPRESSED_DETECTION_TIMEOUT_MS()`
- `pauseAtEndOfMediaItems`: `false`
- `usePlatformDiagnostics`: `true`
- `https://developer.android.com/reference/kotlin/androidx/media3/common/util/Clock`: `https://developer.android.com/reference/kotlin/androidx/media3/common/util/Clock#DEFAULT()`
- `playbackLooper`: `null` (create new thread)

| Parameters |
|---|---|
| `context: https://developer.android.com/reference/android/content/Context.html!` | A `https://developer.android.com/reference/android/content/Context.html`. |

### Builder

```
@UnstableApi
Builder(context: Context!, mediaSourceFactory: MediaSource.Factory!)
```

Creates a builder with a custom `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.Factory`.

See `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder#Builder(android.content.Context)` for a list of default values.

Note that this constructor is only useful to try and ensure that ExoPlayer's `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/DefaultMediaSourceFactory` (and therefore `https://developer.android.com/reference/kotlin/androidx/media3/extractor/DefaultExtractorsFactory`) can be removed by ProGuard or R8.

| Parameters |
|---|---|
| `context: https://developer.android.com/reference/android/content/Context.html!` | A `https://developer.android.com/reference/android/content/Context.html`. |
| `mediaSourceFactory: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.Factory!` | A factory for creating a `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource` from a `https://developer.android.com/reference/kotlin/androidx/media3/common/MediaItem`. |

### Builder

```
@UnstableApi
Builder(context: Context!, renderersFactory: RenderersFactory!)
```

Creates a builder with a custom `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/RenderersFactory`.

See `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder#Builder(android.content.Context)` for a list of default values.

Note that this constructor is only useful to try and ensure that ExoPlayer's `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DefaultRenderersFactory` can be removed by ProGuard or R8.

| Parameters |
|---|---|
| `context: https://developer.android.com/reference/android/content/Context.html!` | A `https://developer.android.com/reference/android/content/Context.html`. |
| `renderersFactory: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/RenderersFactory!` | A factory for creating `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/Renderer` to be used by the player. |

### Builder

```
@UnstableApi
Builder(
    context: Context!,
    renderersFactory: RenderersFactory!,
    mediaSourceFactory: MediaSource.Factory!
)
```

Creates a builder with a custom `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/RenderersFactory` and `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.Factory`.

See `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder#Builder(android.content.Context)` for a list of default values.

Note that this constructor is only useful to try and ensure that ExoPlayer's `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DefaultRenderersFactory`, `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/DefaultMediaSourceFactory` (and therefore `https://developer.android.com/reference/kotlin/androidx/media3/extractor/DefaultExtractorsFactory`) can be removed by ProGuard or R8.

| Parameters |
|---|---|
| `context: https://developer.android.com/reference/android/content/Context.html!` | A `https://developer.android.com/reference/android/content/Context.html`. |
| `renderersFactory: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/RenderersFactory!` | A factory for creating `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/Renderer` to be used by the player. |
| `mediaSourceFactory: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.Factory!` | A factory for creating a `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource` from a `https://developer.android.com/reference/kotlin/androidx/media3/common/MediaItem`. |

### Builder

```
@UnstableApi
Builder(
    context: Context!,
    renderersFactory: RenderersFactory!,
    mediaSourceFactory: MediaSource.Factory!,
    trackSelector: TrackSelector!,
    loadControl: LoadControl!,
    bandwidthMeter: BandwidthMeter!,
    analyticsCollector: AnalyticsCollector!
)
```

Creates a builder with the specified custom components.

Note that this constructor is only useful to try and ensure that ExoPlayer's default components can be removed by ProGuard or R8.

| Parameters |
|---|---|
| `context: https://developer.android.com/reference/android/content/Context.html!` | A `https://developer.android.com/reference/android/content/Context.html`. |
| `renderersFactory: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/RenderersFactory!` | A factory for creating `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/Renderer` to be used by the player. |
| `mediaSourceFactory: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.Factory!` | A `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.Factory`. |
| `trackSelector: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/trackselection/TrackSelector!` | A `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/trackselection/TrackSelector`. |
| `loadControl: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/LoadControl!` | A `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/LoadControl`. |
| `bandwidthMeter: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/BandwidthMeter!` | A `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/BandwidthMeter`. |
| `analyticsCollector: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/AnalyticsCollector!` | An `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/AnalyticsCollector`. |

## Public functions

### build

```
fun build(): ExoPlayer!
```

Builds an `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer` instance.

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalStateException.html` | If this method has already been called. |

### experimentalSetForegroundModeTimeoutMs

```
@CanIgnoreReturnValue
@UnstableApi
@ExperimentalApi
fun experimentalSetForegroundModeTimeoutMs(timeoutMs: Long): ExoPlayer.Builder!
```

Sets a limit on the time a call to `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer#setForegroundMode(boolean)` can spend. If a call to `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer#setForegroundMode(boolean)` takes more than `timeoutMs` milliseconds to complete, the player will raise an error via `https://developer.android.com/reference/kotlin/androidx/media3/common/Player.Listener#onPlayerError(androidx.media3.common.PlaybackException)`.

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

| Parameters |
|---|---|
| `timeoutMs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | The time limit in milliseconds. |

### setAnalyticsCollector

```
@CanIgnoreReturnValue
@UnstableApi
fun setAnalyticsCollector(analyticsCollector: AnalyticsCollector!): ExoPlayer.Builder!
```

Sets the `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/AnalyticsCollector` that will collect and forward all player events.

| Parameters |
|---|---|
| `analyticsCollector: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/AnalyticsCollector!` | An `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/AnalyticsCollector`. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder!` | This builder. |

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalStateException.html` | If `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder#build()` has already been called. |

### setAudioAttributes

```
@CanIgnoreReturnValue
fun setAudioAttributes(
    audioAttributes: AudioAttributes!,
    handleAudioFocus: Boolean
): ExoPlayer.Builder!
```

Sets `https://developer.android.com/reference/kotlin/androidx/media3/common/AudioAttributes` that will be used by the player and whether to handle audio focus.

If audio focus should be handled, the `https://developer.android.com/reference/kotlin/androidx/media3/common/AudioAttributes#usage()` must be `https://developer.android.com/reference/kotlin/androidx/media3/common/C#USAGE_MEDIA()` or `https://developer.android.com/reference/kotlin/androidx/media3/common/C#USAGE_GAME()`. Other usages will throw an `https://developer.android.com/reference/java/lang/IllegalArgumentException.html`.

| Parameters |
|---|---|
| `audioAttributes: https://developer.android.com/reference/kotlin/androidx/media3/common/AudioAttributes!` | `https://developer.android.com/reference/kotlin/androidx/media3/common/AudioAttributes`. |
| `handleAudioFocus: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | Whether the player should handle audio focus. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder!` | This builder. |

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalStateException.html` | If `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder#build()` has already been called. |

### setAudioOutputProvider

```
@CanIgnoreReturnValue
fun setAudioOutputProvider(audioOutputProvider: AudioOutputProvider!): ExoPlayer.Builder!
```

Sets the `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/audio/AudioOutputProvider` that will be used to play out audio data.

| Parameters |
|---|---|
| `audioOutputProvider: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/audio/AudioOutputProvider!` | An `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/audio/AudioOutputProvider`. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder!` | This builder. |

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalStateException.html` | If `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder#build()` has already been called. |

### setBandwidthMeter

```
@CanIgnoreReturnValue
@UnstableApi
fun setBandwidthMeter(bandwidthMeter: BandwidthMeter!): ExoPlayer.Builder!
```

Sets the `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/BandwidthMeter` that will be used by the player.

| Parameters |
|---|---|
| `bandwidthMeter: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/BandwidthMeter!` | A `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/BandwidthMeter`. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder!` | This builder. |

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalStateException.html` | If `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder#build()` has already been called. |
| `https://developer.android.com/reference/java/lang/IllegalArgumentException.html` | If `bandwidthMeter` is `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/BandwidthMeter#NO_OP()`. |

### setClock

```
@CanIgnoreReturnValue
@UnstableApi
@VisibleForTesting
fun setClock(clock: Clock!): ExoPlayer.Builder!
```

Sets the `https://developer.android.com/reference/kotlin/androidx/media3/common/util/Clock` that will be used by the player. Should only be set for testing purposes.

| Parameters |
|---|---|
| `clock: https://developer.android.com/reference/kotlin/androidx/media3/common/util/Clock!` | A `https://developer.android.com/reference/kotlin/androidx/media3/common/util/Clock`. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder!` | This builder. |

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalStateException.html` | If `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder#build()` has already been called. |

### setDetachSurfaceTimeoutMs

```
@CanIgnoreReturnValue
@UnstableApi
fun setDetachSurfaceTimeoutMs(detachSurfaceTimeoutMs: Long): ExoPlayer.Builder!
```

Sets a timeout for detaching a surface from the player.

If detaching a surface or replacing a surface takes more than `
detachSurfaceTimeoutMs` to complete, the player will report an error via `https://developer.android.com/reference/kotlin/androidx/media3/common/Player.Listener#onPlayerError(androidx.media3.common.PlaybackException)`.

| Parameters |
|---|---|
| `detachSurfaceTimeoutMs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | The timeout for detaching a surface, in milliseconds. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder!` | This builder. |

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalStateException.html` | If `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder#build()` has already been called. |

### setDeviceVolumeControlEnabled

```
@CanIgnoreReturnValue
@UnstableApi
fun setDeviceVolumeControlEnabled(deviceVolumeControlEnabled: Boolean): ExoPlayer.Builder!
```

Sets whether the player is allowed to set, increase, decrease or mute device volume.

| Parameters |
|---|---|
| `deviceVolumeControlEnabled: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | Whether controlling device volume is enabled. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder!` | This builder. |

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalStateException.html` | If `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder#build()` has already been called. |

### setEnforceAdPlaybackOnTimelineRefresh

```
@CanIgnoreReturnValue
@UnstableApi
fun setEnforceAdPlaybackOnTimelineRefresh(
    enforceAdPlaybackOnTimelineRefresh: Boolean
): ExoPlayer.Builder!
```

Sets whether to enforce ad playback when the timeline is refreshed by a source update.

If `true`, then an ad group resolved at or before the current playback position during a timeline refresh will be played. If `false`, then the resolved ad group will not play.

The default is `true`.

| Parameters |
|---|---|
| `enforceAdPlaybackOnTimelineRefresh: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | Whether to enforce ad playback on timeline refresh. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder!` | This builder. |

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalStateException.html` | If `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder#build()` has already been called. |

### setHandleAudioBecomingNoisy

```
@CanIgnoreReturnValue
fun setHandleAudioBecomingNoisy(handleAudioBecomingNoisy: Boolean): ExoPlayer.Builder!
```

Sets whether the player should pause automatically when audio is rerouted from a headset to device speakers. See the [audio becoming noisy](https://developer.android.com/media/platform/output#becoming-noisy) documentation for more information.

| Parameters |
|---|---|
| `handleAudioBecomingNoisy: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | Whether the player should pause automatically when audio is rerouted from a headset to device speakers. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder!` | This builder. |

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalStateException.html` | If `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder#build()` has already been called. |

### setLivePlaybackSpeedControl

```
@CanIgnoreReturnValue
@UnstableApi
fun setLivePlaybackSpeedControl(
    livePlaybackSpeedControl: LivePlaybackSpeedControl!
): ExoPlayer.Builder!
```

Sets the `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/LivePlaybackSpeedControl` that will control the playback speed when playing live streams, in order to maintain a steady target offset from the live stream edge.

| Parameters |
|---|---|
| `livePlaybackSpeedControl: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/LivePlaybackSpeedControl!` | The `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/LivePlaybackSpeedControl`. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder!` | This builder. |

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalStateException.html` | If `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder#build()` has already been called. |

### setLoadControl

```
@CanIgnoreReturnValue
@UnstableApi
fun setLoadControl(loadControl: LoadControl!): ExoPlayer.Builder!
```

Sets the `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/LoadControl` that will be used by the player.

| Parameters |
|---|---|
| `loadControl: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/LoadControl!` | A `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/LoadControl`. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder!` | This builder. |

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalStateException.html` | If `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder#build()` has already been called. |

### setLooper

```
@CanIgnoreReturnValue
@UnstableApi
fun setLooper(looper: Looper!): ExoPlayer.Builder!
```

Sets the `https://developer.android.com/reference/android/os/Looper.html` that must be used for all calls to the player and that is used to call listeners on.

| Parameters |
|---|---|
| `looper: https://developer.android.com/reference/android/os/Looper.html!` | A `https://developer.android.com/reference/android/os/Looper.html`. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder!` | This builder. |

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalStateException.html` | If `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder#build()` has already been called. |

### setMaxSeekToPreviousPositionMs

```
@CanIgnoreReturnValue
@UnstableApi
fun setMaxSeekToPreviousPositionMs(
    maxSeekToPreviousPositionMs: @IntRange(from = 0) Long
): ExoPlayer.Builder!
```

Sets the maximum position for which `https://developer.android.com/reference/kotlin/androidx/media3/common/Player#seekToPrevious()` seeks to the previous `https://developer.android.com/reference/kotlin/androidx/media3/common/MediaItem`.

| Parameters |
|---|---|
| `maxSeekToPreviousPositionMs: @https://developer.android.com/reference/kotlin/androidx/annotation/IntRange(from = 0) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | The maximum position, in milliseconds. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder!` | This builder. |

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException.html` | If `maxSeekToPreviousPositionMs` is negative. |
| `https://developer.android.com/reference/java/lang/IllegalStateException.html` | If `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder#build()` has already been called. |

### setMediaSourceFactory

```
@CanIgnoreReturnValue
fun setMediaSourceFactory(mediaSourceFactory: MediaSource.Factory!): ExoPlayer.Builder!
```

Sets the `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.Factory` that will be used by the player.

| Parameters |
|---|---|
| `mediaSourceFactory: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.Factory!` | A `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.Factory`. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder!` | This builder. |

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalStateException.html` | If `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder#build()` has already been called. |

### setName

```
@CanIgnoreReturnValue
@UnstableApi
fun setName(playerName: String!): ExoPlayer.Builder!
```

Sets the player name that is included in the `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlayerId` to recognize the player by its `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlayerId`.

This must not be equal to the `name` of `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlayerId#PRELOAD()` ("preload").

The default is an empty string.

| Parameters |
|---|---|
| `playerName: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | A name for the player in the `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlayerId`. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder!` | This builder. |

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalStateException.html` | If `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder#build()` has already been called. |
| `https://developer.android.com/reference/java/lang/IllegalArgumentException.html` | If the passed `playerName` is equal to the ` name` of `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlayerId#PRELOAD()` ("preload"). |

### setPauseAtEndOfMediaItems

```
@CanIgnoreReturnValue
@UnstableApi
fun setPauseAtEndOfMediaItems(pauseAtEndOfMediaItems: Boolean): ExoPlayer.Builder!
```

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 `https://developer.android.com/reference/kotlin/androidx/media3/common/Player#getCurrentTimeline()`. Listeners will be informed by a call to `https://developer.android.com/reference/kotlin/androidx/media3/common/Player.Listener#onPlayWhenReadyChanged(boolean,int)` with the reason `https://developer.android.com/reference/kotlin/androidx/media3/common/Player#PLAY_WHEN_READY_CHANGE_REASON_END_OF_MEDIA_ITEM()` when this happens.

| Parameters |
|---|---|
| `pauseAtEndOfMediaItems: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | Whether to pause playback at the end of each media item. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder!` | This builder. |

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalStateException.html` | If `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder#build()` has already been called. |

### setPlaybackLooper

```
@CanIgnoreReturnValue
@UnstableApi
fun setPlaybackLooper(playbackLooper: Looper!): ExoPlayer.Builder!
```

Sets the `https://developer.android.com/reference/android/os/Looper.html` that will be used for playback.

The backing thread should run with priority `https://developer.android.com/reference/android/os/Process.html#THREAD_PRIORITY_AUDIO` and should handle messages within 10ms.

| Parameters |
|---|---|
| `playbackLooper: https://developer.android.com/reference/android/os/Looper.html!` | A `https://developer.android.com/reference/android/os/Looper.html`. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder!` | This builder. |

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalStateException.html` | If `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder#build()` has already been called, or when the `https://developer.android.com/reference/android/os/Looper.html#getMainLooper()` is passed in. |

### setPriority

```
@CanIgnoreReturnValue
@UnstableApi
fun setPriority(@C.Priority priority: Int): ExoPlayer.Builder!
```

Sets the `https://developer.android.com/reference/kotlin/androidx/media3/common/C.Priority` for this player.

The priority may influence resource allocation between multiple players or other components running in the same app.

This priority is used for the `https://developer.android.com/reference/kotlin/androidx/media3/common/PriorityTaskManager`, if `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder#setPriorityTaskManager(androidx.media3.common.PriorityTaskManager)`.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/kotlin/androidx/media3/common/C.Priority priority: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The `https://developer.android.com/reference/kotlin/androidx/media3/common/C.Priority`. |

### setPriorityTaskManager

```
@CanIgnoreReturnValue
@UnstableApi
fun setPriorityTaskManager(priorityTaskManager: PriorityTaskManager?): ExoPlayer.Builder!
```

Sets an `https://developer.android.com/reference/kotlin/androidx/media3/common/PriorityTaskManager` that will be used by the player.

The priority set via `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder#setPriority(int)` (or `https://developer.android.com/reference/kotlin/androidx/media3/common/C#PRIORITY_PLAYBACK()` will be set while the player is loading.

| Parameters |
|---|---|
| `priorityTaskManager: https://developer.android.com/reference/kotlin/androidx/media3/common/PriorityTaskManager?` | A `https://developer.android.com/reference/kotlin/androidx/media3/common/PriorityTaskManager`, or null to not use one. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder!` | This builder. |

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalStateException.html` | If `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder#build()` has already been called. |

### setReleaseTimeoutMs

```
@CanIgnoreReturnValue
@UnstableApi
fun setReleaseTimeoutMs(releaseTimeoutMs: Long): ExoPlayer.Builder!
```

Sets a timeout for calls to `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer#release()` and `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer#setForegroundMode(boolean)`.

If a call to `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer#release()` or `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer#setForegroundMode(boolean)` takes more than `
timeoutMs` to complete, the player will report an error via `https://developer.android.com/reference/kotlin/androidx/media3/common/Player.Listener#onPlayerError(androidx.media3.common.PlaybackException)`.

| Parameters |
|---|---|
| `releaseTimeoutMs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | The release timeout, in milliseconds. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder!` | This builder. |

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalStateException.html` | If `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder#build()` has already been called. |

### setRenderersFactory

```
@CanIgnoreReturnValue
@UnstableApi
fun setRenderersFactory(renderersFactory: RenderersFactory!): ExoPlayer.Builder!
```

Sets the `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/RenderersFactory` that will be used by the player.

| Parameters |
|---|---|
| `renderersFactory: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/RenderersFactory!` | A `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/RenderersFactory`. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder!` | This builder. |

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalStateException.html` | If `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder#build()` has already been called. |

### setScrubbingModeParameters

```
@CanIgnoreReturnValue
@UnstableApi
fun setScrubbingModeParameters(
    scrubbingModeParameters: ScrubbingModeParameters!
): ExoPlayer.Builder!
```

Sets the parameters that control the behavior in `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer#setScrubbingModeEnabled(boolean)`.

| Parameters |
|---|---|
| `scrubbingModeParameters: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ScrubbingModeParameters!` | The `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ScrubbingModeParameters`. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder!` | This builder. |

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalStateException.html` | If `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder#build()` has already been called. |

### setSeekBackIncrementMs

```
@CanIgnoreReturnValue
fun setSeekBackIncrementMs(seekBackIncrementMs: @IntRange(from = 1) Long): ExoPlayer.Builder!
```

Sets the `https://developer.android.com/reference/kotlin/androidx/media3/common/Player#seekBack()` increment.

| Parameters |
|---|---|
| `seekBackIncrementMs: @https://developer.android.com/reference/kotlin/androidx/annotation/IntRange(from = 1) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | The seek back increment, in milliseconds. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder!` | This builder. |

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException.html` | If `seekBackIncrementMs` is non-positive. |
| `https://developer.android.com/reference/java/lang/IllegalStateException.html` | If `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder#build()` has already been called. |

### setSeekForwardIncrementMs

```
@CanIgnoreReturnValue
fun setSeekForwardIncrementMs(seekForwardIncrementMs: @IntRange(from = 1) Long): ExoPlayer.Builder!
```

Sets the `https://developer.android.com/reference/kotlin/androidx/media3/common/Player#seekForward()` increment.

| Parameters |
|---|---|
| `seekForwardIncrementMs: @https://developer.android.com/reference/kotlin/androidx/annotation/IntRange(from = 1) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | The seek forward increment, in milliseconds. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder!` | This builder. |

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException.html` | If `seekForwardIncrementMs` is non-positive. |
| `https://developer.android.com/reference/java/lang/IllegalStateException.html` | If `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder#build()` has already been called. |

### setSeekParameters

```
@CanIgnoreReturnValue
@UnstableApi
fun setSeekParameters(seekParameters: SeekParameters!): ExoPlayer.Builder!
```

Sets the parameters that control how seek operations are performed.

| Parameters |
|---|---|
| `seekParameters: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/SeekParameters!` | The `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/SeekParameters`. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder!` | This builder. |

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalStateException.html` | If `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder#build()` has already been called. |

### setSkipSilenceEnabled

```
@CanIgnoreReturnValue
@UnstableApi
fun setSkipSilenceEnabled(skipSilenceEnabled: Boolean): ExoPlayer.Builder!
```

Sets whether silences silences in the audio stream is enabled.

| Parameters |
|---|---|
| `skipSilenceEnabled: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | Whether skipping silences is enabled. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder!` | This builder. |

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalStateException.html` | If `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder#build()` has already been called. |

### setStuckBufferingDetectionTimeoutMs

```
@CanIgnoreReturnValue
@UnstableApi
fun setStuckBufferingDetectionTimeoutMs(
    stuckBufferingDetectionTimeoutMs: Int
): ExoPlayer.Builder!
```

Sets the timeout after which the player is assumed stuck buffering if it's in `https://developer.android.com/reference/kotlin/androidx/media3/common/Player#STATE_BUFFERING()` and no loading progress is made, in milliseconds.

If this timeout is triggered, the player will transition to an error state with a `https://developer.android.com/reference/kotlin/androidx/media3/common/util/StuckPlayerException` using `https://developer.android.com/reference/kotlin/androidx/media3/common/util/StuckPlayerException#STUCK_BUFFERING_NO_PROGRESS()`.

| Parameters |
|---|---|
| `stuckBufferingDetectionTimeoutMs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The timeout after which the player is assumed stuck buffering, in milliseconds. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder!` | This builder. |

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalStateException.html` | If `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder#build()` has already been called. |

### setStuckPlayingDetectionTimeoutMs

```
@CanIgnoreReturnValue
@UnstableApi
fun setStuckPlayingDetectionTimeoutMs(stuckPlayingDetectionTimeoutMs: Int): ExoPlayer.Builder!
```

Sets the timeout after which the player is assumed stuck playing if it's in `https://developer.android.com/reference/kotlin/androidx/media3/common/Player#STATE_READY()` and no playback progress is made, in milliseconds.

If this timeout is triggered, the player will transition to an error state with a `https://developer.android.com/reference/kotlin/androidx/media3/common/util/StuckPlayerException` using `https://developer.android.com/reference/kotlin/androidx/media3/common/util/StuckPlayerException#STUCK_PLAYING_NO_PROGRESS()`.

| Parameters |
|---|---|
| `stuckPlayingDetectionTimeoutMs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The timeout after which the player is assumed stuck playing, in milliseconds. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder!` | This builder. |

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalStateException.html` | If `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder#build()` has already been called. |

### setStuckPlayingNotEndingTimeoutMs

```
@CanIgnoreReturnValue
@UnstableApi
fun setStuckPlayingNotEndingTimeoutMs(stuckPlayingNotEndingTimeoutMs: Int): ExoPlayer.Builder!
```

Sets the timeout after which the player is assumed stuck playing if it's in `https://developer.android.com/reference/kotlin/androidx/media3/common/Player#STATE_READY()` and the playback is not ending despite exceeding the declared duration, in milliseconds.

If this timeout is triggered, the player will transition to an error state with a `https://developer.android.com/reference/kotlin/androidx/media3/common/util/StuckPlayerException` using `https://developer.android.com/reference/kotlin/androidx/media3/common/util/StuckPlayerException#STUCK_PLAYING_NOT_ENDING()`.

| Parameters |
|---|---|
| `stuckPlayingNotEndingTimeoutMs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The timeout after which the player is assumed stuck playing and not ending, in milliseconds. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder!` | This builder. |

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalStateException.html` | If `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder#build()` has already been called. |

### setStuckSuppressedDetectionTimeoutMs

```
@CanIgnoreReturnValue
@UnstableApi
fun setStuckSuppressedDetectionTimeoutMs(
    stuckSuppressedDetectionTimeoutMs: Int
): ExoPlayer.Builder!
```

Sets the timeout after which the player is assumed stuck in a suppressed state if it has a `https://developer.android.com/reference/kotlin/androidx/media3/common/Player#getPlaybackSuppressionReason()` other than `https://developer.android.com/reference/kotlin/androidx/media3/common/Player#PLAYBACK_SUPPRESSION_REASON_NONE()` or `https://developer.android.com/reference/kotlin/androidx/media3/common/Player#PLAYBACK_SUPPRESSION_REASON_TRANSIENT_AUDIO_FOCUS_LOSS()`, in milliseconds.

If this timeout is triggered, the player will transition to an error state with a `https://developer.android.com/reference/kotlin/androidx/media3/common/util/StuckPlayerException` using `https://developer.android.com/reference/kotlin/androidx/media3/common/util/StuckPlayerException#STUCK_SUPPRESSED()`.

| Parameters |
|---|---|
| `stuckSuppressedDetectionTimeoutMs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The timeout after which the player is assumed stuck in a suppressed state, in milliseconds. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder!` | This builder. |

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalStateException.html` | If `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder#build()` has already been called. |

### setSuppressPlaybackOnUnsuitableOutput

```
@CanIgnoreReturnValue
@UnstableApi
fun setSuppressPlaybackOnUnsuitableOutput(
    suppressPlaybackOnUnsuitableOutput: Boolean
): ExoPlayer.Builder!
```

Sets whether the player should suppress playback that is attempted on an unsuitable output. An example of an unsuitable audio output is the built-in speaker on a Wear OS device (unless it is explicitly selected by the user).

If called with `suppressPlaybackOnUnsuitableOutput = true`, then a playback attempt on an unsuitable audio output will result in calls to `https://developer.android.com/reference/kotlin/androidx/media3/common/Player.Listener#onPlaybackSuppressionReasonChanged(int)` with the value `https://developer.android.com/reference/kotlin/androidx/media3/common/Player#PLAYBACK_SUPPRESSION_REASON_UNSUITABLE_AUDIO_OUTPUT()`.

Callers of this may also want to enable `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder#setHandleAudioBecomingNoisy(boolean)` to prevent playback from continuing on the built-in speaker when a headset is disconnected.

| Parameters |
|---|---|
| `suppressPlaybackOnUnsuitableOutput: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | Whether the player should suppress the playback when it is attempted on an unsuitable output. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder!` | This builder. |

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalStateException.html` | If `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder#build()` has already been called. |

### setTrackSelector

```
@CanIgnoreReturnValue
@UnstableApi
fun setTrackSelector(trackSelector: TrackSelector!): ExoPlayer.Builder!
```

Sets the `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/trackselection/TrackSelector` that will be used by the player.

| Parameters |
|---|---|
| `trackSelector: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/trackselection/TrackSelector!` | A `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/trackselection/TrackSelector`. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder!` | This builder. |

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalStateException.html` | If `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder#build()` has already been called. |

### setUseLazyPreparation

```
@CanIgnoreReturnValue
@UnstableApi
fun setUseLazyPreparation(useLazyPreparation: Boolean): ExoPlayer.Builder!
```

Sets whether media sources should be initialized lazily.

If false, all initial preparation steps (e.g., manifest loads) happen immediately. If true, these initial preparations are triggered only when the player starts buffering the media.

| Parameters |
|---|---|
| `useLazyPreparation: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | Whether to use lazy preparation. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder!` | This builder. |

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalStateException.html` | If `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder#build()` has already been called. |

### setUsePlatformDiagnostics

```
@CanIgnoreReturnValue
@UnstableApi
fun setUsePlatformDiagnostics(usePlatformDiagnostics: Boolean): ExoPlayer.Builder!
```

Sets whether the player reports diagnostics data to the Android platform.

If enabled, the player will use the `https://developer.android.com/reference/android/media/metrics/MediaMetricsManager.html` to create a `https://developer.android.com/reference/android/media/metrics/PlaybackSession.html` and forward playback events and performance data to this session. This helps to provide system performance and debugging information for media playback on the device. This data may also be collected by Google [if sharing usage and diagnostics data is enabled](https://support.google.com/accounts/answer/6078260) by the user of the device.

| Parameters |
|---|---|
| `usePlatformDiagnostics: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | Whether the player reports diagnostics data to the Android platform. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder!` | This builder. |

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalStateException.html` | If `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder#build()` has already been called. |

### setVideoChangeFrameRateStrategy

```
@CanIgnoreReturnValue
@UnstableApi
fun setVideoChangeFrameRateStrategy(
    @C.VideoChangeFrameRateStrategy videoChangeFrameRateStrategy: Int
): ExoPlayer.Builder!
```

Sets a `https://developer.android.com/reference/kotlin/androidx/media3/common/C.VideoChangeFrameRateStrategy` that will be used by the player when provided with a video output `https://developer.android.com/reference/android/view/Surface.html`.

The strategy only applies if a `https://developer.android.com/reference/android/media/MediaCodec.html`-based video `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/Renderer` is enabled. Applications wishing to use `https://developer.android.com/reference/android/view/Surface.html#CHANGE_FRAME_RATE_ALWAYS` should set the mode to `https://developer.android.com/reference/kotlin/androidx/media3/common/C#VIDEO_CHANGE_FRAME_RATE_STRATEGY_OFF()` to disable calls to `https://developer.android.com/reference/android/view/Surface.html#setFrameRate(float, int)` from ExoPlayer, and should then call `https://developer.android.com/reference/android/view/Surface.html#setFrameRate(float, int)` directly from application code.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/kotlin/androidx/media3/common/C.VideoChangeFrameRateStrategy videoChangeFrameRateStrategy: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | A `https://developer.android.com/reference/kotlin/androidx/media3/common/C.VideoChangeFrameRateStrategy`. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder!` | This builder. |

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalStateException.html` | If `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder#build()` has already been called. |

### setVideoScalingMode

```
@CanIgnoreReturnValue
@UnstableApi
fun setVideoScalingMode(@C.VideoScalingMode videoScalingMode: Int): ExoPlayer.Builder!
```

Sets the `https://developer.android.com/reference/kotlin/androidx/media3/common/C.VideoScalingMode` that will be used by the player.

The scaling mode only applies if a `https://developer.android.com/reference/android/media/MediaCodec.html`-based video `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/Renderer` is enabled and if the output surface is owned by a `https://developer.android.com/reference/android/view/SurfaceView.html`.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/kotlin/androidx/media3/common/C.VideoScalingMode videoScalingMode: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | A `https://developer.android.com/reference/kotlin/androidx/media3/common/C.VideoScalingMode`. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder!` | This builder. |

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalStateException.html` | If `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder#build()` has already been called. |

### setWakeMode

```
@CanIgnoreReturnValue
fun setWakeMode(@C.WakeMode wakeMode: Int): ExoPlayer.Builder!
```

Sets the `https://developer.android.com/reference/kotlin/androidx/media3/common/C.WakeMode` that will be used by the player.

`https://developer.android.com/reference/kotlin/androidx/media3/common/C#WAKE_MODE_LOCAL()` should be used together with a foreground `https://developer.android.com/reference/android/app/Service.html` for use cases where playback occurs and the screen is off (e.g. background audio playback).

`https://developer.android.com/reference/kotlin/androidx/media3/common/C#WAKE_MODE_NETWORK()` is only required for uses cases requiring low-latency Wifi access during screen on playback, or to work around some Wifi stability issues on older devices while the screen is off.

When enabled, the locks (`https://developer.android.com/reference/android/os/PowerManager.WakeLock.html` / `https://developer.android.com/reference/android/net/wifi/WifiManager.WifiLock.html`) will be held whenever the player is in the `https://developer.android.com/reference/kotlin/androidx/media3/common/Player#STATE_READY()` or `https://developer.android.com/reference/kotlin/androidx/media3/common/Player#STATE_BUFFERING()` states with `playWhenReady = true`. The locks held depend on the specified `https://developer.android.com/reference/kotlin/androidx/media3/common/C.WakeMode`.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/kotlin/androidx/media3/common/C.WakeMode wakeMode: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | A `https://developer.android.com/reference/kotlin/androidx/media3/common/C.WakeMode`. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder!` | This builder. |

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalStateException.html` | If `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.Builder#build()` has already been called. |