From 771aa32825fbaf9a36859699e94eba2ff2d46e1d Mon Sep 17 00:00:00 2001 From: olly Date: Tue, 14 Jan 2020 16:36:16 +0000 Subject: [PATCH] Use customCacheKey in DownloadHelper.createMediaSource Issue: #6870 PiperOrigin-RevId: 289658261 --- .../com/google/android/exoplayer2/offline/DownloadHelper.java | 1 + .../android/exoplayer2/source/ProgressiveMediaSource.java | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/library/core/src/main/java/com/google/android/exoplayer2/offline/DownloadHelper.java b/library/core/src/main/java/com/google/android/exoplayer2/offline/DownloadHelper.java index ff95afb1f6..d176b1905c 100644 --- a/library/core/src/main/java/com/google/android/exoplayer2/offline/DownloadHelper.java +++ b/library/core/src/main/java/com/google/android/exoplayer2/offline/DownloadHelper.java @@ -448,6 +448,7 @@ public final class DownloadHelper { break; case DownloadRequest.TYPE_PROGRESSIVE: return new ProgressiveMediaSource.Factory(dataSourceFactory) + .setCustomCacheKey(downloadRequest.customCacheKey) .createMediaSource(downloadRequest.uri); default: throw new IllegalStateException("Unsupported type: " + downloadRequest.type); diff --git a/library/core/src/main/java/com/google/android/exoplayer2/source/ProgressiveMediaSource.java b/library/core/src/main/java/com/google/android/exoplayer2/source/ProgressiveMediaSource.java index f05b576acb..512fbce4a2 100644 --- a/library/core/src/main/java/com/google/android/exoplayer2/source/ProgressiveMediaSource.java +++ b/library/core/src/main/java/com/google/android/exoplayer2/source/ProgressiveMediaSource.java @@ -111,7 +111,7 @@ public final class ProgressiveMediaSource extends BaseMediaSource * @return This factory, for convenience. * @throws IllegalStateException If {@link #createMediaSource(Uri)} has already been called. */ - public Factory setCustomCacheKey(String customCacheKey) { + public Factory setCustomCacheKey(@Nullable String customCacheKey) { Assertions.checkState(!isCreateCalled); this.customCacheKey = customCacheKey; return this;