Back to Exoplayer

DownloadRequest (ExoPlayer library)

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

latest8.4 KB
Original Source

Package com.google.android.exoplayer2.offline

Class DownloadRequest

  • java.lang.Object

    • com.google.android.exoplayer2.offline.DownloadRequest
  • All Implemented Interfaces:Parcelable


[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public final classDownloadRequestextends[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")implements[Parcelable](https://developer.android.com/reference/android/os/Parcelable.html "class or interface in android.os")

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.

Defines content to be downloaded.

Nested Class Summary

Nested Classes | Modifier and Type | Class | Description | | --- | --- | --- | | static class | DownloadRequest.Builder | Deprecated.

A builder for download requests. | | static class | DownloadRequest.UnsupportedRequestException | Deprecated.

Thrown when the encoded request data belongs to an unsupported request type. |

- 

Nested classes/interfaces inherited from interface android.os.Parcelable

Parcelable.ClassLoaderCreator<T extends Object>, Parcelable.Creator<T extends Object>

Field Summary

Fields | Modifier and Type | Field | Description | | --- | --- | --- | | static Parcelable.Creator<DownloadRequest> | CREATOR | Deprecated. | | String | customCacheKey | Deprecated.

Custom key for cache indexing, or null. | | byte[] | data | Deprecated.

Application defined data associated with the download. | | String | id | Deprecated.

The unique content id. | | byte[] | keySetId | Deprecated.

The key set id of the offline licence if the content is protected with DRM. | | String | mimeType | Deprecated.

The MIME type of this content. | | List<StreamKey> | streamKeys | Deprecated.

Stream keys to be downloaded. | | Uri | uri | Deprecated.

The uri being downloaded. |

- 

Fields inherited from interface android.os.Parcelable

CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE

Method Summary

All Methods Instance Methods Concrete Methods Deprecated Methods | Modifier and Type | Method | Description | | --- | --- | --- | | DownloadRequest | copyWithId​(String id) | Deprecated.

Returns a copy with the specified ID. | | DownloadRequest | copyWithKeySetId​(byte[] keySetId) | Deprecated.

Returns a copy with the specified key set ID. | | DownloadRequest | copyWithMergedRequest​(DownloadRequest newRequest) | Deprecated.

Returns the result of merging newRequest into this request. | | int | describeContents() | Deprecated. | | boolean | equals​(Object o) | Deprecated. | | int | hashCode() | Deprecated. | | MediaItem | toMediaItem() | Deprecated.

Returns a MediaItem for the content defined by the request. | | String | toString() | Deprecated. | | void | writeToParcel​(Parcel dest, int flags) | Deprecated. |

- 

Methods inherited from class java.lang.Object

clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Field Detail

- 

id

public final[String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")id

Deprecated.

The unique content id.

- 

uri

public final[Uri](https://developer.android.com/reference/android/net/Uri.html "class or interface in android.net")uri

Deprecated.

The uri being downloaded.

- 

mimeType

@Nullable
public final[String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")mimeType

Deprecated.

The MIME type of this content. Used as a hint to infer the content's type (DASH, HLS, SmoothStreaming). If null, a DownloadService will infer the content type from the uri.

- 

streamKeys

public final[List](https://developer.android.com/reference/java/util/List.html "class or interface in java.util")<[StreamKey](StreamKey.html "class in com.google.android.exoplayer2.offline")> streamKeys

Deprecated.

Stream keys to be downloaded. If empty, all streams will be downloaded.

- 

keySetId

@Nullable
public final byte[] keySetId

Deprecated.

The key set id of the offline licence if the content is protected with DRM.

- 

customCacheKey

@Nullable
public final[String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")customCacheKey

Deprecated.

Custom key for cache indexing, or null. Must be null for DASH, HLS and SmoothStreaming downloads.

- 

data

public final byte[] data

Deprecated.

Application defined data associated with the download. May be empty.

- 

CREATOR

public static final[Parcelable.Creator](https://developer.android.com/reference/android/os/Parcelable.Creator.html "class or interface in android.os")<[DownloadRequest](DownloadRequest.html "class in com.google.android.exoplayer2.offline")> CREATOR

Deprecated.

Method Detail

- 

copyWithId

public[DownloadRequest](DownloadRequest.html "class in com.google.android.exoplayer2.offline")copyWithId​([String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")id)

Deprecated.

Returns a copy with the specified ID. Parameters:id - The ID of the copy.Returns:The copy with the specified ID.

- 

copyWithKeySetId

public[DownloadRequest](DownloadRequest.html "class in com.google.android.exoplayer2.offline")copyWithKeySetId​(@Nullable
                                        byte[] keySetId)

Deprecated.

Returns a copy with the specified key set ID. Parameters:keySetId - The key set ID of the copy.Returns:The copy with the specified key set ID.

- 

copyWithMergedRequest

public[DownloadRequest](DownloadRequest.html "class in com.google.android.exoplayer2.offline")copyWithMergedRequest​([DownloadRequest](DownloadRequest.html "class in com.google.android.exoplayer2.offline")newRequest)

Deprecated.

Returns the result of merging newRequest into this request. The requests must have the same id.

The resulting request contains the stream keys from both requests. For all other member variables, those in newRequest are preferred.

Parameters:newRequest - The request being merged.Returns:The merged result.Throws:IllegalArgumentException - If the requests do not have the same id.

- 

toMediaItem

public[MediaItem](../MediaItem.html "class in com.google.android.exoplayer2")toMediaItem()

Deprecated.

Returns a MediaItem for the content defined by the request.

- 

toString

public[String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")toString()

Deprecated. Overrides:toString in class Object

- 

equals

public boolean equals​(@Nullable[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")o)

Deprecated. Overrides:equals in class Object

- 

hashCode

public final int hashCode()

Deprecated. Overrides:hashCode in class Object

- 

describeContents

public int describeContents()

Deprecated. Specified by:describeContents in interface Parcelable

- 

writeToParcel

public void writeToParcel​([Parcel](https://developer.android.com/reference/android/os/Parcel.html "class or interface in android.os")dest,
                          int flags)

Deprecated. Specified by:writeToParcel in interface Parcelable