DefaultDownloaderFactory


@UnstableApi
public class DefaultDownloaderFactory 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.

Summary

Public constructors

DefaultDownloaderFactory(
    CacheDataSource.Factory cacheDataSourceFactory
)

This method is deprecated.

Use DefaultDownloaderFactory.

DefaultDownloaderFactory(
    CacheDataSource.Factory cacheDataSourceFactory,
    Executor executor
)

Creates an instance.

Public methods

Downloader

Creates a Downloader to perform the given DownloadRequest.

Public constructors

DefaultDownloaderFactory

public DefaultDownloaderFactory(
    CacheDataSource.Factory cacheDataSourceFactory
)

Creates an instance.

Parameters
CacheDataSource.Factory 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
CacheDataSource.Factory cacheDataSourceFactory

A CacheDataSource.Factory for the cache into which downloads will be written.

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

Public methods

createDownloader

public Downloader createDownloader(DownloadRequest request)

Creates a Downloader to perform the given DownloadRequest.

Parameters
DownloadRequest request

The download request.

Returns
Downloader

The downloader.