# 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
public interface DashChunkSource extends ChunkSource
```

<br />

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

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

*** ** * ** ***

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

## Summary

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

| ### Public methods |
|---|---|
| `default @https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/androidx/media3/exoplayer/dash/manifest/BaseUrl` | `https://developer.android.com/reference/androidx/media3/exoplayer/dash/DashChunkSource#getSelectedBaseUrl()()` Returns the selected `https://developer.android.com/reference/androidx/media3/exoplayer/dash/manifest/BaseUrl`. |
| `abstract void` | `https://developer.android.com/reference/androidx/media3/exoplayer/dash/DashChunkSource#updateManifest(androidx.media3.exoplayer.dash.manifest.DashManifest,int)(https://developer.android.com/reference/androidx/media3/exoplayer/dash/manifest/DashManifest newManifest, int newPeriodIndex)` Updates the manifest. |
| `abstract void` | `https://developer.android.com/reference/androidx/media3/exoplayer/dash/DashChunkSource#updateTrackSelection(androidx.media3.exoplayer.trackselection.ExoTrackSelection)(https://developer.android.com/reference/androidx/media3/exoplayer/trackselection/ExoTrackSelection trackSelection)` Updates the track selection. |

### Inherited methods

From [androidx.media3.exoplayer.source.chunk.ChunkSource](https://developer.android.com/reference/androidx/media3/exoplayer/source/chunk/ChunkSource) `abstract long` `https://developer.android.com/reference/androidx/media3/exoplayer/source/chunk/ChunkSource#getAdjustedSeekPositionUs(long,androidx.media3.exoplayer.SeekParameters)(
long positionUs,
https://developer.android.com/reference/androidx/media3/exoplayer/SeekParameters seekParameters
)`

Adjusts a seek position given the specified `https://developer.android.com/reference/androidx/media3/exoplayer/SeekParameters`.
`abstract void` `https://developer.android.com/reference/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)(
https://developer.android.com/reference/androidx/media3/exoplayer/LoadingInfo loadingInfo,
long loadPositionUs,
https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/androidx/media3/exoplayer/source/chunk/MediaChunk> queue,
https://developer.android.com/reference/androidx/media3/exoplayer/source/chunk/ChunkHolder out
)`

Returns the next chunk to load.
`abstract int` `https://developer.android.com/reference/androidx/media3/exoplayer/source/chunk/ChunkSource#getPreferredQueueSize(long,java.util.List<? extends androidx.media3.exoplayer.source.chunk.MediaChunk>)(long playbackPositionUs, https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/androidx/media3/exoplayer/source/chunk/MediaChunk> queue)`

Evaluates whether `https://developer.android.com/reference/androidx/media3/exoplayer/source/chunk/MediaChunk`s should be removed from the back of the queue.
`abstract void` `https://developer.android.com/reference/androidx/media3/exoplayer/source/chunk/ChunkSource#maybeThrowError()()`

If the source is currently having difficulty providing chunks, then this method throws the underlying error.
`abstract void` `https://developer.android.com/reference/androidx/media3/exoplayer/source/chunk/ChunkSource#onChunkLoadCompleted(androidx.media3.exoplayer.source.chunk.Chunk)(https://developer.android.com/reference/androidx/media3/exoplayer/source/chunk/Chunk chunk)`

Called when the `https://developer.android.com/reference/androidx/media3/exoplayer/source/chunk/ChunkSampleStream` has finished loading a chunk obtained from this source.
`abstract boolean` `https://developer.android.com/reference/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)(
https://developer.android.com/reference/androidx/media3/exoplayer/source/chunk/Chunk chunk,
boolean cancelable,
https://developer.android.com/reference/androidx/media3/exoplayer/upstream/LoadErrorHandlingPolicy.LoadErrorInfo loadErrorInfo,
https://developer.android.com/reference/androidx/media3/exoplayer/upstream/LoadErrorHandlingPolicy loadErrorHandlingPolicy
)`

Called when the `https://developer.android.com/reference/androidx/media3/exoplayer/source/chunk/ChunkSampleStream` encounters an error loading a chunk obtained from this source.
`abstract void` `https://developer.android.com/reference/androidx/media3/exoplayer/source/chunk/ChunkSource#release()()`

Releases any held resources.
`abstract boolean` `https://developer.android.com/reference/androidx/media3/exoplayer/source/chunk/ChunkSource#shouldCancelLoad(long,androidx.media3.exoplayer.source.chunk.Chunk,java.util.List<? extends androidx.media3.exoplayer.source.chunk.MediaChunk>)(
long playbackPositionUs,
https://developer.android.com/reference/androidx/media3/exoplayer/source/chunk/Chunk loadingChunk,
https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/androidx/media3/exoplayer/source/chunk/MediaChunk> queue
)`

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

## Public methods

### getSelectedBaseUrl

```
default @Nullable BaseUrl getSelectedBaseUrl()
```

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

The default implementation returns `null`.

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

### updateManifest

```
abstract void updateManifest(DashManifest newManifest, int newPeriodIndex)
```

Updates the manifest.

| Parameters |
|---|---|
| `https://developer.android.com/reference/androidx/media3/exoplayer/dash/manifest/DashManifest newManifest` | The new manifest. |
| `int newPeriodIndex` | The index of the period covered by `newManifest`. |

### updateTrackSelection

```
abstract void updateTrackSelection(ExoTrackSelection trackSelection)
```

Updates the track selection.

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