Skip to content

Commit

Permalink
Account for cases in which no license for the currently selected KID …
Browse files Browse the repository at this point in the history
…is returned by the license server (#4625)
  • Loading branch information
dsilhavy authored Nov 11, 2024
1 parent e621627 commit a38ea0b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/streaming/protection/controllers/ProtectionController.js
Original file line number Diff line number Diff line change
Expand Up @@ -1159,15 +1159,15 @@ function ProtectionController(config) {

function areKeyIdsUsable(normalizedKeyIds) {
try {
if (!normalizedKeyIds || normalizedKeyIds.size === 0) {
if (!normalizedKeyIds || normalizedKeyIds.size === 0 || !keyStatusMap || keyStatusMap.size === 0) {
return true;
}

let usable = true

normalizedKeyIds.forEach((normalizedKeyId) => {
const keyStatus = keyStatusMap.get(normalizedKeyId)
usable = !keyStatus || (keyStatus && keyStatus !== ProtectionConstants.MEDIA_KEY_STATUSES.INTERNAL_ERROR && keyStatus !== ProtectionConstants.MEDIA_KEY_STATUSES.OUTPUT_RESTRICTED);
usable = keyStatus && keyStatus !== ProtectionConstants.MEDIA_KEY_STATUSES.INTERNAL_ERROR && keyStatus !== ProtectionConstants.MEDIA_KEY_STATUSES.OUTPUT_RESTRICTED;
})

return usable
Expand Down

0 comments on commit a38ea0b

Please sign in to comment.