# DefaultDashChunkSource.Factory

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.Factory)

*** ** * ** ***


```
class DefaultDashChunkSource.Factory : DashChunkSource.Factory
```

<br />

*** ** * ** ***

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

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/DefaultDashChunkSource.Factory#Factory(androidx.media3.datasource.DataSource.Factory)(dataSourceFactory: https://developer.android.com/reference/kotlin/androidx/media3/datasource/DataSource.Factory!)` Equivalent to `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/DefaultDashChunkSource.Factory#Factory(androidx.media3.exoplayer.source.chunk.ChunkExtractor.Factory,androidx.media3.datasource.DataSource.Factory,int)`. |
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/DefaultDashChunkSource.Factory#Factory(androidx.media3.datasource.DataSource.Factory,int)(dataSourceFactory: https://developer.android.com/reference/kotlin/androidx/media3/datasource/DataSource.Factory!, maxSegmentsPerLoad: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Equivalent to `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/DefaultDashChunkSource.Factory#Factory(androidx.media3.exoplayer.source.chunk.ChunkExtractor.Factory,androidx.media3.datasource.DataSource.Factory,int)`. |
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/DefaultDashChunkSource.Factory#Factory(androidx.media3.exoplayer.source.chunk.ChunkExtractor.Factory,androidx.media3.datasource.DataSource.Factory,int)( chunkExtractorFactory: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/ChunkExtractor.Factory!, dataSourceFactory: https://developer.android.com/reference/kotlin/androidx/media3/datasource/DataSource.Factory!, maxSegmentsPerLoad: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html )` Creates a new instance. |

| ### Public functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/DashChunkSource!` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/DefaultDashChunkSource.Factory#createDashChunkSource(androidx.media3.exoplayer.upstream.LoaderErrorThrower,androidx.media3.exoplayer.dash.manifest.DashManifest,androidx.media3.exoplayer.dash.BaseUrlExclusionList,int,int[],androidx.media3.exoplayer.trackselection.ExoTrackSelection,int,long,boolean,java.util.List<androidx.media3.common.Format>,androidx.media3.exoplayer.dash.PlayerEmsgHandler.PlayerTrackEmsgHandler,androidx.media3.datasource.TransferListener,androidx.media3.exoplayer.analytics.PlayerId,androidx.media3.exoplayer.upstream.CmcdConfiguration,androidx.media3.exoplayer.dash.DashContentSteeringTracker)( 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, elapsedRealtimeOffsetMs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/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!>!, playerEmsgHandler: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/PlayerEmsgHandler.PlayerTrackEmsgHandler?, transferListener: https://developer.android.com/reference/kotlin/androidx/media3/datasource/TransferListener?, 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? )` |
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/DefaultDashChunkSource.Factory!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/DefaultDashChunkSource.Factory#experimentalParseSubtitlesDuringExtraction(boolean)( parseSubtitlesDuringExtraction: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html )` Sets whether subtitles should be parsed as part of extraction (before being added to the sample queue) or as part of rendering (when being taken from the sample queue). |
| `https://developer.android.com/reference/kotlin/androidx/media3/common/Format!` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/DefaultDashChunkSource.Factory#getOutputTextFormat(androidx.media3.common.Format)(sourceFormat: https://developer.android.com/reference/kotlin/androidx/media3/common/Format!)` Returns the output of emitted C#TRACK_TYPE_TEXT text samples which were originally in sourceFormat}. |
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/DefaultDashChunkSource.Factory!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/DefaultDashChunkSource.Factory#setSubtitleParserFactory(androidx.media3.extractor.text.SubtitleParser.Factory)(subtitleParserFactory: https://developer.android.com/reference/kotlin/androidx/media3/extractor/text/SubtitleParser.Factory!)` Sets the `https://developer.android.com/reference/kotlin/androidx/media3/extractor/text/SubtitleParser.Factory` to use for parsing subtitles during extraction. |

## Public constructors

### Factory

```
Factory(dataSourceFactory: DataSource.Factory!)
```

Equivalent to `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/DefaultDashChunkSource.Factory#Factory(androidx.media3.exoplayer.source.chunk.ChunkExtractor.Factory,androidx.media3.datasource.DataSource.Factory,int)`.

### Factory

```
Factory(dataSourceFactory: DataSource.Factory!, maxSegmentsPerLoad: Int)
```

Equivalent to `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/DefaultDashChunkSource.Factory#Factory(androidx.media3.exoplayer.source.chunk.ChunkExtractor.Factory,androidx.media3.datasource.DataSource.Factory,int)`.

### Factory

```
Factory(
    chunkExtractorFactory: ChunkExtractor.Factory!,
    dataSourceFactory: DataSource.Factory!,
    maxSegmentsPerLoad: Int
)
```

Creates a new instance.

| 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. |
| `dataSourceFactory: https://developer.android.com/reference/kotlin/androidx/media3/datasource/DataSource.Factory!` | Creates the `https://developer.android.com/reference/kotlin/androidx/media3/datasource/DataSource` to use for downloading chunks. |
| `maxSegmentsPerLoad: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | See `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)`. |

## Public functions

### createDashChunkSource

```
fun createDashChunkSource(
    manifestLoaderErrorThrower: LoaderErrorThrower!,
    manifest: DashManifest!,
    baseUrlExclusionList: BaseUrlExclusionList!,
    periodIndex: Int,
    adaptationSetIndices: IntArray<Int>!,
    trackSelection: ExoTrackSelection!,
    @C.TrackType trackType: Int,
    elapsedRealtimeOffsetMs: Long,
    enableEventMessageTrack: Boolean,
    closedCaptionFormats: (Mutable)List<Format!>!,
    playerEmsgHandler: PlayerEmsgHandler.PlayerTrackEmsgHandler?,
    transferListener: TransferListener?,
    playerId: PlayerId!,
    cmcdConfiguration: CmcdConfiguration?,
    contentSteeringTracker: DashContentSteeringTracker?
): DashChunkSource!
```

| Parameters |
|---|---|
| `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 corresponding 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 corresponding 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`. |
| `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. |
| `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. |
| `playerEmsgHandler: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/PlayerEmsgHandler.PlayerTrackEmsgHandler?` | The track output to write emsg messages to, or null if emsgs shouldn't be written. |
| `transferListener: https://developer.android.com/reference/kotlin/androidx/media3/datasource/TransferListener?` | The transfer listener which should be informed of any data transfers. May be null if no listener is available. |
| `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. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/DashChunkSource!` | The created `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/DashChunkSource`. |

### experimentalParseSubtitlesDuringExtraction

```
@CanIgnoreReturnValue
fun experimentalParseSubtitlesDuringExtraction(
    parseSubtitlesDuringExtraction: Boolean
): DefaultDashChunkSource.Factory!
```

Sets whether subtitles should be parsed as part of extraction (before being added to the sample queue) or as part of rendering (when being taken from the sample queue). Defaults to `false` (i.e. subtitles will be parsed as part of rendering).

This method is experimental and will be renamed or removed in a future release.

| Parameters |
|---|---|
| `parseSubtitlesDuringExtraction: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | Whether to parse subtitles during extraction or rendering. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/DefaultDashChunkSource.Factory!` | This factory, for convenience. |

### getOutputTextFormat

```
fun getOutputTextFormat(sourceFormat: Format!): Format!
```

Returns the output of emitted C#TRACK_TYPE_TEXT text samples which were originally in sourceFormat}.

In many cases, where an emits samples from the source without mutation, this method simply returns sourceFormat}. In other cases, such as an that transcodes subtitles from the sourceFormat} to \* MimeTypes#APPLICATION_MEDIA3_CUES, the format is updated to indicate the transcoding that is taking place.

Non-text source formats are always returned without mutation.

This implementation delegates determining of the output format to the `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/ChunkExtractor.Factory` passed to the constructor of this class.

### setSubtitleParserFactory

```
@CanIgnoreReturnValue
fun setSubtitleParserFactory(subtitleParserFactory: SubtitleParser.Factory!): DefaultDashChunkSource.Factory!
```

Sets the `https://developer.android.com/reference/kotlin/androidx/media3/extractor/text/SubtitleParser.Factory` to use for parsing subtitles during extraction. The default factory value is implementation dependent.

| Parameters |
|---|---|
| `subtitleParserFactory: https://developer.android.com/reference/kotlin/androidx/media3/extractor/text/SubtitleParser.Factory!` | The `https://developer.android.com/reference/kotlin/androidx/media3/extractor/text/SubtitleParser.Factory` for parsing subtitles during extraction. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/DefaultDashChunkSource.Factory!` | This factory, for convenience. |