# DefaultLoadControl

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/DefaultLoadControl.java+class:androidx.media3.exoplayer.DefaultLoadControl)

*** ** * ** ***

<br />

```
@UnstableApi
class DefaultLoadControl : LoadControl
```

<br />

*** ** * ** ***

The default `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/LoadControl` implementation.

## Summary

| ### Nested types |
|---|
| `class https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DefaultLoadControl.Builder` Builder for `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DefaultLoadControl`. |

| ### Constants |
|---|---|
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DefaultLoadControl#DEFAULT_AUDIO_BUFFER_SIZE() = 13107200` A default size in bytes for an audio buffer. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DefaultLoadControl#DEFAULT_BACK_BUFFER_DURATION_MS() = 0` The default back buffer duration in milliseconds. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DefaultLoadControl#DEFAULT_BUFFER_FOR_PLAYBACK_AFTER_REBUFFER_FOR_LOCAL_PLAYBACK_MS() = 1000` The default duration of media that must be buffered for playback to resume after a rebuffer for local on-device playback, in milliseconds. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DefaultLoadControl#DEFAULT_BUFFER_FOR_PLAYBACK_AFTER_REBUFFER_MS() = 2000` The default duration of media that must be buffered for playback to resume after a rebuffer, in milliseconds. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DefaultLoadControl#DEFAULT_BUFFER_FOR_PLAYBACK_FOR_LOCAL_PLAYBACK_MS() = 1000` The default duration of media that must be buffered for playback to start or resume following a user action such as a seek for local on-device playback, in milliseconds. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DefaultLoadControl#DEFAULT_BUFFER_FOR_PLAYBACK_MS() = 1000` The default duration of media that must be buffered for playback to start or resume following a user action such as a seek, in milliseconds. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DefaultLoadControl#DEFAULT_CAMERA_MOTION_BUFFER_SIZE() = 131072` A default size in bytes for a camera motion buffer. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DefaultLoadControl#DEFAULT_IMAGE_BUFFER_SIZE() = 26214400` A default size in bytes for an image buffer. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DefaultLoadControl#DEFAULT_MAX_BUFFER_FOR_LOCAL_PLAYBACK_MS() = 50000` The default maximum duration of media that the player will attempt to buffer for local on-device playback, in milliseconds. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DefaultLoadControl#DEFAULT_MAX_BUFFER_MS() = 50000` The default maximum duration of media that the player will attempt to buffer, in milliseconds. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DefaultLoadControl#DEFAULT_MAX_BUFFER_SIZE() = 210239488` The buffer size in bytes that will be used as a maximum target buffer in all cases unless an `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DefaultLoadControl.Builder#setTargetBufferBytes(int)` or `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DefaultLoadControl#calculateTargetBufferBytes(androidx.media3.exoplayer.trackselection.ExoTrackSelection[])` is overridden with custom behavior. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DefaultLoadControl#DEFAULT_METADATA_BUFFER_SIZE() = 131072` A default size in bytes for a metadata buffer. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DefaultLoadControl#DEFAULT_MIN_BUFFER_FOR_LOCAL_PLAYBACK_MS() = 1000` The default minimum duration of media that the player will attempt to ensure is buffered at all times for local on-device playback, in milliseconds. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DefaultLoadControl#DEFAULT_MIN_BUFFER_MS() = 50000` The default minimum duration of media that the player will attempt to ensure is buffered at all times, in milliseconds. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DefaultLoadControl#DEFAULT_MIN_BUFFER_SIZE() = 13107200` The buffer size in bytes that will be used as a minimum target buffer in all cases unless an `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DefaultLoadControl.Builder#setTargetBufferBytes(int)` or `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DefaultLoadControl#calculateTargetBufferBytes(androidx.media3.exoplayer.trackselection.ExoTrackSelection[])` is overridden with custom behavior. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DefaultLoadControl#DEFAULT_MUXED_BUFFER_SIZE() = 144310272` A default size in bytes for a muxed buffer (e.g. containing video, audio and text). |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DefaultLoadControl#DEFAULT_PRIORITIZE_TIME_OVER_SIZE_THRESHOLDS() = false` The default prioritization of buffer time constraints over size constraints. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DefaultLoadControl#DEFAULT_PRIORITIZE_TIME_OVER_SIZE_THRESHOLDS_FOR_LOCAL_PLAYBACK() = true` The default prioritization of buffer time constraints over size constraints for local on-device playback. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DefaultLoadControl#DEFAULT_RETAIN_BACK_BUFFER_FROM_KEYFRAME() = false` The default for whether the back buffer is retained from the previous keyframe. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DefaultLoadControl#DEFAULT_TARGET_BUFFER_BYTES() = -1` The default target buffer size in bytes. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DefaultLoadControl#DEFAULT_TARGET_BUFFER_BYTES_FOR_PRELOAD() = 144179200` The default target buffer size in bytes that will be used for preloading media outside of player, see `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlayerId#PRELOAD()`. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DefaultLoadControl#DEFAULT_TEXT_BUFFER_SIZE() = 131072` A default size in bytes for a text buffer. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DefaultLoadControl#DEFAULT_VIDEO_BUFFER_SIZE() = 131072000` A default size in bytes for a video buffer. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DefaultLoadControl#DEFAULT_VIDEO_BUFFER_SIZE_FOR_LOCAL_PLAYBACK() = 19660800` A default size in bytes for a video buffer for local playback. |
| `const https://guava.dev/releases/snapshot-android/api/docs/com/google/common/collect/ImmutableList.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!>!` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DefaultLoadControl#LOCAL_PLAYBACK_SCHEMES()` List of URL schemes that are considered local on-device playback. |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DefaultLoadControl#DefaultLoadControl()()` Constructs a new instance, using the `DEFAULT_*` constants defined in this class. |

| ### Protected constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DefaultLoadControl#DefaultLoadControl(androidx.media3.exoplayer.upstream.DefaultAllocator,int,int,int,int,int,int,int,int,int,boolean,boolean,int,boolean)( allocator: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/DefaultAllocator!, minBufferMs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, minBufferForLocalPlaybackMs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, maxBufferMs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, maxBufferForLocalPlaybackMs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, bufferForPlaybackMs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, bufferForPlaybackForLocalPlaybackMs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, bufferForPlaybackAfterRebufferMs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, bufferForPlaybackAfterRebufferForLocalPlaybackMs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, targetBufferBytes: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, prioritizeTimeOverSizeThresholds: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html, prioritizeTimeOverSizeThresholdsForLocalPlayback: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html, backBufferDurationMs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, retainBackBufferFromKeyframe: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html )` |
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DefaultLoadControl#DefaultLoadControl(androidx.media3.exoplayer.upstream.DefaultAllocator,int,int,int,int,int,int,int,int,int,boolean,boolean,int,boolean,java.util.Map<java.lang.String,java.lang.Integer>)( allocator: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/DefaultAllocator!, minBufferMs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, minBufferForLocalPlaybackMs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, maxBufferMs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, maxBufferForLocalPlaybackMs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, bufferForPlaybackMs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, bufferForPlaybackForLocalPlaybackMs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, bufferForPlaybackAfterRebufferMs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, bufferForPlaybackAfterRebufferForLocalPlaybackMs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, targetBufferBytes: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, prioritizeTimeOverSizeThresholds: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html, prioritizeTimeOverSizeThresholdsForLocalPlayback: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html, backBufferDurationMs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, retainBackBufferFromKeyframe: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html, playerTargetBufferBytes: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-map/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html!>! )` |

| ### Public functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/Allocator!` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DefaultLoadControl#getAllocator(androidx.media3.exoplayer.analytics.PlayerId)(playerId: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlayerId!)` Returns the `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/Allocator` that should be used to obtain media buffer allocations for the specified `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlayerId`. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DefaultLoadControl#getBackBufferDurationUs(androidx.media3.exoplayer.analytics.PlayerId)(playerId: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlayerId!)` Returns the duration of media to retain in the buffer prior to the current playback position, for fast backward seeking. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DefaultLoadControl#onPrepared(androidx.media3.exoplayer.analytics.PlayerId)(playerId: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlayerId!)` Called by the player when prepared with a new source. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DefaultLoadControl#onReleased(androidx.media3.exoplayer.analytics.PlayerId)(playerId: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlayerId!)` Called by the player when released. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DefaultLoadControl#onStopped(androidx.media3.exoplayer.analytics.PlayerId)(playerId: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlayerId!)` Called by the player when stopped. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DefaultLoadControl#onTracksSelected(androidx.media3.exoplayer.LoadControl.Parameters,androidx.media3.exoplayer.source.TrackGroupArray,androidx.media3.exoplayer.trackselection.ExoTrackSelection[])( parameters: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/LoadControl.Parameters!, trackGroups: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/TrackGroupArray!, @https://developer.android.com/reference/kotlin/androidx/media3/common/util/NullableType trackSelections: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<@https://developer.android.com/reference/kotlin/androidx/media3/common/util/NullableType https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/trackselection/ExoTrackSelection!>! )` Called by the player when a track selection occurs. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DefaultLoadControl#retainBackBufferFromKeyframe(androidx.media3.exoplayer.analytics.PlayerId)(playerId: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlayerId!)` Returns whether media should be retained from the keyframe before the current playback position minus `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/LoadControl#getBackBufferDurationUs()`, rather than any sample before or at that position. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DefaultLoadControl#shouldContinueLoading(androidx.media3.exoplayer.LoadControl.Parameters)(parameters: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/LoadControl.Parameters!)` Called by the player to determine whether it should continue to load the source. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DefaultLoadControl#shouldContinuePreloading(androidx.media3.exoplayer.analytics.PlayerId,androidx.media3.common.Timeline,androidx.media3.exoplayer.source.MediaSource.MediaPeriodId,long)( playerId: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlayerId!, timeline: https://developer.android.com/reference/kotlin/androidx/media3/common/Timeline!, mediaPeriodId: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId!, bufferedDurationUs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html )` Called to determine whether preloading should be continued. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DefaultLoadControl#shouldStartPlayback(androidx.media3.exoplayer.LoadControl.Parameters)(parameters: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/LoadControl.Parameters!)` Called repeatedly by the player when it's loading the source, has yet to start playback, and has the minimum amount of data necessary for playback to be started. |

| ### Protected functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `[calculateTargetBufferBytes](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DefaultLoadControl#calculateTargetBufferBytes(androidx.media3.exoplayer.trackselection.ExoTrackSelection[]))( @https://developer.android.com/reference/kotlin/androidx/media3/common/util/NullableType trackSelectionArray: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<@https://developer.android.com/reference/kotlin/androidx/media3/common/util/NullableType https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/trackselection/ExoTrackSelection!>! )` **This function is deprecated.** Overwrite `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DefaultLoadControl#calculateTargetBufferBytes(androidx.media3.exoplayer.LoadControl.Parameters,androidx.media3.exoplayer.trackselection.ExoTrackSelection[])` instead. <br /> |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DefaultLoadControl#calculateTargetBufferBytes(androidx.media3.exoplayer.LoadControl.Parameters,androidx.media3.exoplayer.trackselection.ExoTrackSelection[])( parameters: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/LoadControl.Parameters!, @https://developer.android.com/reference/kotlin/androidx/media3/common/util/NullableType trackSelectionArray: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<@https://developer.android.com/reference/kotlin/androidx/media3/common/util/NullableType https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/trackselection/ExoTrackSelection!>! )` Calculate target buffer size in bytes based on the selected tracks. |

### Inherited Constants

From [androidx.media3.exoplayer.LoadControl](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/LoadControl) `const https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId!` `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/LoadControl#EMPTY_MEDIA_PERIOD_ID()`

**This property is deprecated.**

Used as a placeholder when MediaPeriodId is unknown.

<br />

### Inherited functions

From [androidx.media3.exoplayer.LoadControl](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/LoadControl) `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` `[getBackBufferDurationUs](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/LoadControl#getBackBufferDurationUs())()`

**This function is deprecated.**

Implements `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/LoadControl#getBackBufferDurationUs(androidx.media3.exoplayer.analytics.PlayerId)` instead.

<br />

`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `[onPrepared](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/LoadControl#onPrepared())()`

**This function is deprecated.**

Use `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/LoadControl#onPrepared(androidx.media3.exoplayer.analytics.PlayerId)` instead.

<br />

`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `[onReleased](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/LoadControl#onReleased())()`

**This function is deprecated.**

Implement `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/LoadControl#onReleased(androidx.media3.exoplayer.analytics.PlayerId)` instead.

<br />

`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `[onStopped](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/LoadControl#onStopped())()`

**This function is deprecated.**

Implement `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/LoadControl#onStopped(androidx.media3.exoplayer.analytics.PlayerId)` instead.

<br />

`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `[onTracksSelected](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/LoadControl#onTracksSelected(androidx.media3.exoplayer.Renderer[],androidx.media3.exoplayer.source.TrackGroupArray,androidx.media3.exoplayer.trackselection.ExoTrackSelection[]))(

renderers: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/Renderer!>!,

trackGroups: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/TrackGroupArray!,

@https://developer.android.com/reference/kotlin/androidx/media3/common/util/NullableType trackSelections: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<@https://developer.android.com/reference/kotlin/androidx/media3/common/util/NullableType https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/trackselection/ExoTrackSelection!>!

)`

**This function is deprecated.**

Implement `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/LoadControl#onTracksSelected(androidx.media3.exoplayer.LoadControl.Parameters,androidx.media3.exoplayer.source.TrackGroupArray,androidx.media3.exoplayer.trackselection.ExoTrackSelection[])` instead.

<br />

`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `[onTracksSelected](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/LoadControl#onTracksSelected(androidx.media3.common.Timeline,androidx.media3.exoplayer.source.MediaSource.MediaPeriodId,androidx.media3.exoplayer.Renderer[],androidx.media3.exoplayer.source.TrackGroupArray,androidx.media3.exoplayer.trackselection.ExoTrackSelection[]))(

timeline: https://developer.android.com/reference/kotlin/androidx/media3/common/Timeline!,

mediaPeriodId: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId!,

renderers: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/Renderer!>!,

trackGroups: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/TrackGroupArray!,

@https://developer.android.com/reference/kotlin/androidx/media3/common/util/NullableType trackSelections: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<@https://developer.android.com/reference/kotlin/androidx/media3/common/util/NullableType https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/trackselection/ExoTrackSelection!>!

)`

**This function is deprecated.**

Implement `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/LoadControl#onTracksSelected(androidx.media3.exoplayer.LoadControl.Parameters,androidx.media3.exoplayer.source.TrackGroupArray,androidx.media3.exoplayer.trackselection.ExoTrackSelection[])` instead.

<br />

`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `[onTracksSelected](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/LoadControl#onTracksSelected(androidx.media3.exoplayer.analytics.PlayerId,androidx.media3.common.Timeline,androidx.media3.exoplayer.source.MediaSource.MediaPeriodId,androidx.media3.exoplayer.Renderer[],androidx.media3.exoplayer.source.TrackGroupArray,androidx.media3.exoplayer.trackselection.ExoTrackSelection[]))(

playerId: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlayerId!,

timeline: https://developer.android.com/reference/kotlin/androidx/media3/common/Timeline!,

mediaPeriodId: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId!,

renderers: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/Renderer!>!,

trackGroups: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/TrackGroupArray!,

@https://developer.android.com/reference/kotlin/androidx/media3/common/util/NullableType trackSelections: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<@https://developer.android.com/reference/kotlin/androidx/media3/common/util/NullableType https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/trackselection/ExoTrackSelection!>!

)`

**This function is deprecated.**

Implement `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/LoadControl#onTracksSelected(androidx.media3.exoplayer.LoadControl.Parameters,androidx.media3.exoplayer.source.TrackGroupArray,androidx.media3.exoplayer.trackselection.ExoTrackSelection[])` instead.

<br />

`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `[retainBackBufferFromKeyframe](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/LoadControl#retainBackBufferFromKeyframe())()`

**This function is deprecated.**

Implements `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/LoadControl#retainBackBufferFromKeyframe(androidx.media3.exoplayer.analytics.PlayerId)` instead.

<br />

`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `[shouldContinueLoading](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/LoadControl#shouldContinueLoading(long,long,float))(

playbackPositionUs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html,

bufferedDurationUs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html,

playbackSpeed: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html

)`

**This function is deprecated.**

Implement `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/LoadControl#shouldContinueLoading(androidx.media3.exoplayer.LoadControl.Parameters)` instead.

<br />

`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `[shouldStartPlayback](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/LoadControl#shouldStartPlayback(long,float,boolean,long))(

bufferedDurationUs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html,

playbackSpeed: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html,

rebuffering: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html,

targetLiveOffsetUs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html

)`

**This function is deprecated.**

Implement `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/LoadControl#shouldStartPlayback(androidx.media3.exoplayer.LoadControl.Parameters)` instead.

<br />

`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `[shouldStartPlayback](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/LoadControl#shouldStartPlayback(androidx.media3.common.Timeline,androidx.media3.exoplayer.source.MediaSource.MediaPeriodId,long,float,boolean,long))(

timeline: https://developer.android.com/reference/kotlin/androidx/media3/common/Timeline!,

mediaPeriodId: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId!,

bufferedDurationUs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html,

playbackSpeed: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html,

rebuffering: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html,

targetLiveOffsetUs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html

)`

**This function is deprecated.**

Implement `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/LoadControl#shouldStartPlayback(androidx.media3.exoplayer.LoadControl.Parameters)` instead.

<br />

## Constants

### DEFAULT_AUDIO_BUFFER_SIZE

```
const val DEFAULT_AUDIO_BUFFER_SIZE = 13107200: Int
```

A default size in bytes for an audio buffer.

### DEFAULT_BACK_BUFFER_DURATION_MS

```
const val DEFAULT_BACK_BUFFER_DURATION_MS = 0: Int
```

The default back buffer duration in milliseconds.

### DEFAULT_BUFFER_FOR_PLAYBACK_AFTER_REBUFFER_FOR_LOCAL_PLAYBACK_MS

```
const val DEFAULT_BUFFER_FOR_PLAYBACK_AFTER_REBUFFER_FOR_LOCAL_PLAYBACK_MS = 1000: Int
```

The default duration of media that must be buffered for playback to resume after a rebuffer for local on-device playback, in milliseconds. A rebuffer is defined to be caused by buffer depletion rather than a user action.

### DEFAULT_BUFFER_FOR_PLAYBACK_AFTER_REBUFFER_MS

```
const val DEFAULT_BUFFER_FOR_PLAYBACK_AFTER_REBUFFER_MS = 2000: Int
```

The default duration of media that must be buffered for playback to resume after a rebuffer, in milliseconds. A rebuffer is defined to be caused by buffer depletion rather than a user action.

### DEFAULT_BUFFER_FOR_PLAYBACK_FOR_LOCAL_PLAYBACK_MS

```
const val DEFAULT_BUFFER_FOR_PLAYBACK_FOR_LOCAL_PLAYBACK_MS = 1000: Int
```

The default duration of media that must be buffered for playback to start or resume following a user action such as a seek for local on-device playback, in milliseconds.

### DEFAULT_BUFFER_FOR_PLAYBACK_MS

```
const val DEFAULT_BUFFER_FOR_PLAYBACK_MS = 1000: Int
```

The default duration of media that must be buffered for playback to start or resume following a user action such as a seek, in milliseconds.

### DEFAULT_CAMERA_MOTION_BUFFER_SIZE

```
const val DEFAULT_CAMERA_MOTION_BUFFER_SIZE = 131072: Int
```

A default size in bytes for a camera motion buffer.

### DEFAULT_IMAGE_BUFFER_SIZE

```
const val DEFAULT_IMAGE_BUFFER_SIZE = 26214400: Int
```

A default size in bytes for an image buffer.

### DEFAULT_MAX_BUFFER_FOR_LOCAL_PLAYBACK_MS

```
const val DEFAULT_MAX_BUFFER_FOR_LOCAL_PLAYBACK_MS = 50000: Int
```

The default maximum duration of media that the player will attempt to buffer for local on-device playback, in milliseconds.

### DEFAULT_MAX_BUFFER_MS

```
const val DEFAULT_MAX_BUFFER_MS = 50000: Int
```

The default maximum duration of media that the player will attempt to buffer, in milliseconds.

### DEFAULT_MAX_BUFFER_SIZE

```
const val DEFAULT_MAX_BUFFER_SIZE = 210239488: Int
```

The buffer size in bytes that will be used as a maximum target buffer in all cases unless an `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DefaultLoadControl.Builder#setTargetBufferBytes(int)` or `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DefaultLoadControl#calculateTargetBufferBytes(androidx.media3.exoplayer.trackselection.ExoTrackSelection[])` is overridden with custom behavior.

### DEFAULT_METADATA_BUFFER_SIZE

```
const val DEFAULT_METADATA_BUFFER_SIZE = 131072: Int
```

A default size in bytes for a metadata buffer.

### DEFAULT_MIN_BUFFER_FOR_LOCAL_PLAYBACK_MS

```
const val DEFAULT_MIN_BUFFER_FOR_LOCAL_PLAYBACK_MS = 1000: Int
```

The default minimum duration of media that the player will attempt to ensure is buffered at all times for local on-device playback, in milliseconds.

### DEFAULT_MIN_BUFFER_MS

```
const val DEFAULT_MIN_BUFFER_MS = 50000: Int
```

The default minimum duration of media that the player will attempt to ensure is buffered at all times, in milliseconds.

### DEFAULT_MIN_BUFFER_SIZE

```
const val DEFAULT_MIN_BUFFER_SIZE = 13107200: Int
```

The buffer size in bytes that will be used as a minimum target buffer in all cases unless an `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DefaultLoadControl.Builder#setTargetBufferBytes(int)` or `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DefaultLoadControl#calculateTargetBufferBytes(androidx.media3.exoplayer.trackselection.ExoTrackSelection[])` is overridden with custom behavior.

This is also the default target buffer before tracks are selected.

### DEFAULT_MUXED_BUFFER_SIZE

```
const val DEFAULT_MUXED_BUFFER_SIZE = 144310272: Int
```

A default size in bytes for a muxed buffer (e.g. containing video, audio and text).

### DEFAULT_PRIORITIZE_TIME_OVER_SIZE_THRESHOLDS

```
const val DEFAULT_PRIORITIZE_TIME_OVER_SIZE_THRESHOLDS = false: Boolean
```

The default prioritization of buffer time constraints over size constraints.

### DEFAULT_PRIORITIZE_TIME_OVER_SIZE_THRESHOLDS_FOR_LOCAL_PLAYBACK

```
const val DEFAULT_PRIORITIZE_TIME_OVER_SIZE_THRESHOLDS_FOR_LOCAL_PLAYBACK = true: Boolean
```

The default prioritization of buffer time constraints over size constraints for local on-device playback.

### DEFAULT_RETAIN_BACK_BUFFER_FROM_KEYFRAME

```
const val DEFAULT_RETAIN_BACK_BUFFER_FROM_KEYFRAME = false: Boolean
```

The default for whether the back buffer is retained from the previous keyframe.

### DEFAULT_TARGET_BUFFER_BYTES

```
const val DEFAULT_TARGET_BUFFER_BYTES = -1: Int
```

The default target buffer size in bytes. The value (`https://developer.android.com/reference/kotlin/androidx/media3/common/C#LENGTH_UNSET()`) means that the load control will calculate the target buffer size based on the selected tracks.

### DEFAULT_TARGET_BUFFER_BYTES_FOR_PRELOAD

```
const val DEFAULT_TARGET_BUFFER_BYTES_FOR_PRELOAD = 144179200: Int
```

The default target buffer size in bytes that will be used for preloading media outside of player, see `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlayerId#PRELOAD()`.

### DEFAULT_TEXT_BUFFER_SIZE

```
const val DEFAULT_TEXT_BUFFER_SIZE = 131072: Int
```

A default size in bytes for a text buffer.

### DEFAULT_VIDEO_BUFFER_SIZE

```
const val DEFAULT_VIDEO_BUFFER_SIZE = 131072000: Int
```

A default size in bytes for a video buffer.

### DEFAULT_VIDEO_BUFFER_SIZE_FOR_LOCAL_PLAYBACK

```
const val DEFAULT_VIDEO_BUFFER_SIZE_FOR_LOCAL_PLAYBACK = 19660800: Int
```

A default size in bytes for a video buffer for local playback.

### LOCAL_PLAYBACK_SCHEMES

```
const val LOCAL_PLAYBACK_SCHEMES: ImmutableList<String!>!
```

List of URL schemes that are considered local on-device playback.

## Public constructors

### DefaultLoadControl

```
DefaultLoadControl()
```

Constructs a new instance, using the `DEFAULT_*` constants defined in this class.

## Protected constructors

### DefaultLoadControl

```
protected DefaultLoadControl(
    allocator: DefaultAllocator!,
    minBufferMs: Int,
    minBufferForLocalPlaybackMs: Int,
    maxBufferMs: Int,
    maxBufferForLocalPlaybackMs: Int,
    bufferForPlaybackMs: Int,
    bufferForPlaybackForLocalPlaybackMs: Int,
    bufferForPlaybackAfterRebufferMs: Int,
    bufferForPlaybackAfterRebufferForLocalPlaybackMs: Int,
    targetBufferBytes: Int,
    prioritizeTimeOverSizeThresholds: Boolean,
    prioritizeTimeOverSizeThresholdsForLocalPlayback: Boolean,
    backBufferDurationMs: Int,
    retainBackBufferFromKeyframe: Boolean
)
```

### DefaultLoadControl

```
protected DefaultLoadControl(
    allocator: DefaultAllocator!,
    minBufferMs: Int,
    minBufferForLocalPlaybackMs: Int,
    maxBufferMs: Int,
    maxBufferForLocalPlaybackMs: Int,
    bufferForPlaybackMs: Int,
    bufferForPlaybackForLocalPlaybackMs: Int,
    bufferForPlaybackAfterRebufferMs: Int,
    bufferForPlaybackAfterRebufferForLocalPlaybackMs: Int,
    targetBufferBytes: Int,
    prioritizeTimeOverSizeThresholds: Boolean,
    prioritizeTimeOverSizeThresholdsForLocalPlayback: Boolean,
    backBufferDurationMs: Int,
    retainBackBufferFromKeyframe: Boolean,
    playerTargetBufferBytes: (Mutable)Map<String!, Int!>!
)
```

## Public functions

### getAllocator

```
fun getAllocator(playerId: PlayerId!): Allocator!
```

Returns the `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/Allocator` that should be used to obtain media buffer allocations for the specified `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlayerId`.

### getBackBufferDurationUs

```
fun getBackBufferDurationUs(playerId: PlayerId!): Long
```

Returns the duration of media to retain in the buffer prior to the current playback position, for fast backward seeking.

Note: If `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/LoadControl#retainBackBufferFromKeyframe()` is false then seeking in the back-buffer will only be fast if the back-buffer contains a keyframe prior to the seek position.

Note: Implementations should return a single value. Dynamic changes to the back-buffer are not currently supported.

| Parameters |
|---|---|
| `playerId: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlayerId!` | The `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlayerId` that requests the back buffer duration. |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | The duration of media to retain in the buffer prior to the current playback position, in microseconds. |

### onPrepared

```
fun onPrepared(playerId: PlayerId!): Unit
```

Called by the player when prepared with a new source.

| Parameters |
|---|---|
| `playerId: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlayerId!` | The `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlayerId` that prepared a new source. |

### onReleased

```
fun onReleased(playerId: PlayerId!): Unit
```

Called by the player when released.

| Parameters |
|---|---|
| `playerId: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlayerId!` | The `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlayerId` that was released. |

### onStopped

```
fun onStopped(playerId: PlayerId!): Unit
```

Called by the player when stopped.

| Parameters |
|---|---|
| `playerId: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlayerId!` | The `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlayerId` that was stopped. |

### onTracksSelected

```
fun onTracksSelected(
    parameters: LoadControl.Parameters!,
    trackGroups: TrackGroupArray!,
    @NullableType trackSelections: Array<@NullableType ExoTrackSelection!>!
): Unit
```

Called by the player when a track selection occurs.

| Parameters |
|---|---|
| `parameters: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/LoadControl.Parameters!` | containing the `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlayerId`, the current `https://developer.android.com/reference/kotlin/androidx/media3/common/Timeline` in ExoPlayer, and the `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaPeriod` for which the selection was made. Will be `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/LoadControl#EMPTY_MEDIA_PERIOD_ID()` when `timeline` is empty. |
| `trackGroups: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/TrackGroupArray!` | The `https://developer.android.com/reference/kotlin/androidx/media3/common/TrackGroup`s from which the selection was made. |
| `@https://developer.android.com/reference/kotlin/androidx/media3/common/util/NullableType trackSelections: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<@https://developer.android.com/reference/kotlin/androidx/media3/common/util/NullableType https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/trackselection/ExoTrackSelection!>!` | The track selections that were made. |

### retainBackBufferFromKeyframe

```
fun retainBackBufferFromKeyframe(playerId: PlayerId!): Boolean
```

Returns whether media should be retained from the keyframe before the current playback position minus `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/LoadControl#getBackBufferDurationUs()`, rather than any sample before or at that position.

Warning: Returning true will cause the back-buffer size to depend on the spacing of keyframes in the media being played. Returning true is not recommended unless you control the media and are comfortable with the back-buffer size exceeding `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/LoadControl#getBackBufferDurationUs()` by as much as the maximum duration between adjacent keyframes in the media.

Note: Implementations should return a single value. Dynamic changes to the back-buffer are not currently supported.

| Parameters |
|---|---|
| `playerId: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlayerId!` | The `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlayerId` that requests whether to retain the back buffer from key frame. |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | Whether media should be retained from the keyframe before the current playback position minus `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/LoadControl#getBackBufferDurationUs()`, rather than any sample before or at that position. |

### shouldContinueLoading

```
fun shouldContinueLoading(parameters: LoadControl.Parameters!): Boolean
```

Called by the player to determine whether it should continue to load the source. If this method returns true, the `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaPeriod` identified in the most recent `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/LoadControl#onTracksSelected(androidx.media3.exoplayer.LoadControl.Parameters,androidx.media3.exoplayer.source.TrackGroupArray,androidx.media3.exoplayer.trackselection.ExoTrackSelection[])` call will continue being loaded.

| Parameters |
|---|---|
| `parameters: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/LoadControl.Parameters!` | Information about the playback context and the `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaPeriod` that will continue to load if this method returns `true`. |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | Whether the loading should continue. |

### shouldContinuePreloading

```
fun shouldContinuePreloading(
    playerId: PlayerId!,
    timeline: Timeline!,
    mediaPeriodId: MediaSource.MediaPeriodId!,
    bufferedDurationUs: Long
): Boolean
```

Called to determine whether preloading should be continued. If this method returns true, the presented period will continue to load media.

| Parameters |
|---|---|
| `playerId: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlayerId!` | The `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlayerId` that wants to continue preloading. |
| `timeline: https://developer.android.com/reference/kotlin/androidx/media3/common/Timeline!` | The Timeline containing the preload period that can be looked up with MediaPeriodId.periodUid. |
| `mediaPeriodId: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId!` | The MediaPeriodId of the preloading period. |
| `bufferedDurationUs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | The duration of media currently buffered by the preload period. |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | Whether the preloading should continue for the given period. |

### shouldStartPlayback

```
fun shouldStartPlayback(parameters: LoadControl.Parameters!): Boolean
```

Called repeatedly by the player when it's loading the source, has yet to start playback, and has the minimum amount of data necessary for playback to be started. The value returned determines whether playback is actually started. The load control may opt to return ` false` until some condition has been met (e.g. a certain amount of media is buffered).

| Parameters |
|---|---|
| `parameters: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/LoadControl.Parameters!` | Information about the playback context and the `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaPeriod` that will start playing if this method returns `true`. |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | Whether playback should be allowed to start or resume. |

## Protected functions

### calculateTargetBufferBytes

```
protected fun [calculateTargetBufferBytes](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DefaultLoadControl#calculateTargetBufferBytes(androidx.media3.exoplayer.trackselection.ExoTrackSelection[]))(
    @NullableType trackSelectionArray: Array<@NullableType ExoTrackSelection!>!
): Int
```

> [!CAUTION]
> **This function is deprecated.**   
>
> Overwrite `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DefaultLoadControl#calculateTargetBufferBytes(androidx.media3.exoplayer.LoadControl.Parameters,androidx.media3.exoplayer.trackselection.ExoTrackSelection[])` instead.

### calculateTargetBufferBytes

```
protected fun calculateTargetBufferBytes(
    parameters: LoadControl.Parameters!,
    @NullableType trackSelectionArray: Array<@NullableType ExoTrackSelection!>!
): Int
```

Calculate target buffer size in bytes based on the selected tracks. The player will try not to exceed this target buffer. Only used when `targetBufferBytes` is `https://developer.android.com/reference/kotlin/androidx/media3/common/C#LENGTH_UNSET()`.

| Parameters |
|---|---|
| `parameters: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/LoadControl.Parameters!` | The `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/LoadControl.Parameters` for the current playback context for which tracks are selected. |
| `@https://developer.android.com/reference/kotlin/androidx/media3/common/util/NullableType trackSelectionArray: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<@https://developer.android.com/reference/kotlin/androidx/media3/common/util/NullableType https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/trackselection/ExoTrackSelection!>!` | The selected tracks. |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The target buffer size in bytes. |