Back to Exoplayer

ProgressiveDownloader (ExoPlayer library)

docs/doc/reference/com/google/android/exoplayer2/offline/ProgressiveDownloader.html

latest6.5 KB
Original Source

Package com.google.android.exoplayer2.offline

Class ProgressiveDownloader

  • java.lang.Object

    • com.google.android.exoplayer2.offline.ProgressiveDownloader
  • All Implemented Interfaces:Downloader


[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public final classProgressiveDownloaderextends[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")implements[Downloader](Downloader.html "interface in com.google.android.exoplayer2.offline")

Deprecated. com.google.android.exoplayer2 is deprecated. Please migrate to androidx.media3 (which contains the same ExoPlayer code). See the migration guide for more details, including a script to help with the migration.

A downloader for progressive media streams.

Nested Class Summary

- 

Nested classes/interfaces inherited from interface com.google.android.exoplayer2.offline.Downloader

Downloader.ProgressListener

Constructor Summary

Constructors | Constructor | Description | | --- | --- | | ProgressiveDownloader​(MediaItem mediaItem, CacheDataSource.Factory cacheDataSourceFactory) | Deprecated.

Creates a new instance. | | ProgressiveDownloader​(MediaItem mediaItem, CacheDataSource.Factory cacheDataSourceFactory, Executor executor) | Deprecated.

Creates a new instance. |

Method Summary

All Methods Instance Methods Concrete Methods Deprecated Methods | Modifier and Type | Method | Description | | --- | --- | --- | | void | cancel() | Deprecated.

Permanently cancels the downloading by this downloader. | | void | download​(Downloader.ProgressListener progressListener) | Deprecated.

Downloads the content. | | void | remove() | Deprecated.

Removes the content. |

- 

Methods inherited from class java.lang.Object

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

Constructor Detail

- 

ProgressiveDownloader

public ProgressiveDownloader​([MediaItem](../MediaItem.html "class in com.google.android.exoplayer2")mediaItem,[CacheDataSource.Factory](../upstream/cache/CacheDataSource.Factory.html "class in com.google.android.exoplayer2.upstream.cache")cacheDataSourceFactory)

Deprecated.

Creates a new instance. Parameters:mediaItem - The media item with a uri to the stream to be downloaded.cacheDataSourceFactory - A CacheDataSource.Factory for the cache into which the download will be written.

- 

ProgressiveDownloader

public ProgressiveDownloader​([MediaItem](../MediaItem.html "class in com.google.android.exoplayer2")mediaItem,[CacheDataSource.Factory](../upstream/cache/CacheDataSource.Factory.html "class in com.google.android.exoplayer2.upstream.cache")cacheDataSourceFactory,[Executor](https://developer.android.com/reference/java/util/concurrent/Executor.html "class or interface in java.util.concurrent")executor)

Deprecated.

Creates a new instance. Parameters:mediaItem - The media item with a uri to the stream to be downloaded.cacheDataSourceFactory - A CacheDataSource.Factory for the cache into which the download will be written.executor - An Executor used to make requests for the media being downloaded. In the future, providing an Executor that uses multiple threads may speed up the download by allowing parts of it to be executed in parallel.

Method Detail

- 

download

public void download​(@Nullable[Downloader.ProgressListener](Downloader.ProgressListener.html "interface in com.google.android.exoplayer2.offline")progressListener)
              throws[IOException](https://developer.android.com/reference/java/io/IOException.html "class or interface in java.io"),[InterruptedException](https://developer.android.com/reference/java/lang/InterruptedException.html "class or interface in java.lang")

Deprecated.

Description copied from interface: Downloader

Downloads the content.

If downloading fails, this method can be called again to resume the download. It cannot be called again after the download has been canceled.

If downloading is canceled whilst this method is executing, then it is expected that it will return reasonably quickly. However, there are no guarantees about how the method will return, meaning that it can return without throwing, or by throwing any of its documented exceptions. The caller must use its own knowledge about whether downloading has been canceled to determine whether this is why the method has returned, rather than relying on the method returning in a particular way.

Specified by:download in interface DownloaderParameters:progressListener - A listener to receive progress updates, or null.Throws:IOException - If the download failed to complete successfully.InterruptedException - If the download was interrupted.

- 

cancel

public void cancel()

Deprecated.

Description copied from interface: Downloader

Permanently cancels the downloading by this downloader. The caller should also interrupt the downloading thread immediately after calling this method.

Once canceled, Downloader.download(com.google.android.exoplayer2.offline.Downloader.ProgressListener) cannot be called again.

Specified by:cancel in interface Downloader

- 

remove

public void remove()

Deprecated.

Description copied from interface: Downloader

Removes the content. Specified by:remove in interface Downloader