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
ceb1e872
authored
Aug 10, 2017
by
Oliver Woodman
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Revert "Add possibility of forcing a specific license URL in HttpMediaDrmCallback"
This reverts commit
768a73b3
.
parent
3f31cec7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
45 deletions
library/core/src/main/java/com/google/android/exoplayer2/drm/HttpMediaDrmCallback.java
library/core/src/main/java/com/google/android/exoplayer2/drm/OfflineLicenseHelper.java
library/core/src/main/java/com/google/android/exoplayer2/drm/HttpMediaDrmCallback.java
View file @
ceb1e872
...
...
@@ -39,29 +39,29 @@ import java.util.UUID;
public
final
class
HttpMediaDrmCallback
implements
MediaDrmCallback
{
private
final
HttpDataSource
.
Factory
dataSourceFactory
;
private
final
String
defaultLicenseUrl
;
private
final
boolean
forceDefaultLicenseUrl
;
private
final
String
defaultUrl
;
private
final
Map
<
String
,
String
>
keyRequestProperties
;
/**
* @param default
License
Url The default license URL.
* @param defaultUrl The default license URL.
* @param dataSourceFactory A factory from which to obtain {@link HttpDataSource} instances.
*/
public
HttpMediaDrmCallback
(
String
default
License
Url
,
HttpDataSource
.
Factory
dataSourceFactory
)
{
this
(
default
LicenseUrl
,
false
,
dataSourceFactory
,
null
);
public
HttpMediaDrmCallback
(
String
defaultUrl
,
HttpDataSource
.
Factory
dataSourceFactory
)
{
this
(
default
Url
,
dataSourceFactory
,
null
);
}
/**
* @
param defaultLicenseUrl The default license URL.
*
@param forceDefaultLicenseUrl Whether to force use of {@code defaultLicenseUrl} even for key
*
requests that include their own
license URL.
* @
deprecated Use {@link HttpMediaDrmCallback#HttpMediaDrmCallback(String, Factory)}. Request
*
properties can be set by calling {@link #setKeyRequestProperty(String, String)}.
*
@param defaultUrl The default
license URL.
* @param dataSourceFactory A factory from which to obtain {@link HttpDataSource} instances.
* @param keyRequestProperties Request properties to set when making key requests, or null.
*/
public
HttpMediaDrmCallback
(
String
defaultLicenseUrl
,
boolean
forceDefaultLicenseUrl
,
HttpDataSource
.
Factory
dataSourceFactory
,
Map
<
String
,
String
>
keyRequestProperties
)
{
@Deprecated
public
HttpMediaDrmCallback
(
String
defaultUrl
,
HttpDataSource
.
Factory
dataSourceFactory
,
Map
<
String
,
String
>
keyRequestProperties
)
{
this
.
dataSourceFactory
=
dataSourceFactory
;
this
.
defaultLicenseUrl
=
defaultLicenseUrl
;
this
.
forceDefaultLicenseUrl
=
forceDefaultLicenseUrl
;
this
.
defaultUrl
=
defaultUrl
;
this
.
keyRequestProperties
=
new
HashMap
<>();
if
(
keyRequestProperties
!=
null
)
{
this
.
keyRequestProperties
.
putAll
(
keyRequestProperties
);
...
...
@@ -112,8 +112,8 @@ public final class HttpMediaDrmCallback implements MediaDrmCallback {
@Override
public
byte
[]
executeKeyRequest
(
UUID
uuid
,
KeyRequest
request
)
throws
Exception
{
String
url
=
request
.
getDefaultUrl
();
if
(
forceDefaultLicenseUrl
||
TextUtils
.
isEmpty
(
url
))
{
url
=
default
License
Url
;
if
(
TextUtils
.
isEmpty
(
url
))
{
url
=
defaultUrl
;
}
Map
<
String
,
String
>
requestProperties
=
new
HashMap
<>();
// Add standard request properties for supported schemes.
...
...
library/core/src/main/java/com/google/android/exoplayer2/drm/OfflineLicenseHelper.java
View file @
ceb1e872
...
...
@@ -43,44 +43,23 @@ public final class OfflineLicenseHelper<T extends ExoMediaCrypto> {
* Instantiates a new instance which uses Widevine CDM. Call {@link #release()} when the instance
* is no longer required.
*
* @param
defaultL
icenseUrl The default license URL.
* @param
l
icenseUrl The default license URL.
* @param httpDataSourceFactory A factory from which to obtain {@link HttpDataSource} instances.
* @return A new instance which uses Widevine CDM.
* @throws UnsupportedDrmException If the Widevine DRM scheme is unsupported or cannot be
* instantiated.
*/
public
static
OfflineLicenseHelper
<
FrameworkMediaCrypto
>
newWidevineInstance
(
String
defaultLicenseUrl
,
Factory
httpDataSourceFactory
)
throws
UnsupportedDrmException
{
return
newWidevineInstance
(
defaultLicenseUrl
,
false
,
httpDataSourceFactory
,
null
);
String
licenseUrl
,
Factory
httpDataSourceFactory
)
throws
UnsupportedDrmException
{
return
newWidevineInstance
(
new
HttpMediaDrmCallback
(
licenseUrl
,
httpDataSourceFactory
)
,
null
);
}
/**
* Instantiates a new instance which uses Widevine CDM. Call {@link #release()} when the instance
* is no longer required.
*
* @param defaultLicenseUrl The default license URL.
* @param forceDefaultLicenseUrl Whether to force use of {@code defaultLicenseUrl} even for key
* requests that include their own license URL.
* @param httpDataSourceFactory A factory from which to obtain {@link HttpDataSource} instances.
* @return A new instance which uses Widevine CDM.
* @throws UnsupportedDrmException If the Widevine DRM scheme is unsupported or cannot be
* instantiated.
*/
public
static
OfflineLicenseHelper
<
FrameworkMediaCrypto
>
newWidevineInstance
(
String
defaultLicenseUrl
,
boolean
forceDefaultLicenseUrl
,
Factory
httpDataSourceFactory
)
throws
UnsupportedDrmException
{
return
newWidevineInstance
(
defaultLicenseUrl
,
forceDefaultLicenseUrl
,
httpDataSourceFactory
,
null
);
}
/**
* Instantiates a new instance which uses Widevine CDM. Call {@link #release()} when the instance
* is no longer required.
*
* @param defaultLicenseUrl The default license URL.
* @param forceDefaultLicenseUrl Whether to force use of {@code defaultLicenseUrl} even for key
* requests that include their own license URL.
* @param callback Performs key and provisioning requests.
* @param optionalKeyRequestParameters An optional map of parameters to pass as the last argument
* to {@link MediaDrm#getKeyRequest(byte[], byte[], String, int, HashMap)}. May be null.
* @return A new instance which uses Widevine CDM.
...
...
@@ -90,12 +69,10 @@ public final class OfflineLicenseHelper<T extends ExoMediaCrypto> {
* MediaDrmCallback, HashMap, Handler, EventListener)
*/
public
static
OfflineLicenseHelper
<
FrameworkMediaCrypto
>
newWidevineInstance
(
String
defaultLicenseUrl
,
boolean
forceDefaultLicenseUrl
,
Factory
httpDataSourceFactory
,
HashMap
<
String
,
String
>
optionalKeyRequestParameters
)
MediaDrmCallback
callback
,
HashMap
<
String
,
String
>
optionalKeyRequestParameters
)
throws
UnsupportedDrmException
{
return
new
OfflineLicenseHelper
<>(
FrameworkMediaDrm
.
newInstance
(
C
.
WIDEVINE_UUID
),
new
HttpMediaDrmCallback
(
defaultLicenseUrl
,
forceDefaultLicenseUrl
,
httpDataSourceFactory
,
null
),
optionalKeyRequestParameters
);
return
new
OfflineLicenseHelper
<>(
FrameworkMediaDrm
.
newInstance
(
C
.
WIDEVINE_UUID
),
callback
,
optionalKeyRequestParameters
);
}
/**
...
...
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