docs/doc/reference/com/google/android/exoplayer2/offline/Download.html
Package com.google.android.exoplayer2.offline
[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public final classDownloadextends[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")
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.
Represents state of a download.
Nested Classes | Modifier and Type | Class | Description |
| --- | --- | --- |
| static interface | Download.FailureReason |
Deprecated.
Failure reasons.
|
| static interface | Download.State |
Deprecated.
Download states. |
Fields | Modifier and Type | Field | Description |
| --- | --- | --- |
| long | contentLength |
Deprecated.
The total size of the content in bytes, or C.LENGTH_UNSET if unknown.
|
| static int | FAILURE_REASON_NONE |
Deprecated.
The download isn't failed.
|
| static int | FAILURE_REASON_UNKNOWN |
Deprecated.
The download is failed because of unknown reason.
|
| @com.google.android.exoplayer2.offline.Download.FailureReason int | failureReason |
Deprecated.
If state is STATE_FAILED then this is the cause, otherwise FAILURE_REASON_NONE.
|
| DownloadRequest | request |
Deprecated.
The download request.
|
| long | startTimeMs |
Deprecated.
The first time when download entry is created.
|
| @com.google.android.exoplayer2.offline.Download.State int | state |
Deprecated.
The state of the download.
|
| static int | STATE_COMPLETED |
Deprecated.
The download completed.
|
| static int | STATE_DOWNLOADING |
Deprecated.
The download is currently started.
|
| static int | STATE_FAILED |
Deprecated.
The download failed.
|
| static int | STATE_QUEUED |
Deprecated.
The download is waiting to be started.
|
| static int | STATE_REMOVING |
Deprecated.
The download is being removed.
|
| static int | STATE_RESTARTING |
Deprecated.
The download will restart after all downloaded data is removed.
|
| static int | STATE_STOPPED |
Deprecated.
The download is stopped for a specified stopReason.
|
| static int | STOP_REASON_NONE |
Deprecated.
The download isn't stopped.
|
| int | stopReason |
Deprecated.
The reason the download is stopped, or STOP_REASON_NONE.
|
| long | updateTimeMs |
Deprecated.
The last update time. |
Constructors | Constructor | Description |
| --- | --- |
| Download(DownloadRequest request, @com.google.android.exoplayer2.offline.Download.State int state, long startTimeMs, long updateTimeMs, long contentLength, int stopReason, @com.google.android.exoplayer2.offline.Download.FailureReason int failureReason) |
Deprecated.
|
| Download(DownloadRequest request, @com.google.android.exoplayer2.offline.Download.State int state, long startTimeMs, long updateTimeMs, long contentLength, int stopReason, @com.google.android.exoplayer2.offline.Download.FailureReason int failureReason, DownloadProgress progress) |
Deprecated.
|
All Methods Instance Methods Concrete Methods Deprecated Methods | Modifier and Type | Method | Description |
| --- | --- | --- |
| long | getBytesDownloaded() |
Deprecated.
Returns the total number of downloaded bytes.
|
| float | getPercentDownloaded() |
Deprecated.
Returns the estimated download percentage, or C.PERCENTAGE_UNSET if no estimate is available.
|
| boolean | isTerminalState() |
Deprecated.
Returns whether the download is completed or failed. |
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
public static final int STATE_QUEUED
Deprecated.
The download is waiting to be started. A download may be queued because the DownloadManager
- Is DownloadManager#getDownloadsPaused() paused
- Has DownloadManager#getRequirements() Requirements that are not met
- Has already started DownloadManager#getMaxParallelDownloads() maxParallelDownloads
See Also:Constant Field Values
-
public static final int STATE_STOPPED
Deprecated.
The download is stopped for a specified stopReason.
See Also:Constant Field Values
-
public static final int STATE_DOWNLOADING
Deprecated.
The download is currently started. See Also:Constant Field Values
-
public static final int STATE_COMPLETED
Deprecated.
The download completed. See Also:Constant Field Values
-
public static final int STATE_FAILED
Deprecated.
The download failed. See Also:Constant Field Values
-
public static final int STATE_REMOVING
Deprecated.
The download is being removed. See Also:Constant Field Values
-
public static final int STATE_RESTARTING
Deprecated.
The download will restart after all downloaded data is removed. See Also:Constant Field Values
-
public static final int FAILURE_REASON_NONE
Deprecated.
The download isn't failed. See Also:Constant Field Values
-
public static final int FAILURE_REASON_UNKNOWN
Deprecated.
The download is failed because of unknown reason. See Also:Constant Field Values
-
public static final int STOP_REASON_NONE
Deprecated.
The download isn't stopped. See Also:Constant Field Values
-
public final[DownloadRequest](DownloadRequest.html "class in com.google.android.exoplayer2.offline")request
Deprecated.
The download request.
-
[@State](Download.State.html "annotation in com.google.android.exoplayer2.offline")public final @com.google.android.exoplayer2.offline.Download.State int state
Deprecated.
The state of the download.
-
public final long startTimeMs
Deprecated.
The first time when download entry is created.
-
public final long updateTimeMs
Deprecated.
The last update time.
-
public final long contentLength
Deprecated.
The total size of the content in bytes, or C.LENGTH_UNSET if unknown.
-
public final int stopReason
Deprecated.
The reason the download is stopped, or STOP_REASON_NONE.
-
[@FailureReason](Download.FailureReason.html "annotation in com.google.android.exoplayer2.offline")public final @com.google.android.exoplayer2.offline.Download.FailureReason int failureReason
Deprecated.
If state is STATE_FAILED then this is the cause, otherwise FAILURE_REASON_NONE.
-
public Download([DownloadRequest](DownloadRequest.html "class in com.google.android.exoplayer2.offline")request,[@State](Download.State.html "annotation in com.google.android.exoplayer2.offline")@com.google.android.exoplayer2.offline.Download.State int state,
long startTimeMs,
long updateTimeMs,
long contentLength,
int stopReason,[@FailureReason](Download.FailureReason.html "annotation in com.google.android.exoplayer2.offline")@com.google.android.exoplayer2.offline.Download.FailureReason int failureReason)
Deprecated.
-
public Download([DownloadRequest](DownloadRequest.html "class in com.google.android.exoplayer2.offline")request,[@State](Download.State.html "annotation in com.google.android.exoplayer2.offline")@com.google.android.exoplayer2.offline.Download.State int state,
long startTimeMs,
long updateTimeMs,
long contentLength,
int stopReason,[@FailureReason](Download.FailureReason.html "annotation in com.google.android.exoplayer2.offline")@com.google.android.exoplayer2.offline.Download.FailureReason int failureReason,[DownloadProgress](DownloadProgress.html "class in com.google.android.exoplayer2.offline")progress)
Deprecated.
-
public boolean isTerminalState()
Deprecated.
Returns whether the download is completed or failed. These are terminal states.
-
public long getBytesDownloaded()
Deprecated.
Returns the total number of downloaded bytes.
-
public float getPercentDownloaded()
Deprecated.
Returns the estimated download percentage, or C.PERCENTAGE_UNSET if no estimate is available.