Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/controller/eme-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -980,10 +980,17 @@ class EMEController extends Logger implements ComponentAPI {
'buffer' in keyId
? new Uint8Array(keyId.buffer, keyId.byteOffset, keyId.byteLength)
: new Uint8Array(keyId);

if (
mediaKeySessionContext.keySystem === KeySystems.PLAYREADY &&
keyIdArray.length === 16
) {
// On some devices, the key ID has already been converted for endianness.
// In such cases, this key ID is the one we need to cache.
const originKeyIdWithStatusChange = arrayToHex(keyIdArray);
// Cache the original key IDs to ensure compatibility across all cases.
keyStatuses[originKeyIdWithStatusChange] = status;

changeEndianness(keyIdArray);
}
const keyIdWithStatusChange = arrayToHex(keyIdArray);
Expand All @@ -994,6 +1001,7 @@ class EMEController extends Logger implements ComponentAPI {
this.log(
`key status change "${status}" for keyStatuses keyId: ${keyIdWithStatusChange} key-session "${mediaKeySessionContext.mediaKeysSession.sessionId}"`,
);

keyStatuses[keyIdWithStatusChange] = status;
},
);
Expand Down
Loading