DownloadRequest
@UnstableApi
class DownloadRequest : Parcelable
Defines content to be downloaded.
Summary
Nested types |
|---|
class DownloadRequest.BuilderA builder for download requests. |
class DownloadRequest.ByteRange : ParcelableDefines the byte range. |
class DownloadRequest.TimeRange : ParcelableDefines the time range. |
|
Thrown when the encoded request data belongs to an unsupported request type. |
Constants |
|
|---|---|
const Parcelable.Creator<DownloadRequest!>! |
Public functions |
|
|---|---|
DownloadRequest! |
copyWithId(id: String!)Returns a copy with the specified ID. |
DownloadRequest! |
copyWithKeySetId(keySetId: ByteArray<Byte>?)Returns a copy with the specified key set ID. |
DownloadRequest! |
copyWithMergedRequest(newRequest: DownloadRequest!)Returns the result of merging |
Int |
|
Boolean |
|
Int |
hashCode() |
MediaItem! |
Returns a |
MediaItem! |
toMediaItem(builder: MediaItem.Builder!)Propagates the content information defined by the request to the |
String! |
toString() |
Unit |
writeToParcel(dest: Parcel!, flags: Int) |
Public properties |
|
|---|---|
DownloadRequest.ByteRange? |
The byte range to be downloaded. |
String? |
Custom key for cache indexing, or null. |
Array<Byte>! |
Application defined data associated with the download. |
String! |
The unique content id. |
Array<Byte>? |
The key set id of the offline licence if the content is protected with DRM. |
String? |
The MIME type of this content. |
(Mutable)List<StreamKey!>! |
Stream keys to be downloaded. |
DownloadRequest.TimeRange? |
The time range to be downloaded. |
Uri! |
The uri being downloaded. |
Constants
Public functions
copyWithId
fun copyWithId(id: String!): DownloadRequest!
Returns a copy with the specified ID.
| Parameters | |
|---|---|
id: String! |
The ID of the copy. |
| Returns | |
|---|---|
DownloadRequest! |
The copy with the specified ID. |
copyWithKeySetId
fun copyWithKeySetId(keySetId: ByteArray<Byte>?): DownloadRequest!
Returns a copy with the specified key set ID.
| Returns | |
|---|---|
DownloadRequest! |
The copy with the specified key set ID. |
copyWithMergedRequest
fun copyWithMergedRequest(newRequest: DownloadRequest!): DownloadRequest!
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: DownloadRequest! |
The request being merged. |
| Returns | |
|---|---|
DownloadRequest! |
The merged result. |
| Throws | |
|---|---|
java.lang.IllegalArgumentException |
If the requests do not have the same |
toMediaItem
fun toMediaItem(): MediaItem!
Returns a MediaItem for the content defined by the request.
toMediaItem
fun toMediaItem(builder: MediaItem.Builder!): MediaItem!
Propagates the content information defined by the request to the MediaItem.Builder and returns a MediaItem.
| Parameters | |
|---|---|
builder: MediaItem.Builder! |
The |
Public properties
byteRange
val byteRange: DownloadRequest.ByteRange?
The byte range to be downloaded. Must be null for DASH, HLS and SmoothStreaming downloads.
customCacheKey
val customCacheKey: String?
Custom key for cache indexing, or null. Must be null for DASH, HLS and SmoothStreaming downloads.
keySetId
val keySetId: Array<Byte>?
The key set id of the offline licence if the content is protected with DRM.
mimeType
val mimeType: String?
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
val streamKeys: (Mutable)List<StreamKey!>!
Stream keys to be downloaded. If empty, all streams will be downloaded.
timeRange
val timeRange: DownloadRequest.TimeRange?
The time range to be downloaded. Must be null progressive downloads.