# DefaultDownloaderFactory

Artifact: [androidx.media3:media3-exoplayer](https://developer.android.com/jetpack/androidx/releases/media3) [View Source](https://cs.android.com/search?q=file:androidx/media3/exoplayer/offline/DefaultDownloaderFactory.java+class:androidx.media3.exoplayer.offline.DefaultDownloaderFactory)

*** ** * ** ***


```
@UnstableApi
public class DefaultDownloaderFactory implements DownloaderFactory
```

<br />

*** ** * ** ***

Default `https://developer.android.com/reference/androidx/media3/exoplayer/offline/DownloaderFactory`, supporting creation of progressive, DASH, HLS and SmoothStreaming downloaders. Note that for the latter three, the corresponding library module must be built into the application.

## Summary

| ### Public constructors |
|---|
| `[DefaultDownloaderFactory](https://developer.android.com/reference/androidx/media3/exoplayer/offline/DefaultDownloaderFactory#DefaultDownloaderFactory(androidx.media3.datasource.cache.CacheDataSource.Factory))( https://developer.android.com/reference/androidx/media3/datasource/cache/CacheDataSource.Factory cacheDataSourceFactory )` **This method is deprecated.** Use `https://developer.android.com/reference/androidx/media3/exoplayer/offline/DefaultDownloaderFactory#DefaultDownloaderFactory(androidx.media3.datasource.cache.CacheDataSource.Factory,java.util.concurrent.Executor)`. <br /> |
| `https://developer.android.com/reference/androidx/media3/exoplayer/offline/DefaultDownloaderFactory#DefaultDownloaderFactory(androidx.media3.datasource.cache.CacheDataSource.Factory,java.util.concurrent.Executor)( https://developer.android.com/reference/androidx/media3/datasource/cache/CacheDataSource.Factory cacheDataSourceFactory, https://developer.android.com/reference/java/util/concurrent/Executor.html executor )` Creates an instance. |

| ### Public methods |
|---|---|
| `https://developer.android.com/reference/androidx/media3/exoplayer/offline/Downloader` | `https://developer.android.com/reference/androidx/media3/exoplayer/offline/DefaultDownloaderFactory#createDownloader(androidx.media3.exoplayer.offline.DownloadRequest)(https://developer.android.com/reference/androidx/media3/exoplayer/offline/DownloadRequest request)` Creates a `https://developer.android.com/reference/androidx/media3/exoplayer/offline/Downloader` to perform the given `https://developer.android.com/reference/androidx/media3/exoplayer/offline/DownloadRequest`. |

## Public constructors

### DefaultDownloaderFactory

```
public [DefaultDownloaderFactory](https://developer.android.com/reference/androidx/media3/exoplayer/offline/DefaultDownloaderFactory#DefaultDownloaderFactory(androidx.media3.datasource.cache.CacheDataSource.Factory))(
    CacheDataSource.Factory cacheDataSourceFactory
)
```

> [!CAUTION]
> **This method is deprecated.**   
>
> Use `https://developer.android.com/reference/androidx/media3/exoplayer/offline/DefaultDownloaderFactory#DefaultDownloaderFactory(androidx.media3.datasource.cache.CacheDataSource.Factory,java.util.concurrent.Executor)`.

Creates an instance.

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

### DefaultDownloaderFactory

```
public DefaultDownloaderFactory(
    CacheDataSource.Factory cacheDataSourceFactory,
    Executor executor
)
```

Creates an instance.

| Parameters |
|---|---|
| `https://developer.android.com/reference/androidx/media3/datasource/cache/CacheDataSource.Factory cacheDataSourceFactory` | A `https://developer.android.com/reference/androidx/media3/datasource/cache/CacheDataSource.Factory` for the cache into which downloads will be written. |
| `https://developer.android.com/reference/java/util/concurrent/Executor.html executor` | An `https://developer.android.com/reference/java/util/concurrent/Executor.html` used to download data. Passing `Runnable::run` will cause each download task to download data on its own thread. Passing an `https://developer.android.com/reference/java/util/concurrent/Executor.html` that uses multiple threads will speed up download tasks that can be split into smaller parts for parallel execution. |

## Public methods

### createDownloader

```
public Downloader createDownloader(DownloadRequest request)
```

Creates a `https://developer.android.com/reference/androidx/media3/exoplayer/offline/Downloader` to perform the given `https://developer.android.com/reference/androidx/media3/exoplayer/offline/DownloadRequest`.

| Parameters |
|---|---|
| `https://developer.android.com/reference/androidx/media3/exoplayer/offline/DownloadRequest request` | The download request. |

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/media3/exoplayer/offline/Downloader` | The downloader. |