Package com.google.android.exoplayer2.offline

## Class DefaultDownloaderFactory

- java.lang.Object
- - com.google.android.exoplayer2.offline.DefaultDownloaderFactory

- All Implemented Interfaces:
    `DownloaderFactory`

      public class DefaultDownloaderFactory
      extends Object
      implements DownloaderFactory

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

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `DefaultDownloaderFactory​(CacheDataSource.Factory cacheDataSourceFactory)` | Deprecated. Use `DefaultDownloaderFactory(CacheDataSource.Factory, Executor)`.
    `DefaultDownloaderFactory​(CacheDataSource.Factory cacheDataSourceFactory, Executor executor)` | Creates an instance.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `Downloader` | `createDownloader​(DownloadRequest request)` | Creates a `Downloader` to perform the given `DownloadRequest`.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### DefaultDownloaderFactory

          @Deprecated
          public DefaultDownloaderFactory​(CacheDataSource.Factory cacheDataSourceFactory)

      Deprecated.
      Use `DefaultDownloaderFactory(CacheDataSource.Factory, Executor)`.
      Creates an instance.
      Parameters:
        `cacheDataSourceFactory` - A `CacheDataSource.Factory` for the cache into which downloads will be written.

    - #### DefaultDownloaderFactory

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

      Creates an instance.
      Parameters:
        `cacheDataSourceFactory` - A `CacheDataSource.Factory` for the cache into which downloads will be written.
        `executor` - An `Executor` used to download data. Passing `Runnable::run` will cause each download task to download data on its own thread. Passing an `Executor` that uses multiple threads will speed up download tasks that can be split into smaller parts for parallel execution.

  - ### Method Detail

    - #### createDownloader

          public Downloader createDownloader​(DownloadRequest request)

      Description copied from interface: `DownloaderFactory`
      Creates a `Downloader` to perform the given `DownloadRequest`.
      Specified by:
        `createDownloader` in interface `DownloaderFactory`
      Parameters:
        `request` - The action.
      Returns:
        The downloader.