Back to Exoplayer

WritableDownloadIndex (ExoPlayer library)

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

latest6.0 KB
Original Source

Package com.google.android.exoplayer2.offline

Interface WritableDownloadIndex

  • All Superinterfaces:DownloadIndexAll Known Implementing Classes:DefaultDownloadIndex

@WorkerThread[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public interfaceWritableDownloadIndexextends[DownloadIndex](DownloadIndex.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 writable index of Downloads.

Method Summary

All Methods Instance Methods Abstract Methods Deprecated Methods | Modifier and Type | Method | Description | | --- | --- | --- | | void | putDownload​(Download download) | Deprecated.

Adds or replaces a Download. | | void | removeDownload​(String id) | Deprecated.

Removes the download with the given ID. | | void | setDownloadingStatesToQueued() | Deprecated.

Sets all Download.STATE_DOWNLOADING states to Download.STATE_QUEUED. | | void | setStatesToRemoving() | Deprecated.

Sets all states to Download.STATE_REMOVING. | | void | setStopReason​(int stopReason) | Deprecated.

Sets the stop reason of the downloads in a terminal state (Download.STATE_COMPLETED, Download.STATE_FAILED). | | void | setStopReason​(String id, int stopReason) | Deprecated.

Sets the stop reason of the download with the given ID in a terminal state (Download.STATE_COMPLETED, Download.STATE_FAILED). |

- 

Methods inherited from interface com.google.android.exoplayer2.offline.DownloadIndex

getDownload, getDownloads

Method Detail

- 

putDownload

void putDownload​([Download](Download.html "class in com.google.android.exoplayer2.offline")download)
          throws[IOException](https://developer.android.com/reference/java/io/IOException.html "class or interface in java.io")

Deprecated.

Adds or replaces a Download.

This method may be slow and shouldn't normally be called on the main thread.

Parameters:download - The Download to be added.Throws:IOException - If an error occurs setting the state.

- 

removeDownload

void removeDownload​([String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")id)
             throws[IOException](https://developer.android.com/reference/java/io/IOException.html "class or interface in java.io")

Deprecated.

Removes the download with the given ID. Does nothing if a download with the given ID does not exist.

This method may be slow and shouldn't normally be called on the main thread.

Parameters:id - The ID of the download to remove.Throws:IOException - If an error occurs removing the state.

- 

setDownloadingStatesToQueued

void setDownloadingStatesToQueued()
                           throws[IOException](https://developer.android.com/reference/java/io/IOException.html "class or interface in java.io")

Deprecated.

Sets all Download.STATE_DOWNLOADING states to Download.STATE_QUEUED.

This method may be slow and shouldn't normally be called on the main thread.

Throws:IOException - If an error occurs updating the state.

- 

setStatesToRemoving

void setStatesToRemoving()
                  throws[IOException](https://developer.android.com/reference/java/io/IOException.html "class or interface in java.io")

Deprecated.

Sets all states to Download.STATE_REMOVING.

This method may be slow and shouldn't normally be called on the main thread.

Throws:IOException - If an error occurs updating the state.

- 

setStopReason

void setStopReason​(int stopReason)
            throws[IOException](https://developer.android.com/reference/java/io/IOException.html "class or interface in java.io")

Deprecated.

Sets the stop reason of the downloads in a terminal state (Download.STATE_COMPLETED, Download.STATE_FAILED).

This method may be slow and shouldn't normally be called on the main thread.

Parameters:stopReason - The stop reason.Throws:IOException - If an error occurs updating the state.

- 

setStopReason

void setStopReason​([String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")id,
                   int stopReason)
            throws[IOException](https://developer.android.com/reference/java/io/IOException.html "class or interface in java.io")

Deprecated.

Sets the stop reason of the download with the given ID in a terminal state (Download.STATE_COMPLETED, Download.STATE_FAILED). Does nothing if a download with the given ID does not exist, or if it's not in a terminal state.

This method may be slow and shouldn't normally be called on the main thread.

Parameters:id - The ID of the download to update.stopReason - The stop reason.Throws:IOException - If an error occurs updating the state.