DefaultDownloaderFactory


@UnstableApi
class DefaultDownloaderFactory : 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(
    cacheDataSourceFactory: CacheDataSource.Factory!
)

This function is deprecated.

Use DefaultDownloaderFactory.

DefaultDownloaderFactory(
    cacheDataSourceFactory: CacheDataSource.Factory!,
    executor: Executor!
)

Creates an instance.

Public functions

Downloader!

Creates a Downloader to perform the given DownloadRequest.

Public constructors

DefaultDownloaderFactory

DefaultDownloaderFactory(
    cacheDataSourceFactory: CacheDataSource.Factory!
)

Creates an instance.

Parameters
cacheDataSourceFactory: CacheDataSource.Factory!

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

DefaultDownloaderFactory

DefaultDownloaderFactory(
    cacheDataSourceFactory: CacheDataSource.Factory!,
    executor: Executor!
)

Creates an instance.

Parameters
cacheDataSourceFactory: CacheDataSource.Factory!

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 functions

createDownloader

fun createDownloader(request: DownloadRequest!): Downloader!

Creates a Downloader to perform the given DownloadRequest.

Parameters
request: DownloadRequest!

The download request.

Returns
Downloader!

The downloader.