# SequenceableLoader

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

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/media3/exoplayer/source/SequenceableLoader "View this page in Java")

<br />

```
@UnstableApi
interface SequenceableLoader
```

<br />

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

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

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

|------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [ClippingMediaPeriod](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/ClippingMediaPeriod)   | Wraps a[MediaPeriod](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaPeriod)and clips its[SampleStream](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/SampleStream)s to provide a subsequence of their samples.                                                                                                                                                                                                                   |
| [FakeAdaptiveMediaPeriod](https://developer.android.com/reference/kotlin/androidx/media3/test/utils/FakeAdaptiveMediaPeriod) | Fake[MediaPeriod](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaPeriod)that provides tracks from the given[TrackGroupArray](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/TrackGroupArray).                                                                                                                                                                                                                                     |
| [FakeMediaPeriod](https://developer.android.com/reference/kotlin/androidx/media3/test/utils/FakeMediaPeriod)                 | Fake[MediaPeriod](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaPeriod)that provides tracks from the given[TrackGroupArray](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/TrackGroupArray).                                                                                                                                                                                                                                     |
| [MaskingMediaPeriod](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MaskingMediaPeriod)     | Media period that defers calling[createPeriod](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource#createPeriod(androidx.media3.exoplayer.source.MediaSource.MediaPeriodId,androidx.media3.exoplayer.upstream.Allocator,long))on a given source until[createPeriod](https://developer.android.com/reference/kotlin/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                                                                                                                                                                                                                    |
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `interface `[SequenceableLoader.Callback](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/SequenceableLoader.Callback)`<T : `[SequenceableLoader](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/SequenceableLoader)`?>` A callback to be notified of[SequenceableLoader](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/SequenceableLoader)events. |

|                                ### Public functions                                 |
|-------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | [continueLoading](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/SequenceableLoader#continueLoading(androidx.media3.exoplayer.LoadingInfo))`(loadingInfo: `[LoadingInfo](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/LoadingInfo)`!)` Attempts to continue loading. |
| [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)       | [getBufferedPositionUs](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/SequenceableLoader#getBufferedPositionUs())`()` Returns an estimate of the position up to which data is buffered.                                                                                                         |
| [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)       | [getNextLoadPositionUs](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/SequenceableLoader#getNextLoadPositionUs())`()` Returns the next load time, or[TIME_END_OF_SOURCE](https://developer.android.com/reference/kotlin/androidx/media3/common/C#TIME_END_OF_SOURCE())if loading has finished.  |
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | [isLoading](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/SequenceableLoader#isLoading())`()` Returns whether the loader is currently loading.                                                                                                                                                  |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)       | [reevaluateBuffer](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/SequenceableLoader#reevaluateBuffer(long))`(positionUs: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)`)` Re-evaluates the buffer given the playback position.                                 |

## Public functions

### continueLoading

```
fun continueLoading(loadingInfo: LoadingInfo!): Boolean
```

Attempts to continue loading.  

|                                                      Parameters                                                       |
|-----------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------|
| `loadingInfo: `[LoadingInfo](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/LoadingInfo)`!` | The[LoadingInfo](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/LoadingInfo)when attempting to continue loading. |

|                                       Returns                                       |
|-------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | True if progress was made, meaning that[getNextLoadPositionUs](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/SequenceableLoader#getNextLoadPositionUs())will return a different value than prior to the call. False otherwise. |

### getBufferedPositionUs

```
fun getBufferedPositionUs(): Long
```

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

|                                    Returns                                    |
|-------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) | An estimate of the absolute position in microseconds up to which data is buffered, or[TIME_END_OF_SOURCE](https://developer.android.com/reference/kotlin/androidx/media3/common/C#TIME_END_OF_SOURCE())if the data is fully buffered. |

### getNextLoadPositionUs

```
fun getNextLoadPositionUs(): Long
```

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

### isLoading

```
fun isLoading(): Boolean
```

Returns whether the loader is currently loading.  

### reevaluateBuffer

```
fun reevaluateBuffer(positionUs: Long): Unit
```

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                                          |
|---------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `positionUs: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) | 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. |