# 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
public interface LoadControl
```

<br />

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

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

*** ** * ** ***

Controls buffering of media.

## Summary

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

| ### Constants |
|---|---|
| `default static final https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId` | `https://developer.android.com/reference/androidx/media3/exoplayer/LoadControl#EMPTY_MEDIA_PERIOD_ID()` **This field is deprecated.** Used as a placeholder when MediaPeriodId is unknown. <br /> |

| ### Public methods |
|---|---|
| `abstract https://developer.android.com/reference/androidx/media3/exoplayer/upstream/Allocator` | `https://developer.android.com/reference/androidx/media3/exoplayer/LoadControl#getAllocator(androidx.media3.exoplayer.analytics.PlayerId)(https://developer.android.com/reference/androidx/media3/exoplayer/analytics/PlayerId playerId)` Returns the `https://developer.android.com/reference/androidx/media3/exoplayer/upstream/Allocator` that should be used to obtain media buffer allocations for the specified `https://developer.android.com/reference/androidx/media3/exoplayer/analytics/PlayerId`. |
| `default long` | `[getBackBufferDurationUs](https://developer.android.com/reference/androidx/media3/exoplayer/LoadControl#getBackBufferDurationUs())()` **This method is deprecated.** Implements `https://developer.android.com/reference/androidx/media3/exoplayer/LoadControl#getBackBufferDurationUs(androidx.media3.exoplayer.analytics.PlayerId)` instead. <br /> |
| `default long` | `https://developer.android.com/reference/androidx/media3/exoplayer/LoadControl#getBackBufferDurationUs(androidx.media3.exoplayer.analytics.PlayerId)(https://developer.android.com/reference/androidx/media3/exoplayer/analytics/PlayerId playerId)` Returns the duration of media to retain in the buffer prior to the current playback position, for fast backward seeking. |
| `default void` | `[onPrepared](https://developer.android.com/reference/androidx/media3/exoplayer/LoadControl#onPrepared())()` **This method is deprecated.** Use `https://developer.android.com/reference/androidx/media3/exoplayer/LoadControl#onPrepared(androidx.media3.exoplayer.analytics.PlayerId)` instead. <br /> |
| `default void` | `https://developer.android.com/reference/androidx/media3/exoplayer/LoadControl#onPrepared(androidx.media3.exoplayer.analytics.PlayerId)(https://developer.android.com/reference/androidx/media3/exoplayer/analytics/PlayerId playerId)` Called by the player when prepared with a new source. |
| `default void` | `[onReleased](https://developer.android.com/reference/androidx/media3/exoplayer/LoadControl#onReleased())()` **This method is deprecated.** Implement `https://developer.android.com/reference/androidx/media3/exoplayer/LoadControl#onReleased(androidx.media3.exoplayer.analytics.PlayerId)` instead. <br /> |
| `default void` | `https://developer.android.com/reference/androidx/media3/exoplayer/LoadControl#onReleased(androidx.media3.exoplayer.analytics.PlayerId)(https://developer.android.com/reference/androidx/media3/exoplayer/analytics/PlayerId playerId)` Called by the player when released. |
| `default void` | `[onStopped](https://developer.android.com/reference/androidx/media3/exoplayer/LoadControl#onStopped())()` **This method is deprecated.** Implement `https://developer.android.com/reference/androidx/media3/exoplayer/LoadControl#onStopped(androidx.media3.exoplayer.analytics.PlayerId)` instead. <br /> |
| `default void` | `https://developer.android.com/reference/androidx/media3/exoplayer/LoadControl#onStopped(androidx.media3.exoplayer.analytics.PlayerId)(https://developer.android.com/reference/androidx/media3/exoplayer/analytics/PlayerId playerId)` Called by the player when stopped. |
| `default void` | `https://developer.android.com/reference/androidx/media3/exoplayer/LoadControl#onTracksSelected(androidx.media3.exoplayer.LoadControl.Parameters,androidx.media3.exoplayer.source.TrackGroupArray,androidx.media3.exoplayer.trackselection.ExoTrackSelection[])( https://developer.android.com/reference/androidx/media3/exoplayer/LoadControl.Parameters parameters, https://developer.android.com/reference/androidx/media3/exoplayer/source/TrackGroupArray trackGroups, @https://developer.android.com/reference/androidx/media3/common/util/NullableType ExoTrackSelection[] trackSelections )` Called by the player when a track selection occurs. |
| `default void` | `[onTracksSelected](https://developer.android.com/reference/androidx/media3/exoplayer/LoadControl#onTracksSelected(androidx.media3.exoplayer.Renderer[],androidx.media3.exoplayer.source.TrackGroupArray,androidx.media3.exoplayer.trackselection.ExoTrackSelection[]))( Renderer[] renderers, https://developer.android.com/reference/androidx/media3/exoplayer/source/TrackGroupArray trackGroups, @https://developer.android.com/reference/androidx/media3/common/util/NullableType ExoTrackSelection[] trackSelections )` **This method is deprecated.** Implement `https://developer.android.com/reference/androidx/media3/exoplayer/LoadControl#onTracksSelected(androidx.media3.exoplayer.LoadControl.Parameters,androidx.media3.exoplayer.source.TrackGroupArray,androidx.media3.exoplayer.trackselection.ExoTrackSelection[])` instead. <br /> |
| `default void` | `[onTracksSelected](https://developer.android.com/reference/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[]))( https://developer.android.com/reference/androidx/media3/common/Timeline timeline, https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId mediaPeriodId, Renderer[] renderers, https://developer.android.com/reference/androidx/media3/exoplayer/source/TrackGroupArray trackGroups, @https://developer.android.com/reference/androidx/media3/common/util/NullableType ExoTrackSelection[] trackSelections )` **This method is deprecated.** Implement `https://developer.android.com/reference/androidx/media3/exoplayer/LoadControl#onTracksSelected(androidx.media3.exoplayer.LoadControl.Parameters,androidx.media3.exoplayer.source.TrackGroupArray,androidx.media3.exoplayer.trackselection.ExoTrackSelection[])` instead. <br /> |
| `default void` | `[onTracksSelected](https://developer.android.com/reference/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[]))( https://developer.android.com/reference/androidx/media3/exoplayer/analytics/PlayerId playerId, https://developer.android.com/reference/androidx/media3/common/Timeline timeline, https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId mediaPeriodId, Renderer[] renderers, https://developer.android.com/reference/androidx/media3/exoplayer/source/TrackGroupArray trackGroups, @https://developer.android.com/reference/androidx/media3/common/util/NullableType ExoTrackSelection[] trackSelections )` **This method is deprecated.** Implement `https://developer.android.com/reference/androidx/media3/exoplayer/LoadControl#onTracksSelected(androidx.media3.exoplayer.LoadControl.Parameters,androidx.media3.exoplayer.source.TrackGroupArray,androidx.media3.exoplayer.trackselection.ExoTrackSelection[])` instead. <br /> |
| `default boolean` | `[retainBackBufferFromKeyframe](https://developer.android.com/reference/androidx/media3/exoplayer/LoadControl#retainBackBufferFromKeyframe())()` **This method is deprecated.** Implements `https://developer.android.com/reference/androidx/media3/exoplayer/LoadControl#retainBackBufferFromKeyframe(androidx.media3.exoplayer.analytics.PlayerId)` instead. <br /> |
| `default boolean` | `https://developer.android.com/reference/androidx/media3/exoplayer/LoadControl#retainBackBufferFromKeyframe(androidx.media3.exoplayer.analytics.PlayerId)(https://developer.android.com/reference/androidx/media3/exoplayer/analytics/PlayerId playerId)` Returns whether media should be retained from the keyframe before the current playback position minus `https://developer.android.com/reference/androidx/media3/exoplayer/LoadControl#getBackBufferDurationUs()`, rather than any sample before or at that position. |
| `default boolean` | `https://developer.android.com/reference/androidx/media3/exoplayer/LoadControl#shouldContinueLoading(androidx.media3.exoplayer.LoadControl.Parameters)(https://developer.android.com/reference/androidx/media3/exoplayer/LoadControl.Parameters parameters)` Called by the player to determine whether it should continue to load the source. |
| `default boolean` | `[shouldContinueLoading](https://developer.android.com/reference/androidx/media3/exoplayer/LoadControl#shouldContinueLoading(long,long,float))( long playbackPositionUs, long bufferedDurationUs, float playbackSpeed )` **This method is deprecated.** Implement `https://developer.android.com/reference/androidx/media3/exoplayer/LoadControl#shouldContinueLoading(androidx.media3.exoplayer.LoadControl.Parameters)` instead. <br /> |
| `default boolean` | `https://developer.android.com/reference/androidx/media3/exoplayer/LoadControl#shouldContinuePreloading(androidx.media3.exoplayer.analytics.PlayerId,androidx.media3.common.Timeline,androidx.media3.exoplayer.source.MediaSource.MediaPeriodId,long)( https://developer.android.com/reference/androidx/media3/exoplayer/analytics/PlayerId playerId, https://developer.android.com/reference/androidx/media3/common/Timeline timeline, https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId mediaPeriodId, long bufferedDurationUs )` Called to determine whether preloading should be continued. |
| `default boolean` | `https://developer.android.com/reference/androidx/media3/exoplayer/LoadControl#shouldStartPlayback(androidx.media3.exoplayer.LoadControl.Parameters)(https://developer.android.com/reference/androidx/media3/exoplayer/LoadControl.Parameters 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. |
| `default boolean` | `[shouldStartPlayback](https://developer.android.com/reference/androidx/media3/exoplayer/LoadControl#shouldStartPlayback(long,float,boolean,long))( long bufferedDurationUs, float playbackSpeed, boolean rebuffering, long targetLiveOffsetUs )` **This method is deprecated.** Implement `https://developer.android.com/reference/androidx/media3/exoplayer/LoadControl#shouldStartPlayback(androidx.media3.exoplayer.LoadControl.Parameters)` instead. <br /> |
| `default boolean` | `[shouldStartPlayback](https://developer.android.com/reference/androidx/media3/exoplayer/LoadControl#shouldStartPlayback(androidx.media3.common.Timeline,androidx.media3.exoplayer.source.MediaSource.MediaPeriodId,long,float,boolean,long))( https://developer.android.com/reference/androidx/media3/common/Timeline timeline, https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId mediaPeriodId, long bufferedDurationUs, float playbackSpeed, boolean rebuffering, long targetLiveOffsetUs )` **This method is deprecated.** Implement `https://developer.android.com/reference/androidx/media3/exoplayer/LoadControl#shouldStartPlayback(androidx.media3.exoplayer.LoadControl.Parameters)` instead. <br /> |

## Constants

### EMPTY_MEDIA_PERIOD_ID

```
default static final MediaSource.MediaPeriodId EMPTY_MEDIA_PERIOD_ID
```

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

## Public methods

### getAllocator

```
abstract Allocator getAllocator(PlayerId playerId)
```

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

### getBackBufferDurationUs

```
default long [getBackBufferDurationUs](https://developer.android.com/reference/androidx/media3/exoplayer/LoadControl#getBackBufferDurationUs())()
```

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

### getBackBufferDurationUs

```
default long getBackBufferDurationUs(PlayerId playerId)
```

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/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 |
|---|---|
| `https://developer.android.com/reference/androidx/media3/exoplayer/analytics/PlayerId playerId` | The `https://developer.android.com/reference/androidx/media3/exoplayer/analytics/PlayerId` that requests the back buffer duration. |

| Returns |
|---|---|
| `long` | The duration of media to retain in the buffer prior to the current playback position, in microseconds. |

### onPrepared

```
default void [onPrepared](https://developer.android.com/reference/androidx/media3/exoplayer/LoadControl#onPrepared())()
```

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

### onPrepared

```
default void onPrepared(PlayerId playerId)
```

Called by the player when prepared with a new source.

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

### onReleased

```
default void [onReleased](https://developer.android.com/reference/androidx/media3/exoplayer/LoadControl#onReleased())()
```

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

### onReleased

```
default void onReleased(PlayerId playerId)
```

Called by the player when released.

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

### onStopped

```
default void [onStopped](https://developer.android.com/reference/androidx/media3/exoplayer/LoadControl#onStopped())()
```

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

### onStopped

```
default void onStopped(PlayerId playerId)
```

Called by the player when stopped.

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

### onTracksSelected

```
default void onTracksSelected(
    LoadControl.Parameters parameters,
    TrackGroupArray trackGroups,
    @NullableType ExoTrackSelection[] trackSelections
)
```

Called by the player when a track selection occurs.

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

### onTracksSelected

```
default void [onTracksSelected](https://developer.android.com/reference/androidx/media3/exoplayer/LoadControl#onTracksSelected(androidx.media3.exoplayer.Renderer[],androidx.media3.exoplayer.source.TrackGroupArray,androidx.media3.exoplayer.trackselection.ExoTrackSelection[]))(
    Renderer[] renderers,
    TrackGroupArray trackGroups,
    @NullableType ExoTrackSelection[] trackSelections
)
```

> [!CAUTION]
> **This method is deprecated.**   
>
> Implement `https://developer.android.com/reference/androidx/media3/exoplayer/LoadControl#onTracksSelected(androidx.media3.exoplayer.LoadControl.Parameters,androidx.media3.exoplayer.source.TrackGroupArray,androidx.media3.exoplayer.trackselection.ExoTrackSelection[])` instead.

### onTracksSelected

```
default void [onTracksSelected](https://developer.android.com/reference/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,
    MediaSource.MediaPeriodId mediaPeriodId,
    Renderer[] renderers,
    TrackGroupArray trackGroups,
    @NullableType ExoTrackSelection[] trackSelections
)
```

> [!CAUTION]
> **This method is deprecated.**   
>
> Implement `https://developer.android.com/reference/androidx/media3/exoplayer/LoadControl#onTracksSelected(androidx.media3.exoplayer.LoadControl.Parameters,androidx.media3.exoplayer.source.TrackGroupArray,androidx.media3.exoplayer.trackselection.ExoTrackSelection[])` instead.

### onTracksSelected

```
default void [onTracksSelected](https://developer.android.com/reference/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,
    MediaSource.MediaPeriodId mediaPeriodId,
    Renderer[] renderers,
    TrackGroupArray trackGroups,
    @NullableType ExoTrackSelection[] trackSelections
)
```

> [!CAUTION]
> **This method is deprecated.**   
>
> Implement `https://developer.android.com/reference/androidx/media3/exoplayer/LoadControl#onTracksSelected(androidx.media3.exoplayer.LoadControl.Parameters,androidx.media3.exoplayer.source.TrackGroupArray,androidx.media3.exoplayer.trackselection.ExoTrackSelection[])` instead.

### retainBackBufferFromKeyframe

```
default boolean [retainBackBufferFromKeyframe](https://developer.android.com/reference/androidx/media3/exoplayer/LoadControl#retainBackBufferFromKeyframe())()
```

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

### retainBackBufferFromKeyframe

```
default boolean retainBackBufferFromKeyframe(PlayerId playerId)
```

Returns whether media should be retained from the keyframe before the current playback position minus `https://developer.android.com/reference/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/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 |
|---|---|
| `https://developer.android.com/reference/androidx/media3/exoplayer/analytics/PlayerId playerId` | The `https://developer.android.com/reference/androidx/media3/exoplayer/analytics/PlayerId` that requests whether to retain the back buffer from key frame. |

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

### shouldContinueLoading

```
default boolean shouldContinueLoading(LoadControl.Parameters parameters)
```

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/androidx/media3/exoplayer/source/MediaPeriod` identified in the most recent `https://developer.android.com/reference/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 |
|---|---|
| `https://developer.android.com/reference/androidx/media3/exoplayer/LoadControl.Parameters parameters` | Information about the playback context and the `https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaPeriod` that will continue to load if this method returns `true`. |

| Returns |
|---|---|
| `boolean` | Whether the loading should continue. |

### shouldContinueLoading

```
default boolean [shouldContinueLoading](https://developer.android.com/reference/androidx/media3/exoplayer/LoadControl#shouldContinueLoading(long,long,float))(
    long playbackPositionUs,
    long bufferedDurationUs,
    float playbackSpeed
)
```

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

### shouldContinuePreloading

```
default boolean shouldContinuePreloading(
    PlayerId playerId,
    Timeline timeline,
    MediaSource.MediaPeriodId mediaPeriodId,
    long bufferedDurationUs
)
```

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

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

| Returns |
|---|---|
| `boolean` | Whether the preloading should continue for the given period. |

### shouldStartPlayback

```
default boolean shouldStartPlayback(LoadControl.Parameters 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. 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 |
|---|---|
| `https://developer.android.com/reference/androidx/media3/exoplayer/LoadControl.Parameters parameters` | Information about the playback context and the `https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaPeriod` that will start playing if this method returns `true`. |

| Returns |
|---|---|
| `boolean` | Whether playback should be allowed to start or resume. |

### shouldStartPlayback

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

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

### shouldStartPlayback

```
default boolean [shouldStartPlayback](https://developer.android.com/reference/androidx/media3/exoplayer/LoadControl#shouldStartPlayback(androidx.media3.common.Timeline,androidx.media3.exoplayer.source.MediaSource.MediaPeriodId,long,float,boolean,long))(
    Timeline timeline,
    MediaSource.MediaPeriodId mediaPeriodId,
    long bufferedDurationUs,
    float playbackSpeed,
    boolean rebuffering,
    long targetLiveOffsetUs
)
```

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