# SequenceableLoader

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

*** ** * ** ***


```
@UnstableApi
public interface SequenceableLoader
```

<br />

Known direct subclasses [ChunkSampleStream](https://developer.android.com/reference/androidx/media3/exoplayer/source/chunk/ChunkSampleStream), [CompositeSequenceableLoader](https://developer.android.com/reference/androidx/media3/exoplayer/source/CompositeSequenceableLoader), [MediaPeriod](https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaPeriod)

|---|---|
| `https://developer.android.com/reference/androidx/media3/exoplayer/source/chunk/ChunkSampleStream` | A `https://developer.android.com/reference/androidx/media3/exoplayer/source/SampleStream` that loads media in `https://developer.android.com/reference/androidx/media3/exoplayer/source/chunk/Chunk`s, obtained from a `https://developer.android.com/reference/androidx/media3/exoplayer/source/chunk/ChunkSource`. |
| `https://developer.android.com/reference/androidx/media3/exoplayer/source/CompositeSequenceableLoader` | A `https://developer.android.com/reference/androidx/media3/exoplayer/source/SequenceableLoader` that encapsulates multiple other `https://developer.android.com/reference/androidx/media3/exoplayer/source/SequenceableLoader`s. |
| `https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaPeriod` | Loads media corresponding to a `https://developer.android.com/reference/androidx/media3/common/Timeline.Period`, and allows that media to be read. |

Known indirect subclasses [ClippingMediaPeriod](https://developer.android.com/reference/androidx/media3/exoplayer/source/ClippingMediaPeriod), [FakeAdaptiveMediaPeriod](https://developer.android.com/reference/androidx/media3/test/utils/FakeAdaptiveMediaPeriod), [FakeMediaPeriod](https://developer.android.com/reference/androidx/media3/test/utils/FakeMediaPeriod), [MaskingMediaPeriod](https://developer.android.com/reference/androidx/media3/exoplayer/source/MaskingMediaPeriod)

|---|---|
| `https://developer.android.com/reference/androidx/media3/exoplayer/source/ClippingMediaPeriod` | Wraps a `https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaPeriod` and clips its `https://developer.android.com/reference/androidx/media3/exoplayer/source/SampleStream`s to provide a subsequence of their samples. |
| `https://developer.android.com/reference/androidx/media3/test/utils/FakeAdaptiveMediaPeriod` | Fake `https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaPeriod` that provides tracks from the given `https://developer.android.com/reference/androidx/media3/exoplayer/source/TrackGroupArray`. |
| `https://developer.android.com/reference/androidx/media3/test/utils/FakeMediaPeriod` | Fake `https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaPeriod` that provides tracks from the given `https://developer.android.com/reference/androidx/media3/exoplayer/source/TrackGroupArray`. |
| `https://developer.android.com/reference/androidx/media3/exoplayer/source/MaskingMediaPeriod` | Media period that defers calling `https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource#createPeriod(androidx.media3.exoplayer.source.MediaSource.MediaPeriodId,androidx.media3.exoplayer.upstream.Allocator,long)` on a given source until `https://developer.android.com/reference/androidx/media3/exoplayer/source/MaskingMediaPeriod#createPeriod(androidx.media3.exoplayer.source.MediaSource.MediaPeriodId)` has been called. |

*** ** * ** ***

A loader that can proceed in approximate synchronization with other loaders.

## Summary

| ### Nested types |
|---|
| `public interface https://developer.android.com/reference/androidx/media3/exoplayer/source/SequenceableLoader.Callback<T extends https://developer.android.com/reference/androidx/media3/exoplayer/source/SequenceableLoader>` A callback to be notified of `https://developer.android.com/reference/androidx/media3/exoplayer/source/SequenceableLoader` events. |

| ### Public methods |
|---|---|
| `abstract boolean` | `https://developer.android.com/reference/androidx/media3/exoplayer/source/SequenceableLoader#continueLoading(androidx.media3.exoplayer.LoadingInfo)(https://developer.android.com/reference/androidx/media3/exoplayer/LoadingInfo loadingInfo)` Attempts to continue loading. |
| `abstract long` | `https://developer.android.com/reference/androidx/media3/exoplayer/source/SequenceableLoader#getBufferedPositionUs()()` Returns an estimate of the position up to which data is buffered. |
| `abstract long` | `https://developer.android.com/reference/androidx/media3/exoplayer/source/SequenceableLoader#getNextLoadPositionUs()()` Returns the next load time, or `https://developer.android.com/reference/androidx/media3/common/C#TIME_END_OF_SOURCE()` if loading has finished. |
| `abstract boolean` | `https://developer.android.com/reference/androidx/media3/exoplayer/source/SequenceableLoader#isLoading()()` Returns whether the loader is currently loading. |
| `abstract void` | `https://developer.android.com/reference/androidx/media3/exoplayer/source/SequenceableLoader#reevaluateBuffer(long)(long positionUs)` Re-evaluates the buffer given the playback position. |

## Public methods

### continueLoading

```
abstract boolean continueLoading(LoadingInfo loadingInfo)
```

Attempts to continue loading.

| Parameters |
|---|---|
| `https://developer.android.com/reference/androidx/media3/exoplayer/LoadingInfo loadingInfo` | The `https://developer.android.com/reference/androidx/media3/exoplayer/LoadingInfo` when attempting to continue loading. |

| Returns |
|---|---|
| `boolean` | True if progress was made, meaning that `https://developer.android.com/reference/androidx/media3/exoplayer/source/SequenceableLoader#getNextLoadPositionUs()` will return a different value than prior to the call. False otherwise. |

### getBufferedPositionUs

```
abstract long getBufferedPositionUs()
```

Returns an estimate of the position up to which data is buffered.

| Returns |
|---|---|
| `long` | An estimate of the absolute position in microseconds up to which data is buffered, or `https://developer.android.com/reference/androidx/media3/common/C#TIME_END_OF_SOURCE()` if the data is fully buffered. |

### getNextLoadPositionUs

```
abstract long getNextLoadPositionUs()
```

Returns the next load time, or `https://developer.android.com/reference/androidx/media3/common/C#TIME_END_OF_SOURCE()` if loading has finished.

### isLoading

```
abstract boolean isLoading()
```

Returns whether the loader is currently loading.

### reevaluateBuffer

```
abstract void reevaluateBuffer(long positionUs)
```

Re-evaluates the buffer given the playback position.

Re-evaluation may discard buffered media or cancel ongoing loads so that media can be re-buffered in a different quality.

| Parameters |
|---|---|
| `long positionUs` | The current playback position in microseconds. If playback of this period has not yet started, the value will be the starting position in this period minus the duration of any media in previous periods still to be played. |