mirror of
https://github.com/androidx/media.git
synced 2025-05-13 02:29:52 +08:00
Work around a bug in the Android 13 ClearKey implementation
The ClearKey CDM will attach an 'invalid' URL in `KeyRequest` objects, when the documentation states this should be an empty string if a default URL is not known. #minor-release PiperOrigin-RevId: 476113513 (cherry picked from commit 715c948004eeabb6f7e2d45b8b8856ee4a015391)
This commit is contained in:
parent
873b806389
commit
395d89a7b7
@ -29,6 +29,9 @@
|
|||||||
`MetadataRenderer(MetadataOutput, Looper, MetadataDecoderFactory,
|
`MetadataRenderer(MetadataOutput, Looper, MetadataDecoderFactory,
|
||||||
boolean)` to specify whether the renderer will output metadata early or
|
boolean)` to specify whether the renderer will output metadata early or
|
||||||
in sync with the player position.
|
in sync with the player position.
|
||||||
|
* DRM:
|
||||||
|
* Work around a bug in the Android 13 ClearKey implementation that returns
|
||||||
|
a non-empty but invalid license URL.
|
||||||
* DASH:
|
* DASH:
|
||||||
* Parse `EventStream.presentationTimeOffset` from manifests
|
* Parse `EventStream.presentationTimeOffset` from manifests
|
||||||
([#10460](https://github.com/google/ExoPlayer/issues/10460)).
|
([#10460](https://github.com/google/ExoPlayer/issues/10460)).
|
||||||
|
@ -229,11 +229,7 @@ public final class FrameworkMediaDrm implements ExoMediaDrm {
|
|||||||
mediaDrm.getKeyRequest(scope, initData, mimeType, keyType, optionalParameters);
|
mediaDrm.getKeyRequest(scope, initData, mimeType, keyType, optionalParameters);
|
||||||
|
|
||||||
byte[] requestData = adjustRequestData(uuid, request.getData());
|
byte[] requestData = adjustRequestData(uuid, request.getData());
|
||||||
|
String licenseServerUrl = adjustLicenseServerUrl(request.getDefaultUrl());
|
||||||
String licenseServerUrl = request.getDefaultUrl();
|
|
||||||
if (MOCK_LA_URL_VALUE.equals(licenseServerUrl)) {
|
|
||||||
licenseServerUrl = "";
|
|
||||||
}
|
|
||||||
if (TextUtils.isEmpty(licenseServerUrl)
|
if (TextUtils.isEmpty(licenseServerUrl)
|
||||||
&& schemeData != null
|
&& schemeData != null
|
||||||
&& !TextUtils.isEmpty(schemeData.licenseServerUrl)) {
|
&& !TextUtils.isEmpty(schemeData.licenseServerUrl)) {
|
||||||
@ -247,6 +243,17 @@ public final class FrameworkMediaDrm implements ExoMediaDrm {
|
|||||||
return new KeyRequest(requestData, licenseServerUrl, requestType);
|
return new KeyRequest(requestData, licenseServerUrl, requestType);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static String adjustLicenseServerUrl(String licenseServerUrl) {
|
||||||
|
if (MOCK_LA_URL.equals(licenseServerUrl)) {
|
||||||
|
return "";
|
||||||
|
} else if (Util.SDK_INT == 33 && "https://default.url".equals(licenseServerUrl)) {
|
||||||
|
// Work around b/247808112
|
||||||
|
return "";
|
||||||
|
} else {
|
||||||
|
return licenseServerUrl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@UnstableApi
|
@UnstableApi
|
||||||
@Override
|
@Override
|
||||||
@Nullable
|
@Nullable
|
||||||
|
Loading…
x
Reference in New Issue
Block a user