# DashChunkSource

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

*** ** * ** ***


```
@UnstableApi
interface DashChunkSource : ChunkSource
```

<br />

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

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/DefaultDashChunkSource` | A default `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/DashChunkSource` implementation. |

*** ** * ** ***

A `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/ChunkSource` for DASH streams.

## Summary

| ### Nested types |
|---|
| `interface https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/DashChunkSource.Factory` Factory for `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/DashChunkSource`s. |

| ### Public functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/BaseUrl?` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/DashChunkSource#getSelectedBaseUrl()()` Returns the selected `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/BaseUrl`. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/DashChunkSource#updateManifest(androidx.media3.exoplayer.dash.manifest.DashManifest,int)(newManifest: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/DashManifest!, newPeriodIndex: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Updates the manifest. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/DashChunkSource#updateTrackSelection(androidx.media3.exoplayer.trackselection.ExoTrackSelection)(trackSelection: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/trackselection/ExoTrackSelection!)` Updates the track selection. |

### Inherited functions

From [androidx.media3.exoplayer.source.chunk.ChunkSource](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/ChunkSource) `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/ChunkSource#getAdjustedSeekPositionUs(long,androidx.media3.exoplayer.SeekParameters)(
positionUs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html,
seekParameters: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/SeekParameters!
)`

Adjusts a seek position given the specified `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/SeekParameters`.
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `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)(
loadingInfo: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/LoadingInfo!,
loadPositionUs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html,
queue: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/MediaChunk!>!,
out: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/ChunkHolder!
)`

Returns the next chunk to load.
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/ChunkSource#getPreferredQueueSize(long,java.util.List<? extends androidx.media3.exoplayer.source.chunk.MediaChunk>)(
playbackPositionUs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html,
queue: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/MediaChunk!>!
)`

Evaluates whether `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/MediaChunk`s should be removed from the back of the queue.
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/ChunkSource#maybeThrowError()()`

If the source is currently having difficulty providing chunks, then this method throws the underlying error.
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/ChunkSource#onChunkLoadCompleted(androidx.media3.exoplayer.source.chunk.Chunk)(chunk: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/Chunk!)`

Called when the `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/ChunkSampleStream` has finished loading a chunk obtained from this source.
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/ChunkSource#onChunkLoadError(androidx.media3.exoplayer.source.chunk.Chunk,boolean,androidx.media3.exoplayer.upstream.LoadErrorHandlingPolicy.LoadErrorInfo,androidx.media3.exoplayer.upstream.LoadErrorHandlingPolicy)(
chunk: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/Chunk!,
cancelable: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html,
loadErrorInfo: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/LoadErrorHandlingPolicy.LoadErrorInfo!,
loadErrorHandlingPolicy: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/LoadErrorHandlingPolicy!
)`

Called when the `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/ChunkSampleStream` encounters an error loading a chunk obtained from this source.
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/ChunkSource#release()()`

Releases any held resources.
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/ChunkSource#shouldCancelLoad(long,androidx.media3.exoplayer.source.chunk.Chunk,java.util.List<? extends androidx.media3.exoplayer.source.chunk.MediaChunk>)(
playbackPositionUs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html,
loadingChunk: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/Chunk!,
queue: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/MediaChunk!>!
)`

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

## Public functions

### getSelectedBaseUrl

```
fun getSelectedBaseUrl(): BaseUrl?
```

Returns the selected `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/BaseUrl`.

The default implementation returns `null`.

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/BaseUrl?` | The selected `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/BaseUrl` of this `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/DashChunkSource`. Can be `null` if unknown or if no `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/BaseUrl` has been selected. |

### updateManifest

```
fun updateManifest(newManifest: DashManifest!, newPeriodIndex: Int): Unit
```

Updates the manifest.

| Parameters |
|---|---|
| `newManifest: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/DashManifest!` | The new manifest. |
| `newPeriodIndex: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The index of the period covered by `newManifest`. |

### updateTrackSelection

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

Updates the track selection.

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