Back to Exoplayer

DownloadRequest.Builder (ExoPlayer library)

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

latest4.3 KB
Original Source

Package com.google.android.exoplayer2.offline

Class DownloadRequest.Builder


public static classDownloadRequest.Builderextends[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")

A builder for download requests.

Constructor Summary

Constructors | Constructor | Description | | --- | --- | | Builder​(String id, Uri uri) | Creates a new instance with the specified id and uri. |

Method Summary

All Methods Instance Methods Concrete Methods | Modifier and Type | Method | Description | | --- | --- | --- | | DownloadRequest | build() | | | DownloadRequest.Builder | setCustomCacheKey​(String customCacheKey) | Sets the DownloadRequest.customCacheKey. | | DownloadRequest.Builder | setData​(byte[] data) | Sets the DownloadRequest.data. | | DownloadRequest.Builder | setKeySetId​(byte[] keySetId) | Sets the DownloadRequest.keySetId. | | DownloadRequest.Builder | setMimeType​(String mimeType) | Sets the DownloadRequest.mimeType. | | DownloadRequest.Builder | setStreamKeys​(List<StreamKey> streamKeys) | Sets the DownloadRequest.streamKeys. |

- 

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

- 

Builder

public Builder​([String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")id,[Uri](https://developer.android.com/reference/android/net/Uri.html "class or interface in android.net")uri)

Creates a new instance with the specified id and uri.

Method Detail

- 

setMimeType

@CanIgnoreReturnValue
public[DownloadRequest.Builder](DownloadRequest.Builder.html "class in com.google.android.exoplayer2.offline")setMimeType​(@Nullable[String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")mimeType)

Sets the DownloadRequest.mimeType.

- 

setStreamKeys

@CanIgnoreReturnValue
public[DownloadRequest.Builder](DownloadRequest.Builder.html "class in com.google.android.exoplayer2.offline")setStreamKeys​(@Nullable[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)

Sets the DownloadRequest.streamKeys.

- 

setKeySetId

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

Sets the DownloadRequest.keySetId.

- 

setCustomCacheKey

@CanIgnoreReturnValue
public[DownloadRequest.Builder](DownloadRequest.Builder.html "class in com.google.android.exoplayer2.offline")setCustomCacheKey​(@Nullable[String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")customCacheKey)

Sets the DownloadRequest.customCacheKey.

- 

setData

@CanIgnoreReturnValue
public[DownloadRequest.Builder](DownloadRequest.Builder.html "class in com.google.android.exoplayer2.offline")setData​(@Nullable
                                       byte[] data)

Sets the DownloadRequest.data.

- 

build

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