DownloadRequest


@UnstableApi
class DownloadRequest : Parcelable


Defines content to be downloaded.

Summary

Nested types

A builder for download requests.

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

Public functions

DownloadRequest!

Returns a copy with the specified ID.

DownloadRequest!

Returns a copy with the specified key set ID.

DownloadRequest!

Returns the result of merging newRequest into this request.

Int
Boolean
equals(o: Any?)
Int
MediaItem!

Returns a MediaItem for the content defined by the request.

String!
Unit
writeToParcel(dest: Parcel!, flags: Int)

Public properties

String?

Custom key for cache indexing, or null.

ByteArray<Byte>!

Application defined data associated with the download.

String!

The unique content id.

ByteArray<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.

Uri!

The uri being downloaded.

Constants

CREATOR

const val CREATORParcelable.Creator<DownloadRequest!>!

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?): DownloadRequest!

Returns a copy with the specified key set ID.

Parameters
keySetId: ByteArray?

The key set ID of the copy.

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 id.

describeContents

fun describeContents(): Int

equals

fun equals(o: Any?): Boolean

hashCode

fun hashCode(): Int

toMediaItem

fun toMediaItem(): MediaItem!

Returns a MediaItem for the content defined by the request.

toString

fun toString(): String!

writeToParcel

fun writeToParcel(dest: Parcel!, flags: Int): Unit

Public properties

customCacheKey

val customCacheKeyString?

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

data

val dataByteArray<Byte>!

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

id

val idString!

The unique content id.

keySetId

val keySetIdByteArray<Byte>?

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

mimeType

val mimeTypeString?

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.

uri

val uriUri!

The uri being downloaded.