Back to Exoplayer

DownloadIndex (ExoPlayer library)

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

latest3.5 KB
Original Source

Package com.google.android.exoplayer2.offline

Interface DownloadIndex

  • All Known Subinterfaces:WritableDownloadIndexAll Known Implementing Classes:DefaultDownloadIndex

@WorkerThread[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public interfaceDownloadIndex

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.

An index of Downloads.

Method Summary

All Methods Instance Methods Abstract Methods Deprecated Methods | Modifier and Type | Method | Description | | --- | --- | --- | | Download | getDownload​(String id) | Deprecated.

Returns the Download with the given id, or null. | | DownloadCursor | getDownloads​(@com.google.android.exoplayer2.offline.Download.State int... states) | Deprecated.

Returns a DownloadCursor to Downloads with the given states. |

Method Detail

- 

getDownload

@Nullable[Download](Download.html "class in com.google.android.exoplayer2.offline")getDownload​([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.

Returns the Download with the given id, or null.

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

Parameters:id - ID of a Download.Returns:The Download with the given id, or null if a download state with this id doesn't exist.Throws:IOException - If an error occurs reading the state.

- 

getDownloads

[DownloadCursor](DownloadCursor.html "interface in com.google.android.exoplayer2.offline")getDownloads​([@State](Download.State.html "annotation in com.google.android.exoplayer2.offline")@com.google.android.exoplayer2.offline.Download.State int... states)
                     throws[IOException](https://developer.android.com/reference/java/io/IOException.html "class or interface in java.io")

Deprecated.

Returns a DownloadCursor to Downloads with the given states.

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

Parameters:states - Returns only the Downloads with this states. If empty, returns all.Returns:A cursor to Downloads with the given states.Throws:IOException - If an error occurs reading the state.