Commit 771aa328 by olly Committed by Oliver Woodman

Use customCacheKey in DownloadHelper.createMediaSource

Issue: #6870
PiperOrigin-RevId: 289658261
parent 32021602
...@@ -448,6 +448,7 @@ public final class DownloadHelper { ...@@ -448,6 +448,7 @@ public final class DownloadHelper {
break; break;
case DownloadRequest.TYPE_PROGRESSIVE: case DownloadRequest.TYPE_PROGRESSIVE:
return new ProgressiveMediaSource.Factory(dataSourceFactory) return new ProgressiveMediaSource.Factory(dataSourceFactory)
.setCustomCacheKey(downloadRequest.customCacheKey)
.createMediaSource(downloadRequest.uri); .createMediaSource(downloadRequest.uri);
default: default:
throw new IllegalStateException("Unsupported type: " + downloadRequest.type); throw new IllegalStateException("Unsupported type: " + downloadRequest.type);
......
...@@ -111,7 +111,7 @@ public final class ProgressiveMediaSource extends BaseMediaSource ...@@ -111,7 +111,7 @@ public final class ProgressiveMediaSource extends BaseMediaSource
* @return This factory, for convenience. * @return This factory, for convenience.
* @throws IllegalStateException If {@link #createMediaSource(Uri)} has already been called. * @throws IllegalStateException If {@link #createMediaSource(Uri)} has already been called.
*/ */
public Factory setCustomCacheKey(String customCacheKey) { public Factory setCustomCacheKey(@Nullable String customCacheKey) {
Assertions.checkState(!isCreateCalled); Assertions.checkState(!isCreateCalled);
this.customCacheKey = customCacheKey; this.customCacheKey = customCacheKey;
return this; return this;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment