# DefaultDashChunkSource

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

*** ** * ** ***


```
@UnstableApi
class DefaultDashChunkSource : DashChunkSource
```

<br />

*** ** * ** ***

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

## Summary

| ### Nested types |
|---|
| `class https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/DefaultDashChunkSource.Factory : https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/DashChunkSource.Factory` `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/DashChunkSource.Factory` for `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/DefaultDashChunkSource` instances. |
| `protected class https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/DefaultDashChunkSource.RepresentationHolder` Holds information about a snapshot of a single `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/Representation`. |
| `protected class https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/DefaultDashChunkSource.RepresentationSegmentIterator : https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/BaseMediaChunkIterator` `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/MediaChunkIterator` wrapping a `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/DefaultDashChunkSource.RepresentationHolder`. |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/DefaultDashChunkSource#DefaultDashChunkSource(androidx.media3.exoplayer.source.chunk.ChunkExtractor.Factory,androidx.media3.exoplayer.upstream.LoaderErrorThrower,androidx.media3.exoplayer.dash.manifest.DashManifest,androidx.media3.exoplayer.dash.BaseUrlExclusionList,int,int[],androidx.media3.exoplayer.trackselection.ExoTrackSelection,int,androidx.media3.datasource.DataSource,long,int,boolean,java.util.List<androidx.media3.common.Format>,androidx.media3.exoplayer.dash.PlayerEmsgHandler.PlayerTrackEmsgHandler,androidx.media3.exoplayer.analytics.PlayerId,androidx.media3.exoplayer.upstream.CmcdConfiguration,androidx.media3.exoplayer.dash.DashContentSteeringTracker)( chunkExtractorFactory: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/ChunkExtractor.Factory!, manifestLoaderErrorThrower: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/LoaderErrorThrower!, manifest: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/DashManifest!, baseUrlExclusionList: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/BaseUrlExclusionList!, periodIndex: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, adaptationSetIndices: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html>!, trackSelection: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/trackselection/ExoTrackSelection!, @https://developer.android.com/reference/kotlin/androidx/media3/common/C.TrackType trackType: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, dataSource: https://developer.android.com/reference/kotlin/androidx/media3/datasource/DataSource!, elapsedRealtimeOffsetMs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html, maxSegmentsPerLoad: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, enableEventMessageTrack: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html, closedCaptionFormats: (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/common/Format!>!, playerTrackEmsgHandler: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/PlayerEmsgHandler.PlayerTrackEmsgHandler?, playerId: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlayerId!, cmcdConfiguration: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/CmcdConfiguration?, contentSteeringTracker: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/DashContentSteeringTracker? )` |

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/DefaultDashChunkSource#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/dash/DefaultDashChunkSource#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/dash/DefaultDashChunkSource#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/dash/DefaultDashChunkSource#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/dash/DefaultDashChunkSource#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/dash/DefaultDashChunkSource#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/dash/DefaultDashChunkSource#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/dash/DefaultDashChunkSource#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. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/DefaultDashChunkSource#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/DefaultDashChunkSource#updateTrackSelection(androidx.media3.exoplayer.trackselection.ExoTrackSelection)(trackSelection: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/trackselection/ExoTrackSelection!)` Updates the track selection. |

| ### Protected functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/Chunk!` | `@https://checkerframework.org/api/org/checkerframework/checker/nullness/qual/RequiresNonNull.html(value = "#1.chunkExtractor") https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/DefaultDashChunkSource#newInitializationChunk(androidx.media3.exoplayer.dash.DefaultDashChunkSource.RepresentationHolder,androidx.media3.datasource.DataSource,androidx.media3.common.Format,int,java.lang.Object,androidx.media3.exoplayer.dash.manifest.RangedUri,androidx.media3.exoplayer.dash.manifest.RangedUri,androidx.media3.exoplayer.upstream.CmcdData.Factory)( representationHolder: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/DefaultDashChunkSource.RepresentationHolder!, dataSource: https://developer.android.com/reference/kotlin/androidx/media3/datasource/DataSource!, trackFormat: https://developer.android.com/reference/kotlin/androidx/media3/common/Format!, @https://developer.android.com/reference/kotlin/androidx/media3/common/C.SelectionReason trackSelectionReason: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, trackSelectionData: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?, initializationUri: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/RangedUri?, indexUri: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/RangedUri?, cmcdDataFactory: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/CmcdData.Factory? )` Creates a new `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/Chunk` for initialization. |
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/Chunk!` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/DefaultDashChunkSource#newMediaChunk(androidx.media3.exoplayer.dash.DefaultDashChunkSource.RepresentationHolder,androidx.media3.datasource.DataSource,int,androidx.media3.common.Format,int,java.lang.Object,long,int,long,long,androidx.media3.exoplayer.upstream.CmcdData.Factory)( representationHolder: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/DefaultDashChunkSource.RepresentationHolder!, dataSource: https://developer.android.com/reference/kotlin/androidx/media3/datasource/DataSource!, @https://developer.android.com/reference/kotlin/androidx/media3/common/C.TrackType trackType: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, trackFormat: https://developer.android.com/reference/kotlin/androidx/media3/common/Format!, @https://developer.android.com/reference/kotlin/androidx/media3/common/C.SelectionReason trackSelectionReason: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, trackSelectionData: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?, firstSegmentNum: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html, maxSegmentCount: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, seekTimeUs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html, nowPeriodTimeUs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html, cmcdDataFactory: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/CmcdData.Factory? )` |

| ### Public properties |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/BaseUrl?` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/DefaultDashChunkSource#selectedBaseUrl()` |

| ### Protected properties |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/DefaultDashChunkSource.RepresentationHolder!>!` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/DefaultDashChunkSource#representationHolders()` |

## Public constructors

### DefaultDashChunkSource

```
DefaultDashChunkSource(
    chunkExtractorFactory: ChunkExtractor.Factory!,
    manifestLoaderErrorThrower: LoaderErrorThrower!,
    manifest: DashManifest!,
    baseUrlExclusionList: BaseUrlExclusionList!,
    periodIndex: Int,
    adaptationSetIndices: IntArray<Int>!,
    trackSelection: ExoTrackSelection!,
    @C.TrackType trackType: Int,
    dataSource: DataSource!,
    elapsedRealtimeOffsetMs: Long,
    maxSegmentsPerLoad: Int,
    enableEventMessageTrack: Boolean,
    closedCaptionFormats: (Mutable)List<Format!>!,
    playerTrackEmsgHandler: PlayerEmsgHandler.PlayerTrackEmsgHandler?,
    playerId: PlayerId!,
    cmcdConfiguration: CmcdConfiguration?,
    contentSteeringTracker: DashContentSteeringTracker?
)
```

| Parameters |
|---|---|
| `chunkExtractorFactory: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/ChunkExtractor.Factory!` | Creates `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/ChunkExtractor` instances to use for extracting chunks. |
| `manifestLoaderErrorThrower: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/LoaderErrorThrower!` | Throws errors affecting loading of manifests. |
| `manifest: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/DashManifest!` | The initial manifest. |
| `baseUrlExclusionList: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/BaseUrlExclusionList!` | The base URL exclusion list. |
| `periodIndex: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The index of the period in the manifest. |
| `adaptationSetIndices: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html>!` | The indices of the adaptation sets in the period. |
| `trackSelection: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/trackselection/ExoTrackSelection!` | The track selection. |
| `@https://developer.android.com/reference/kotlin/androidx/media3/common/C.TrackType trackType: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The `https://developer.android.com/reference/kotlin/androidx/media3/common/C.TrackType` of the tracks in the selection. |
| `dataSource: https://developer.android.com/reference/kotlin/androidx/media3/datasource/DataSource!` | A `https://developer.android.com/reference/kotlin/androidx/media3/datasource/DataSource` suitable for loading the media data. |
| `elapsedRealtimeOffsetMs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | If known, an estimate of the instantaneous difference between server-side unix time and `https://developer.android.com/reference/android/os/SystemClock.html#elapsedRealtime()` in milliseconds, specified as the server's unix time minus the local elapsed time. Or `https://developer.android.com/reference/kotlin/androidx/media3/common/C#TIME_UNSET()` if unknown. |
| `maxSegmentsPerLoad: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The maximum number of segments to combine into a single request. Note that segments will only be combined if their `https://developer.android.com/reference/android/net/Uri.html`s are the same and if their data ranges are adjacent. |
| `enableEventMessageTrack: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | Whether to output an event message track. |
| `closedCaptionFormats: (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/common/Format!>!` | The `https://developer.android.com/reference/kotlin/androidx/media3/common/Format` of closed caption tracks to be output. |
| `playerTrackEmsgHandler: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/PlayerEmsgHandler.PlayerTrackEmsgHandler?` | The `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/PlayerEmsgHandler.PlayerTrackEmsgHandler` instance to handle emsg messages targeting the player. Maybe null if this is not necessary. |
| `playerId: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlayerId!` | The `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlayerId` of the player using this chunk source. |
| `cmcdConfiguration: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/CmcdConfiguration?` | The `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/CmcdConfiguration` for this chunk source. |
| `contentSteeringTracker: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/DashContentSteeringTracker?` | The `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/DashContentSteeringTracker` to use for Content Steering, or `null` if Content Steering is unavailable. |

## Public functions

### getAdjustedSeekPositionUs

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

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

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

| Returns |
|---|---|
| `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 `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 `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 `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/ChunkHolder` is not modified.

| Parameters |
|---|---|
| `loadingInfo: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/LoadingInfo!` | The `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/LoadingInfo` when loading request is made. |
| `loadPositionUs: 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 `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/Chunk#endTimeUs()` of the last chunk in the `queue`. |
| `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!>!` | The queue of buffered `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/MediaChunk`s. |
| `out: 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 `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/MediaChunk`s should be removed from the back of the queue.

Removing `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 `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/MediaChunk` in the queue is currently loading.

| Parameters |
|---|---|
| `playbackPositionUs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | The current playback position, in microseconds. |
| `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!>!` | The queue of buffered `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/MediaChunk`s. |

| Returns |
|---|---|
| `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 |
|---|---|
| `https://developer.android.com/reference/java/io/IOException.html` | The underlying error. |

### onChunkLoadCompleted

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

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

| Parameters |
|---|---|
| `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 `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/ChunkSampleStream` encounters an error loading a chunk obtained from this source.

| Parameters |
|---|---|
| `chunk: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/Chunk!` | The chunk whose load encountered the error. |
| `cancelable: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | Whether the load can be canceled. |
| `loadErrorInfo: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/LoadErrorHandlingPolicy.LoadErrorInfo!` | The load error info. |
| `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 |
|---|---|
| `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`, `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: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | The current playback position, in microseconds. |
| `loadingChunk: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/Chunk!` | The currently loading `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!>!` | The queue of buffered `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/MediaChunk`. |

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

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

## Protected functions

### newInitializationChunk

```
@RequiresNonNull(value = "#1.chunkExtractor")
protected fun newInitializationChunk(
    representationHolder: DefaultDashChunkSource.RepresentationHolder!,
    dataSource: DataSource!,
    trackFormat: Format!,
    @C.SelectionReason trackSelectionReason: Int,
    trackSelectionData: Any?,
    initializationUri: RangedUri?,
    indexUri: RangedUri?,
    cmcdDataFactory: CmcdData.Factory?
): Chunk!
```

Creates a new `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/Chunk` for initialization.

| Parameters |
|---|---|
| `representationHolder: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/DefaultDashChunkSource.RepresentationHolder!` | The `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/Representation` holder for initialization. |
| `dataSource: https://developer.android.com/reference/kotlin/androidx/media3/datasource/DataSource!` | The source from which the data should be loaded. |
| `trackFormat: https://developer.android.com/reference/kotlin/androidx/media3/common/Format!` | The format of the track to which this chunk belongs. |
| `@https://developer.android.com/reference/kotlin/androidx/media3/common/C.SelectionReason trackSelectionReason: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | One of the `https://developer.android.com/reference/kotlin/androidx/media3/common/C.SelectionReason`. |
| `trackSelectionData: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?` | Additional data related to track selection. |
| `initializationUri: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/RangedUri?` | The URI pointing to initialization data. Can be `null` if ` indexUri` is not `null`. |
| `indexUri: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/RangedUri?` | The URI pointing to index data. Can be `null` if ` initializationUri` is not `null`. |
| `cmcdDataFactory: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/CmcdData.Factory?` | The `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/CmcdData.Factory` for generating `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/CmcdData`. |

### newMediaChunk

```
protected fun newMediaChunk(
    representationHolder: DefaultDashChunkSource.RepresentationHolder!,
    dataSource: DataSource!,
    @C.TrackType trackType: Int,
    trackFormat: Format!,
    @C.SelectionReason trackSelectionReason: Int,
    trackSelectionData: Any?,
    firstSegmentNum: Long,
    maxSegmentCount: Int,
    seekTimeUs: Long,
    nowPeriodTimeUs: Long,
    cmcdDataFactory: CmcdData.Factory?
): Chunk!
```

## Public properties

### selectedBaseUrl

```
val selectedBaseUrl: BaseUrl?
```

## Protected properties

### representationHolders

```
protected val representationHolders: Array<DefaultDashChunkSource.RepresentationHolder!>!
```