Class DownloadRequest
- java.lang.Object
-
- com.google.android.exoplayer2.offline.DownloadRequest
-
- All Implemented Interfaces:
Parcelable
@Deprecated public final class DownloadRequest extends Object implements Parcelable
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 mergingnewRequest
into this request.int
describeContents()
Deprecated.boolean
equals(Object o)
Deprecated.int
hashCode()
Deprecated.MediaItem
toMediaItem()
Deprecated.Returns aMediaItem
for the content defined by the request.String
toString()
Deprecated.void
writeToParcel(Parcel dest, int flags)
Deprecated.
-
-
-
Field Detail
-
id
public final String id
Deprecated.The unique content id.
-
uri
public final Uri uri
Deprecated.The uri being downloaded.
-
mimeType
@Nullable public final String mimeType
Deprecated.The MIME type of this content. Used as a hint to infer the content's type (DASH, HLS, SmoothStreaming). If null, aDownloadService
will infer the content type from theuri
.
-
streamKeys
public final List<StreamKey> 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 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<DownloadRequest> CREATOR
Deprecated.
-
-
Method Detail
-
copyWithId
public DownloadRequest copyWithId(String 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 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 copyWithMergedRequest(DownloadRequest newRequest)
Deprecated.Returns the result of mergingnewRequest
into this request. The requests must have the sameid
.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 sameid
.
-
toMediaItem
public MediaItem toMediaItem()
Deprecated.Returns aMediaItem
for the content defined by the request.
-
describeContents
public int describeContents()
Deprecated.- Specified by:
describeContents
in interfaceParcelable
-
writeToParcel
public void writeToParcel(Parcel dest, int flags)
Deprecated.- Specified by:
writeToParcel
in interfaceParcelable
-
-