Skip to content
Merged
Changes from 1 commit
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
7 changes: 7 additions & 0 deletions src/controller/eme-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -980,6 +980,10 @@ class EMEController extends Logger implements ComponentAPI {
'buffer' in keyId
? new Uint8Array(keyId.buffer, keyId.byteOffset, keyId.byteLength)
: new Uint8Array(keyId);

// 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);
if (
mediaKeySessionContext.keySystem === KeySystems.PLAYREADY &&
keyIdArray.length === 16
Expand All @@ -994,7 +998,10 @@ class EMEController extends Logger implements ComponentAPI {
this.log(
`key status change "${status}" for keyStatuses keyId: ${keyIdWithStatusChange} key-session "${mediaKeySessionContext.mediaKeysSession.sessionId}"`,
);

// Cache both the original and endianness-converted key IDs to ensure compatibility across all cases.
keyStatuses[keyIdWithStatusChange] = status;
keyStatuses[originKeyIdWithStatusChange] = status;
},
);
return keyStatuses;
Expand Down
Loading