# DefaultSsChunkSource

# DefaultSsChunkSource

Artifact:[androidx.media3:media3-exoplayer-smoothstreaming](https://developer.android.com/jetpack/androidx/releases/media3)  
[View Source](https://cs.android.com/search?q=file:androidx/media3/exoplayer/smoothstreaming/DefaultSsChunkSource.java+class:androidx.media3.exoplayer.smoothstreaming.DefaultSsChunkSource)

*** ** * ** ***

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

<br />

```
@UnstableApi
class DefaultSsChunkSource : SsChunkSource
```

<br />

*** ** * ** ***

A default[SsChunkSource](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/smoothstreaming/SsChunkSource)implementation.

## Summary

|                                                                                                                                             ### Nested types                                                                                                                                              |
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `class `[DefaultSsChunkSource.Factory](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/smoothstreaming/DefaultSsChunkSource.Factory)` : `[SsChunkSource.Factory](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/smoothstreaming/SsChunkSource.Factory) |

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              ### Public constructors                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [DefaultSsChunkSource](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/smoothstreaming/DefaultSsChunkSource#DefaultSsChunkSource(androidx.media3.exoplayer.upstream.LoaderErrorThrower,androidx.media3.exoplayer.smoothstreaming.manifest.SsManifest,int,androidx.media3.exoplayer.trackselection.ExoTrackSelection,androidx.media3.datasource.DataSource,androidx.media3.exoplayer.upstream.CmcdConfiguration,androidx.media3.extractor.text.SubtitleParser.Factory,boolean))`(` ` manifestLoaderErrorThrower: `[LoaderErrorThrower](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/LoaderErrorThrower)`!,` ` manifest: `[SsManifest](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/smoothstreaming/manifest/SsManifest)`!,` ` streamElementIndex: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`,` ` trackSelection: `[ExoTrackSelection](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/trackselection/ExoTrackSelection)`!,` ` dataSource: `[DataSource](https://developer.android.com/reference/kotlin/androidx/media3/datasource/DataSource)`!,` ` cmcdConfiguration: `[CmcdConfiguration](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/CmcdConfiguration)`?,` ` subtitleParserFactory: `[SubtitleParser.Factory](https://developer.android.com/reference/kotlin/androidx/media3/extractor/text/SubtitleParser.Factory)`!,` ` parseSubtitlesDuringExtraction: `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) `)` |

|                                ### Public functions                                 |
|-------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)       | [getAdjustedSeekPositionUs](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/smoothstreaming/DefaultSsChunkSource#getAdjustedSeekPositionUs(long,androidx.media3.exoplayer.SeekParameters))`(` ` positionUs: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)`,` ` seekParameters: `[SeekParameters](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/SeekParameters)`!` `)` Adjusts a seek position given the specified[SeekParameters](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/SeekParameters).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)       | [getNextChunk](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/smoothstreaming/DefaultSsChunkSource#getNextChunk(androidx.media3.exoplayer.LoadingInfo,long,java.util.List<? extends androidx.media3.exoplayer.source.chunk.MediaChunk>,androidx.media3.exoplayer.source.chunk.ChunkHolder))`(` ` loadingInfo: `[LoadingInfo](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/LoadingInfo)`!,` ` loadPositionUs: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)`,` ` queue: (`[Mutable](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)`)`[List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)`<`[MediaChunk](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/MediaChunk)`!>!,` ` out: `[ChunkHolder](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/ChunkHolder)`!` `)` Returns the next chunk to load.                                                                                           |
| [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)         | [getPreferredQueueSize](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/smoothstreaming/DefaultSsChunkSource#getPreferredQueueSize(long,java.util.List<? extends androidx.media3.exoplayer.source.chunk.MediaChunk>))`(` ` playbackPositionUs: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)`,` ` queue: (`[Mutable](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)`)`[List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)`<`[MediaChunk](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/MediaChunk)`!>!` `)` Evaluates whether[MediaChunk](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/MediaChunk)s should be removed from the back of the queue.                                                                                                                                                                                                                                                                    |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)       | [maybeThrowError](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/smoothstreaming/DefaultSsChunkSource#maybeThrowError())`()` If the source is currently having difficulty providing chunks, then this method throws the underlying error.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)       | [onChunkLoadCompleted](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/smoothstreaming/DefaultSsChunkSource#onChunkLoadCompleted(androidx.media3.exoplayer.source.chunk.Chunk))`(chunk: `[Chunk](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/Chunk)`!)` Called when the[ChunkSampleStream](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/ChunkSampleStream)has finished loading a chunk obtained from this source.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | [onChunkLoadError](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/smoothstreaming/DefaultSsChunkSource#onChunkLoadError(androidx.media3.exoplayer.source.chunk.Chunk,boolean,androidx.media3.exoplayer.upstream.LoadErrorHandlingPolicy.LoadErrorInfo,androidx.media3.exoplayer.upstream.LoadErrorHandlingPolicy))`(` ` chunk: `[Chunk](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/Chunk)`!,` ` cancelable: `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)`,` ` loadErrorInfo: `[LoadErrorHandlingPolicy.LoadErrorInfo](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/LoadErrorHandlingPolicy.LoadErrorInfo)`!,` ` loadErrorHandlingPolicy: `[LoadErrorHandlingPolicy](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/LoadErrorHandlingPolicy)`!` `)` Called when the[ChunkSampleStream](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/ChunkSampleStream)encounters an error loading a chunk obtained from this source. |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)       | [release](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/smoothstreaming/DefaultSsChunkSource#release())`()` Releases any held resources.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | [shouldCancelLoad](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/smoothstreaming/DefaultSsChunkSource#shouldCancelLoad(long,androidx.media3.exoplayer.source.chunk.Chunk,java.util.List<? extends androidx.media3.exoplayer.source.chunk.MediaChunk>))`(` ` playbackPositionUs: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)`,` ` loadingChunk: `[Chunk](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/Chunk)`!,` ` queue: (`[Mutable](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)`)`[List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)`<`[MediaChunk](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/MediaChunk)`!>!` `)` Returns whether an ongoing load of a chunk should be canceled.                                                                                                                                                                                                                       |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)       | [updateManifest](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/smoothstreaming/DefaultSsChunkSource#updateManifest(androidx.media3.exoplayer.smoothstreaming.manifest.SsManifest))`(newManifest: `[SsManifest](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/smoothstreaming/manifest/SsManifest)`!)` Updates the manifest.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)       | [updateTrackSelection](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/smoothstreaming/DefaultSsChunkSource#updateTrackSelection(androidx.media3.exoplayer.trackselection.ExoTrackSelection))`(trackSelection: `[ExoTrackSelection](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/trackselection/ExoTrackSelection)`!)` Updates the track selection.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |

## Public constructors

### DefaultSsChunkSource

```
DefaultSsChunkSource(
    manifestLoaderErrorThrower: LoaderErrorThrower!,
    manifest: SsManifest!,
    streamElementIndex: Int,
    trackSelection: ExoTrackSelection!,
    dataSource: DataSource!,
    cmcdConfiguration: CmcdConfiguration?,
    subtitleParserFactory: SubtitleParser.Factory!,
    parseSubtitlesDuringExtraction: Boolean
)
```  

|                                                                         Parameters                                                                          |
|-------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `manifestLoaderErrorThrower: `[LoaderErrorThrower](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/LoaderErrorThrower)`!` | Throws errors affecting loading of manifests.                                                                                                                             |
| `manifest: `[SsManifest](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/smoothstreaming/manifest/SsManifest)`!`                   | The initial manifest.                                                                                                                                                     |
| `streamElementIndex: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                                                           | The index of the stream element in the manifest.                                                                                                                          |
| `trackSelection: `[ExoTrackSelection](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/trackselection/ExoTrackSelection)`!`         | The track selection.                                                                                                                                                      |
| `dataSource: `[DataSource](https://developer.android.com/reference/kotlin/androidx/media3/datasource/DataSource)`!`                                         | A[DataSource](https://developer.android.com/reference/kotlin/androidx/media3/datasource/DataSource)suitable for loading the media data.                                   |
| `cmcdConfiguration: `[CmcdConfiguration](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/CmcdConfiguration)`?`            | The[CmcdConfiguration](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/CmcdConfiguration)for this chunk source.                         |
| `subtitleParserFactory: `[SubtitleParser.Factory](https://developer.android.com/reference/kotlin/androidx/media3/extractor/text/SubtitleParser.Factory)`!`  | The[SubtitleParser.Factory](https://developer.android.com/reference/kotlin/androidx/media3/extractor/text/SubtitleParser.Factory)for parsing subtitles during extraction. |
| `parseSubtitlesDuringExtraction: `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)                                       | Whether to parse subtitles during extraction or rendering.                                                                                                                |

## Public functions

### getAdjustedSeekPositionUs

```
fun getAdjustedSeekPositionUs(
    positionUs: Long,
    seekParameters: SeekParameters!
): Long
```

Adjusts a seek position given the specified[SeekParameters](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/SeekParameters). Chunk boundaries are used as sync points.  

|                                                           Parameters                                                           |
|--------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------|
| `positionUs: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)                                    | The seek position in microseconds.                 |
| `seekParameters: `[SeekParameters](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/SeekParameters)`!` | Parameters that control how the seek is performed. |

|                                    Returns                                    |
|-------------------------------------------------------------------------------|----------------------------------------------|
| [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) | The adjusted seek position, in microseconds. |

### getNextChunk

```
fun getNextChunk(
    loadingInfo: LoadingInfo!,
    loadPositionUs: Long,
    queue: (Mutable)List<MediaChunk!>!,
    out: ChunkHolder!
): Unit
```

Returns the next chunk to load.

If a chunk is available then[chunk](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/ChunkHolder#chunk())is set. If the end of the stream has been reached then[endOfStream](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/ChunkHolder#endOfStream())is set. If a chunk is not available but the end of the stream has not been reached, the[ChunkHolder](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/ChunkHolder)is not modified.  

|                                                                                                                                                            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 loading request is made.                                                                                                                                                                      |
| `loadPositionUs: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)                                                                                                                                                                                                                                  | The current load position in microseconds. If`queue`is empty, this is the starting position from which chunks should be provided. Else it's equal to[endTimeUs](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/Chunk#endTimeUs())of the last chunk in the`queue`. |
| `queue: (`[Mutable](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)`)`[List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)`<`[MediaChunk](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/MediaChunk)`!>!` | The queue of buffered[MediaChunk](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/MediaChunk)s.                                                                                                                                                                    |
| `out: `[ChunkHolder](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/ChunkHolder)`!`                                                                                                                                                                                                       | A holder to populate.                                                                                                                                                                                                                                                                                    |

### getPreferredQueueSize

```
fun getPreferredQueueSize(
    playbackPositionUs: Long,
    queue: (Mutable)List<MediaChunk!>!
): Int
```

Evaluates whether[MediaChunk](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/MediaChunk)s should be removed from the back of the queue.

Removing[MediaChunk](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/MediaChunk)s from the back of the queue can be useful if they could be replaced with chunks of a significantly higher quality (e.g. because the available bandwidth has substantially increased).

Will only be called if no[MediaChunk](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/MediaChunk)in the queue is currently loading.  

|                                                                                                                                                            Parameters                                                                                                                                                            |
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------|
| `playbackPositionUs: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)                                                                                                                                                                                                                              | The current playback position, in microseconds.                                                                                       |
| `queue: (`[Mutable](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)`)`[List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)`<`[MediaChunk](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/MediaChunk)`!>!` | The queue of buffered[MediaChunk](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/MediaChunk)s. |

|                                   Returns                                   |
|-----------------------------------------------------------------------------|---------------------------|
| [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | The preferred queue size. |

### maybeThrowError

```
fun maybeThrowError(): Unit
```

If the source is currently having difficulty providing chunks, then this method throws the underlying error. Otherwise does nothing.  

|                                         Throws                                          |
|-----------------------------------------------------------------------------------------|-----------------------|
| [java.io.IOException](https://developer.android.com/reference/java/io/IOException.html) | The underlying error. |

### onChunkLoadCompleted

```
fun onChunkLoadCompleted(chunk: Chunk!): Unit
```

Called when the[ChunkSampleStream](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/ChunkSampleStream)has finished loading a chunk obtained from this source.  

|                                                    Parameters                                                    |
|------------------------------------------------------------------------------------------------------------------|------------------------------------------|
| `chunk: `[Chunk](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/Chunk)`!` | The chunk whose load has been completed. |

### onChunkLoadError

```
fun onChunkLoadError(
    chunk: Chunk!,
    cancelable: Boolean,
    loadErrorInfo: LoadErrorHandlingPolicy.LoadErrorInfo!,
    loadErrorHandlingPolicy: LoadErrorHandlingPolicy!
): Boolean
```

Called when the[ChunkSampleStream](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/ChunkSampleStream)encounters an error loading a chunk obtained from this source.  

|                                                                                      Parameters                                                                                      |
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------|
| `chunk: `[Chunk](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/Chunk)`!`                                                                     | The chunk whose load encountered the error.                                           |
| `cancelable: `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)                                                                                    | Whether the load can be canceled.                                                     |
| `loadErrorInfo: `[LoadErrorHandlingPolicy.LoadErrorInfo](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/LoadErrorHandlingPolicy.LoadErrorInfo)`!` | The load error info.                                                                  |
| `loadErrorHandlingPolicy: `[LoadErrorHandlingPolicy](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/LoadErrorHandlingPolicy)`!`                   | The load error handling policy to customize the behaviour of handling the load error. |

|                                       Returns                                       |
|-------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | Whether the load should be canceled so that a replacement chunk can be loaded instead. Must be`false`if`cancelable`is`false`. If`true`,[getNextChunk](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/ChunkSource#getNextChunk(androidx.media3.exoplayer.LoadingInfo,long,java.util.List<? extends androidx.media3.exoplayer.source.chunk.MediaChunk>,androidx.media3.exoplayer.source.chunk.ChunkHolder))will be called to obtain the replacement chunk. |

### release

```
fun release(): Unit
```

Releases any held resources.  

### shouldCancelLoad

```
fun shouldCancelLoad(
    playbackPositionUs: Long,
    loadingChunk: Chunk!,
    queue: (Mutable)List<MediaChunk!>!
): Boolean
```

Returns whether an ongoing load of a chunk should be canceled.  

|                                                                                                                                                            Parameters                                                                                                                                                            |
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------|
| `playbackPositionUs: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)                                                                                                                                                                                                                              | The current playback position, in microseconds.                                                                                       |
| `loadingChunk: `[Chunk](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/Chunk)`!`                                                                                                                                                                                                          | The currently loading[Chunk](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/Chunk).            |
| `queue: (`[Mutable](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)`)`[List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)`<`[MediaChunk](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/MediaChunk)`!>!` | The queue of buffered[MediaChunks](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/MediaChunk). |

|                                       Returns                                       |
|-------------------------------------------------------------------------------------|--------------------------------------------------------------|
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | Whether the ongoing load of`loadingChunk`should be canceled. |

### updateManifest

```
fun updateManifest(newManifest: SsManifest!): Unit
```

Updates the manifest.  

|                                                                  Parameters                                                                  |
|----------------------------------------------------------------------------------------------------------------------------------------------|-------------------|
| `newManifest: `[SsManifest](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/smoothstreaming/manifest/SsManifest)`!` | The new manifest. |

### updateTrackSelection

```
fun updateTrackSelection(trackSelection: ExoTrackSelection!): Unit
```

Updates the track selection.  

|                                                                     Parameters                                                                      |
|-----------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------|
| `trackSelection: `[ExoTrackSelection](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/trackselection/ExoTrackSelection)`!` | The new track selection instance. Must be equivalent to the previous one. |