# LoadControl

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

*** ** * ** ***

<br />

```
@UnstableApi
interface LoadControl
```

<br />

Known direct subclasses [DefaultLoadControl](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DefaultLoadControl)

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

*** ** * ** ***

Controls buffering of media.

## Summary

| ### Nested types |
|---|
| `class https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/LoadControl.Parameters` Information about the current playback context and the `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaPeriod` for which `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/LoadControl` methods are called. |

| ### Constants |
|---|---|
| `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 /> |

| ### Public functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/Allocator!` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/LoadControl#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` | `[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/-long/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/LoadControl#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` | `[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` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/LoadControl#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` | `[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` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/LoadControl#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` | `[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` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/LoadControl#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/LoadControl#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/-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` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/LoadControl#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/LoadControl#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` | `[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` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/LoadControl#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/LoadControl#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. |
| `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

### EMPTY_MEDIA_PERIOD_ID

```
const val EMPTY_MEDIA_PERIOD_ID: MediaSource.MediaPeriodId!
```

> [!CAUTION]
> **This property is deprecated.**   
>
> Used as a placeholder when MediaPeriodId is unknown. Only used when the deprecated methods `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[])` or `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/LoadControl#shouldStartPlayback(long,float,boolean,long)` are called.

## 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](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/LoadControl#getBackBufferDurationUs())(): Long
```

> [!CAUTION]
> **This function is deprecated.**   
>
> Implements `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/LoadControl#getBackBufferDurationUs(androidx.media3.exoplayer.analytics.PlayerId)` instead.

### 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](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/LoadControl#onPrepared())(): Unit
```

> [!CAUTION]
> **This function is deprecated.**   
>
> Use `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/LoadControl#onPrepared(androidx.media3.exoplayer.analytics.PlayerId)` instead.

### 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](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/LoadControl#onReleased())(): Unit
```

> [!CAUTION]
> **This function is deprecated.**   
>
> Implement `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/LoadControl#onReleased(androidx.media3.exoplayer.analytics.PlayerId)` instead.

### 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](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/LoadControl#onStopped())(): Unit
```

> [!CAUTION]
> **This function is deprecated.**   
>
> Implement `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/LoadControl#onStopped(androidx.media3.exoplayer.analytics.PlayerId)` instead.

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

### onTracksSelected

```
fun [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: Array<Renderer!>!,
    trackGroups: TrackGroupArray!,
    @NullableType trackSelections: Array<@NullableType ExoTrackSelection!>!
): Unit
```

> [!CAUTION]
> **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.

### onTracksSelected

```
fun [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: Timeline!,
    mediaPeriodId: MediaSource.MediaPeriodId!,
    renderers: Array<Renderer!>!,
    trackGroups: TrackGroupArray!,
    @NullableType trackSelections: Array<@NullableType ExoTrackSelection!>!
): Unit
```

> [!CAUTION]
> **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.

### onTracksSelected

```
fun [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: PlayerId!,
    timeline: Timeline!,
    mediaPeriodId: MediaSource.MediaPeriodId!,
    renderers: Array<Renderer!>!,
    trackGroups: TrackGroupArray!,
    @NullableType trackSelections: Array<@NullableType ExoTrackSelection!>!
): Unit
```

> [!CAUTION]
> **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.

### retainBackBufferFromKeyframe

```
fun [retainBackBufferFromKeyframe](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/LoadControl#retainBackBufferFromKeyframe())(): Boolean
```

> [!CAUTION]
> **This function is deprecated.**   
>
> Implements `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/LoadControl#retainBackBufferFromKeyframe(androidx.media3.exoplayer.analytics.PlayerId)` instead.

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

### shouldContinueLoading

```
fun [shouldContinueLoading](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/LoadControl#shouldContinueLoading(long,long,float))(
    playbackPositionUs: Long,
    bufferedDurationUs: Long,
    playbackSpeed: Float
): Boolean
```

> [!CAUTION]
> **This function is deprecated.**   
>
> Implement `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/LoadControl#shouldContinueLoading(androidx.media3.exoplayer.LoadControl.Parameters)` instead.

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

### shouldStartPlayback

```
fun [shouldStartPlayback](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/LoadControl#shouldStartPlayback(long,float,boolean,long))(
    bufferedDurationUs: Long,
    playbackSpeed: Float,
    rebuffering: Boolean,
    targetLiveOffsetUs: Long
): Boolean
```

> [!CAUTION]
> **This function is deprecated.**   
>
> Implement `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/LoadControl#shouldStartPlayback(androidx.media3.exoplayer.LoadControl.Parameters)` instead.

### shouldStartPlayback

```
fun [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: Timeline!,
    mediaPeriodId: MediaSource.MediaPeriodId!,
    bufferedDurationUs: Long,
    playbackSpeed: Float,
    rebuffering: Boolean,
    targetLiveOffsetUs: Long
): Boolean
```

> [!CAUTION]
> **This function is deprecated.**   
>
> Implement `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/LoadControl#shouldStartPlayback(androidx.media3.exoplayer.LoadControl.Parameters)` instead.