Class DefaultDownloaderFactory
- java.lang.Object
-
- com.google.android.exoplayer2.offline.DefaultDownloaderFactory
-
- All Implemented Interfaces:
DownloaderFactory
public class DefaultDownloaderFactory extends Object implements DownloaderFactory
DefaultDownloaderFactory, 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.DefaultDownloaderFactory(CacheDataSource.Factory cacheDataSourceFactory, Executor executor)Creates an instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DownloadercreateDownloader(DownloadRequest request)Creates aDownloaderto perform the givenDownloadRequest.
-
-
-
Constructor Detail
-
DefaultDownloaderFactory
@Deprecated public DefaultDownloaderFactory(CacheDataSource.Factory cacheDataSourceFactory)
Deprecated.Creates an instance.- Parameters:
cacheDataSourceFactory- ACacheDataSource.Factoryfor the cache into which downloads will be written.
-
DefaultDownloaderFactory
public DefaultDownloaderFactory(CacheDataSource.Factory cacheDataSourceFactory, Executor executor)
Creates an instance.- Parameters:
cacheDataSourceFactory- ACacheDataSource.Factoryfor the cache into which downloads will be written.executor- AnExecutorused to download data. PassingRunnable::runwill cause each download task to download data on its own thread. Passing anExecutorthat 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:DownloaderFactoryCreates aDownloaderto perform the givenDownloadRequest.- Specified by:
createDownloaderin interfaceDownloaderFactory- Parameters:
request- The download request.- Returns:
- The downloader.
-
-