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

*** ** * ** ***


```
public final class DefaultDashChunkSource.Factory implements DashChunkSource.Factory
```

<br />

*** ** * ** ***

`https://developer.android.com/reference/androidx/media3/exoplayer/dash/DashChunkSource.Factory` for `https://developer.android.com/reference/androidx/media3/exoplayer/dash/DefaultDashChunkSource` instances.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/media3/exoplayer/dash/DefaultDashChunkSource.Factory#Factory(androidx.media3.datasource.DataSource.Factory)(https://developer.android.com/reference/androidx/media3/datasource/DataSource.Factory dataSourceFactory)` Equivalent to `https://developer.android.com/reference/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/androidx/media3/exoplayer/dash/DefaultDashChunkSource.Factory#Factory(androidx.media3.datasource.DataSource.Factory,int)(https://developer.android.com/reference/androidx/media3/datasource/DataSource.Factory dataSourceFactory, int maxSegmentsPerLoad)` Equivalent to `https://developer.android.com/reference/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/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/androidx/media3/exoplayer/source/chunk/ChunkExtractor.Factory chunkExtractorFactory, https://developer.android.com/reference/androidx/media3/datasource/DataSource.Factory dataSourceFactory, int maxSegmentsPerLoad )` Creates a new instance. |

| ### Public methods |
|---|---|
| `https://developer.android.com/reference/androidx/media3/exoplayer/dash/DashChunkSource` | `https://developer.android.com/reference/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)( https://developer.android.com/reference/androidx/media3/exoplayer/upstream/LoaderErrorThrower manifestLoaderErrorThrower, https://developer.android.com/reference/androidx/media3/exoplayer/dash/manifest/DashManifest manifest, https://developer.android.com/reference/androidx/media3/exoplayer/dash/BaseUrlExclusionList baseUrlExclusionList, int periodIndex, int[] adaptationSetIndices, https://developer.android.com/reference/androidx/media3/exoplayer/trackselection/ExoTrackSelection trackSelection, @https://developer.android.com/reference/androidx/media3/common/C.TrackType int trackType, long elapsedRealtimeOffsetMs, boolean enableEventMessageTrack, https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/androidx/media3/common/Format> closedCaptionFormats, @https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/androidx/media3/exoplayer/dash/PlayerEmsgHandler.PlayerTrackEmsgHandler playerEmsgHandler, @https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/androidx/media3/datasource/TransferListener transferListener, https://developer.android.com/reference/androidx/media3/exoplayer/analytics/PlayerId playerId, @https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/androidx/media3/exoplayer/upstream/CmcdConfiguration cmcdConfiguration, @https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/androidx/media3/exoplayer/dash/DashContentSteeringTracker contentSteeringTracker )` |
| `https://developer.android.com/reference/androidx/media3/exoplayer/dash/DefaultDashChunkSource.Factory` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/androidx/media3/exoplayer/dash/DefaultDashChunkSource.Factory#experimentalParseSubtitlesDuringExtraction(boolean)( boolean parseSubtitlesDuringExtraction )` 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/androidx/media3/common/Format` | `https://developer.android.com/reference/androidx/media3/exoplayer/dash/DefaultDashChunkSource.Factory#getOutputTextFormat(androidx.media3.common.Format)(https://developer.android.com/reference/androidx/media3/common/Format sourceFormat)` Returns the output of emitted C#TRACK_TYPE_TEXT text samples which were originally in sourceFormat}. |
| `https://developer.android.com/reference/androidx/media3/exoplayer/dash/DefaultDashChunkSource.Factory` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/androidx/media3/exoplayer/dash/DefaultDashChunkSource.Factory#setSubtitleParserFactory(androidx.media3.extractor.text.SubtitleParser.Factory)(https://developer.android.com/reference/androidx/media3/extractor/text/SubtitleParser.Factory subtitleParserFactory)` Sets the `https://developer.android.com/reference/androidx/media3/extractor/text/SubtitleParser.Factory` to use for parsing subtitles during extraction. |

## Public constructors

### Factory

```
public Factory(DataSource.Factory dataSourceFactory)
```

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

### Factory

```
public Factory(DataSource.Factory dataSourceFactory, int maxSegmentsPerLoad)
```

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

### Factory

```
public Factory(
    ChunkExtractor.Factory chunkExtractorFactory,
    DataSource.Factory dataSourceFactory,
    int maxSegmentsPerLoad
)
```

Creates a new instance.

| Parameters |
|---|---|
| `https://developer.android.com/reference/androidx/media3/exoplayer/source/chunk/ChunkExtractor.Factory chunkExtractorFactory` | Creates `https://developer.android.com/reference/androidx/media3/exoplayer/source/chunk/ChunkExtractor` instances to use for extracting chunks. |
| `https://developer.android.com/reference/androidx/media3/datasource/DataSource.Factory dataSourceFactory` | Creates the `https://developer.android.com/reference/androidx/media3/datasource/DataSource` to use for downloading chunks. |
| `int maxSegmentsPerLoad` | See `https://developer.android.com/reference/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 methods

### createDashChunkSource

```
public DashChunkSource createDashChunkSource(
    LoaderErrorThrower manifestLoaderErrorThrower,
    DashManifest manifest,
    BaseUrlExclusionList baseUrlExclusionList,
    int periodIndex,
    int[] adaptationSetIndices,
    ExoTrackSelection trackSelection,
    @C.TrackType int trackType,
    long elapsedRealtimeOffsetMs,
    boolean enableEventMessageTrack,
    List<Format> closedCaptionFormats,
    @Nullable PlayerEmsgHandler.PlayerTrackEmsgHandler playerEmsgHandler,
    @Nullable TransferListener transferListener,
    PlayerId playerId,
    @Nullable CmcdConfiguration cmcdConfiguration,
    @Nullable DashContentSteeringTracker contentSteeringTracker
)
```

| Parameters |
|---|---|
| `https://developer.android.com/reference/androidx/media3/exoplayer/upstream/LoaderErrorThrower manifestLoaderErrorThrower` | Throws errors affecting loading of manifests. |
| `https://developer.android.com/reference/androidx/media3/exoplayer/dash/manifest/DashManifest manifest` | The initial manifest. |
| `https://developer.android.com/reference/androidx/media3/exoplayer/dash/BaseUrlExclusionList baseUrlExclusionList` | The base URL exclusion list. |
| `int periodIndex` | The index of the corresponding period in the manifest. |
| `int[] adaptationSetIndices` | The indices of the corresponding adaptation sets in the period. |
| `https://developer.android.com/reference/androidx/media3/exoplayer/trackselection/ExoTrackSelection trackSelection` | The track selection. |
| `@https://developer.android.com/reference/androidx/media3/common/C.TrackType int trackType` | The `https://developer.android.com/reference/androidx/media3/common/C.TrackType`. |
| `long elapsedRealtimeOffsetMs` | 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/androidx/media3/common/C#TIME_UNSET()` if unknown. |
| `boolean enableEventMessageTrack` | Whether to output an event message track. |
| `https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/androidx/media3/common/Format> closedCaptionFormats` | The `https://developer.android.com/reference/androidx/media3/common/Format` of closed caption tracks to be output. |
| `@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/androidx/media3/exoplayer/dash/PlayerEmsgHandler.PlayerTrackEmsgHandler playerEmsgHandler` | The track output to write emsg messages to, or null if emsgs shouldn't be written. |
| `@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/androidx/media3/datasource/TransferListener transferListener` | The transfer listener which should be informed of any data transfers. May be null if no listener is available. |
| `https://developer.android.com/reference/androidx/media3/exoplayer/analytics/PlayerId playerId` | The `https://developer.android.com/reference/androidx/media3/exoplayer/analytics/PlayerId` of the player using this chunk source. |
| `@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/androidx/media3/exoplayer/upstream/CmcdConfiguration cmcdConfiguration` | The `https://developer.android.com/reference/androidx/media3/exoplayer/upstream/CmcdConfiguration` for this chunk source. |
| `@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/androidx/media3/exoplayer/dash/DashContentSteeringTracker contentSteeringTracker` | The `https://developer.android.com/reference/androidx/media3/exoplayer/dash/DashContentSteeringTracker` to use for Content Steering, or `null` if Content Steering is unavailable. |

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

### experimentalParseSubtitlesDuringExtraction

```
@CanIgnoreReturnValue
public DefaultDashChunkSource.Factory experimentalParseSubtitlesDuringExtraction(
    boolean parseSubtitlesDuringExtraction
)
```

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 |
|---|---|
| `boolean parseSubtitlesDuringExtraction` | Whether to parse subtitles during extraction or rendering. |

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

### getOutputTextFormat

```
public Format getOutputTextFormat(Format sourceFormat)
```

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/androidx/media3/exoplayer/source/chunk/ChunkExtractor.Factory` passed to the constructor of this class.

### setSubtitleParserFactory

```
@CanIgnoreReturnValue
public DefaultDashChunkSource.Factory setSubtitleParserFactory(SubtitleParser.Factory subtitleParserFactory)
```

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

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

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