mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
Merge pull request #675 from shanujshekhar:shanujs/add-new-apis-exomediadrm
PiperOrigin-RevId: 569205163
This commit is contained in:
commit
6d77838a6b
2 changed files with 54 additions and 0 deletions
|
|
@ -523,6 +523,40 @@ public interface ExoMediaDrm {
|
||||||
*/
|
*/
|
||||||
void restoreKeys(byte[] sessionId, byte[] keySetId);
|
void restoreKeys(byte[] sessionId, byte[] keySetId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Removes an offline license.
|
||||||
|
*
|
||||||
|
* <p>This method is generally not needed, and should only be used if the preferred approach of
|
||||||
|
* generating a license release request by passing {@link #KEY_TYPE_RELEASE} to {@link
|
||||||
|
* #getKeyRequest} is not possible.
|
||||||
|
*
|
||||||
|
* <p>This is an optional method, and some implementations may only support it on certain Android
|
||||||
|
* API levels.
|
||||||
|
*
|
||||||
|
* <p>See {@link MediaDrm#removeOfflineLicense(byte[])} for more details.
|
||||||
|
*
|
||||||
|
* @param keySetId The {@code keySetId} of the license to remove.
|
||||||
|
* @throws UnsupportedOperationException if the implementation doesn't support this method.
|
||||||
|
*/
|
||||||
|
default void removeOfflineLicense(byte[] keySetId) {
|
||||||
|
throw new UnsupportedOperationException();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a list of the {@code keySetIds} for all offline licenses.
|
||||||
|
*
|
||||||
|
* <p>This is an optional method, and some implementations may only support it on certain Android
|
||||||
|
* API levels.
|
||||||
|
*
|
||||||
|
* <p>See {@link MediaDrm#getOfflineLicenseKeySetIds()} for more details.
|
||||||
|
*
|
||||||
|
* @return The list of {@code keySetIds} for all offline licenses.
|
||||||
|
* @throws UnsupportedOperationException if the implementation doesn't support this method.
|
||||||
|
*/
|
||||||
|
default List<byte[]> getOfflineLicenseKeySetIds() {
|
||||||
|
throw new UnsupportedOperationException();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns metrics data for this ExoMediaDrm instance, or {@code null} if metrics are unavailable.
|
* Returns metrics data for this ExoMediaDrm instance, or {@code null} if metrics are unavailable.
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -327,6 +327,26 @@ public final class FrameworkMediaDrm implements ExoMediaDrm {
|
||||||
mediaDrm.restoreKeys(sessionId, keySetId);
|
mediaDrm.restoreKeys(sessionId, keySetId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@UnstableApi
|
||||||
|
@RequiresApi(29)
|
||||||
|
public void removeOfflineLicense(byte[] keySetId) {
|
||||||
|
if (Util.SDK_INT < 29) {
|
||||||
|
throw new UnsupportedOperationException();
|
||||||
|
}
|
||||||
|
mediaDrm.removeOfflineLicense(keySetId);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@UnstableApi
|
||||||
|
@RequiresApi(29)
|
||||||
|
public List<byte[]> getOfflineLicenseKeySetIds() {
|
||||||
|
if (Util.SDK_INT < 29) {
|
||||||
|
throw new UnsupportedOperationException();
|
||||||
|
}
|
||||||
|
return mediaDrm.getOfflineLicenseKeySetIds();
|
||||||
|
}
|
||||||
|
|
||||||
@UnstableApi
|
@UnstableApi
|
||||||
@Override
|
@Override
|
||||||
@Nullable
|
@Nullable
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue