mirror of
https://github.com/samsonjs/media.git
synced 2026-03-27 09:45:47 +00:00
Set correct Content-Type for ClearKey requests
Issue: #3138 ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=164434858
This commit is contained in:
parent
1f66f30ccd
commit
df05195f5f
1 changed files with 7 additions and 10 deletions
|
|
@ -38,14 +38,6 @@ import java.util.UUID;
|
|||
@TargetApi(18)
|
||||
public final class HttpMediaDrmCallback implements MediaDrmCallback {
|
||||
|
||||
private static final Map<String, String> PLAYREADY_KEY_REQUEST_PROPERTIES;
|
||||
static {
|
||||
PLAYREADY_KEY_REQUEST_PROPERTIES = new HashMap<>();
|
||||
PLAYREADY_KEY_REQUEST_PROPERTIES.put("Content-Type", "text/xml");
|
||||
PLAYREADY_KEY_REQUEST_PROPERTIES.put("SOAPAction",
|
||||
"http://schemas.microsoft.com/DRM/2007/03/protocols/AcquireLicense");
|
||||
}
|
||||
|
||||
private final HttpDataSource.Factory dataSourceFactory;
|
||||
private final String defaultUrl;
|
||||
private final Map<String, String> keyRequestProperties;
|
||||
|
|
@ -124,10 +116,15 @@ public final class HttpMediaDrmCallback implements MediaDrmCallback {
|
|||
url = defaultUrl;
|
||||
}
|
||||
Map<String, String> requestProperties = new HashMap<>();
|
||||
requestProperties.put("Content-Type", "application/octet-stream");
|
||||
// Add standard request properties for supported schemes.
|
||||
String contentType = C.PLAYREADY_UUID.equals(uuid) ? "text/xml"
|
||||
: (C.CLEARKEY_UUID.equals(uuid) ? "application/json" : "application/octet-stream");
|
||||
requestProperties.put("Content-Type", contentType);
|
||||
if (C.PLAYREADY_UUID.equals(uuid)) {
|
||||
requestProperties.putAll(PLAYREADY_KEY_REQUEST_PROPERTIES);
|
||||
requestProperties.put("SOAPAction",
|
||||
"http://schemas.microsoft.com/DRM/2007/03/protocols/AcquireLicense");
|
||||
}
|
||||
// Add additional request properties.
|
||||
synchronized (keyRequestProperties) {
|
||||
requestProperties.putAll(keyRequestProperties);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue