Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
SDK
/
exoplayer
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
771aa328
authored
Jan 14, 2020
by
olly
Committed by
Oliver Woodman
Jan 17, 2020
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Use customCacheKey in DownloadHelper.createMediaSource
Issue: #6870 PiperOrigin-RevId: 289658261
parent
32021602
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
1 deletions
library/core/src/main/java/com/google/android/exoplayer2/offline/DownloadHelper.java
library/core/src/main/java/com/google/android/exoplayer2/source/ProgressiveMediaSource.java
library/core/src/main/java/com/google/android/exoplayer2/offline/DownloadHelper.java
View file @
771aa328
...
@@ -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
);
...
...
library/core/src/main/java/com/google/android/exoplayer2/source/ProgressiveMediaSource.java
View file @
771aa328
...
@@ -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
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment