# DashDownloader.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/offline/DashDownloader.java+class:androidx.media3.exoplayer.dash.offline.DashDownloader.Factory)

*** ** * ** ***


```
class DashDownloader.Factory : SegmentDownloader.BaseFactory<DashManifest!>
```

<br />

|---|---|---|
| [kotlin.Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html) |||
| ↳ | [androidx.media3.exoplayer.offline.SegmentDownloader.BaseFactory](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/SegmentDownloader.BaseFactory)\<[DashManifest](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/DashManifest)!\> ||
|   | ↳ | [androidx.media3.exoplayer.dash.offline.DashDownloader.Factory](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/offline/DashDownloader.Factory) |

*** ** * ** ***

A factory for `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/offline/DashDownloader`.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/offline/DashDownloader.Factory#Factory(androidx.media3.datasource.cache.CacheDataSource.Factory)(cacheDataSourceFactory: https://developer.android.com/reference/kotlin/androidx/media3/datasource/cache/CacheDataSource.Factory!)` Creates a factory for `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/offline/DashDownloader`. |

| ### Public functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/offline/DashDownloader!` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/offline/DashDownloader.Factory#create(androidx.media3.common.MediaItem)(mediaItem: https://developer.android.com/reference/kotlin/androidx/media3/common/MediaItem!)` Creates `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/offline/DashDownloader`. |
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/offline/DashDownloader.Factory!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/offline/DashDownloader.Factory#setDurationUs(long)(durationUs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)` Sets the duration in microseconds from the `startPositionUs` to be downloaded, or `https://developer.android.com/reference/kotlin/androidx/media3/common/C#TIME_UNSET()` if the media should be downloaded to the end. |
| `abstract https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/SegmentDownloaderFactory!` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/offline/DashDownloader.Factory#setDurationUs(long)(durationUs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)` Sets the duration in microseconds from the `startPositionUs` to be downloaded, or `https://developer.android.com/reference/kotlin/androidx/media3/common/C#TIME_UNSET()` if the media should be downloaded to the end. |
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/offline/DashDownloader.Factory!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/offline/DashDownloader.Factory#setExecutor(java.util.concurrent.Executor)(executor: https://developer.android.com/reference/java/util/concurrent/Executor.html!)` Sets the `https://developer.android.com/reference/java/util/concurrent/Executor.html` used to make requests for the media being downloaded. |
| `abstract https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/SegmentDownloaderFactory!` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/offline/DashDownloader.Factory#setExecutor(java.util.concurrent.Executor)(executor: https://developer.android.com/reference/java/util/concurrent/Executor.html!)` Sets the `https://developer.android.com/reference/java/util/concurrent/Executor.html` used to make requests for the media being downloaded. |
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/offline/DashDownloader.Factory!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/offline/DashDownloader.Factory#setManifestParser(androidx.media3.exoplayer.dash.manifest.DashManifestParser)(manifestParser: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/DashManifestParser!)` Sets a parser for DASH manifests. |
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/offline/DashDownloader.Factory!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/offline/DashDownloader.Factory#setMaxMergedSegmentStartTimeDiffMs(long)( maxMergedSegmentStartTimeDiffMs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html )` Sets the maximum difference of the start time of two segments, up to which the segments (of the same URI) should be merged into a single download segment, in milliseconds. |
| `abstract https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/SegmentDownloaderFactory!` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/offline/DashDownloader.Factory#setMaxMergedSegmentStartTimeDiffMs(long)( maxMergedSegmentStartTimeDiffMs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html )` Sets the maximum difference of the start time of two segments, up to which the segments (of the same URI) should be merged into a single download segment, in milliseconds. |
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/offline/DashDownloader.Factory!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/offline/DashDownloader.Factory#setStartPositionUs(long)(startPositionUs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)` Sets the start position in microseconds that the download should start from. |
| `abstract https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/SegmentDownloaderFactory!` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/offline/DashDownloader.Factory#setStartPositionUs(long)(startPositionUs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)` Sets the start position in microseconds that the download should start from. |

### Inherited properties

From [androidx.media3.exoplayer.offline.SegmentDownloader.BaseFactory](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/SegmentDownloader.BaseFactory) `https://developer.android.com/reference/kotlin/androidx/media3/datasource/cache/CacheDataSource.Factory!` `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/SegmentDownloader.BaseFactory#cacheDataSourceFactory()` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/SegmentDownloader.BaseFactory#durationUs()` `https://developer.android.com/reference/java/util/concurrent/Executor.html!` `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/SegmentDownloader.BaseFactory#executor()` `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/ParsingLoadable.Parser<M!>!` `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/SegmentDownloader.BaseFactory#manifestParser()` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/SegmentDownloader.BaseFactory#maxMergedSegmentStartTimeDiffMs()` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/SegmentDownloader.BaseFactory#startPositionUs()`

## Public constructors

### Factory

```
Factory(cacheDataSourceFactory: CacheDataSource.Factory!)
```

Creates a factory for `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/offline/DashDownloader`.

| Parameters |
|---|---|
| `cacheDataSourceFactory: https://developer.android.com/reference/kotlin/androidx/media3/datasource/cache/CacheDataSource.Factory!` | A `https://developer.android.com/reference/kotlin/androidx/media3/datasource/cache/CacheDataSource.Factory` for the cache into which the download will be written. |

## Public functions

### create

```
fun create(mediaItem: MediaItem!): DashDownloader!
```

Creates `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/offline/DashDownloader`.

### setDurationUs

```
@CanIgnoreReturnValue
fun setDurationUs(durationUs: Long): DashDownloader.Factory!
```

Sets the duration in microseconds from the `startPositionUs` to be downloaded, or `https://developer.android.com/reference/kotlin/androidx/media3/common/C#TIME_UNSET()` if the media should be downloaded to the end.

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

### setDurationUs

```
abstract fun setDurationUs(durationUs: Long): SegmentDownloaderFactory!
```

Sets the duration in microseconds from the `startPositionUs` to be downloaded, or `https://developer.android.com/reference/kotlin/androidx/media3/common/C#TIME_UNSET()` if the media should be downloaded to the end.

### setExecutor

```
@CanIgnoreReturnValue
fun setExecutor(executor: Executor!): DashDownloader.Factory!
```

Sets the `https://developer.android.com/reference/java/util/concurrent/Executor.html` used to make requests for the media being downloaded. Providing an `https://developer.android.com/reference/java/util/concurrent/Executor.html` that uses multiple threads will speed up the download by allowing parts of it to be executed in parallel.

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

### setExecutor

```
abstract fun setExecutor(executor: Executor!): SegmentDownloaderFactory!
```

Sets the `https://developer.android.com/reference/java/util/concurrent/Executor.html` used to make requests for the media being downloaded. Providing an `https://developer.android.com/reference/java/util/concurrent/Executor.html` that uses multiple threads will speed up the download by allowing parts of it to be executed in parallel.

### setManifestParser

```
@CanIgnoreReturnValue
fun setManifestParser(manifestParser: DashManifestParser!): DashDownloader.Factory!
```

Sets a parser for DASH manifests.

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

### setMaxMergedSegmentStartTimeDiffMs

```
@CanIgnoreReturnValue
fun setMaxMergedSegmentStartTimeDiffMs(
    maxMergedSegmentStartTimeDiffMs: Long
): DashDownloader.Factory!
```

Sets the maximum difference of the start time of two segments, up to which the segments (of the same URI) should be merged into a single download segment, in milliseconds.

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

### setMaxMergedSegmentStartTimeDiffMs

```
abstract fun setMaxMergedSegmentStartTimeDiffMs(
    maxMergedSegmentStartTimeDiffMs: Long
): SegmentDownloaderFactory!
```

Sets the maximum difference of the start time of two segments, up to which the segments (of the same URI) should be merged into a single download segment, in milliseconds.

### setStartPositionUs

```
@CanIgnoreReturnValue
fun setStartPositionUs(startPositionUs: Long): DashDownloader.Factory!
```

Sets the start position in microseconds that the download should start from.

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

### setStartPositionUs

```
abstract fun setStartPositionUs(startPositionUs: Long): SegmentDownloaderFactory!
```

Sets the start position in microseconds that the download should start from.