From a38ea0b6871e3f3a2437b3f9c7cac6ad99900f24 Mon Sep 17 00:00:00 2001 From: Daniel Silhavy Date: Mon, 11 Nov 2024 08:08:40 +0100 Subject: [PATCH] Account for cases in which no license for the currently selected KID is returned by the license server (#4625) --- src/streaming/protection/controllers/ProtectionController.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/streaming/protection/controllers/ProtectionController.js b/src/streaming/protection/controllers/ProtectionController.js index bc6c22acc0..67f04c8d35 100644 --- a/src/streaming/protection/controllers/ProtectionController.js +++ b/src/streaming/protection/controllers/ProtectionController.js @@ -1159,7 +1159,7 @@ function ProtectionController(config) { function areKeyIdsUsable(normalizedKeyIds) { try { - if (!normalizedKeyIds || normalizedKeyIds.size === 0) { + if (!normalizedKeyIds || normalizedKeyIds.size === 0 || !keyStatusMap || keyStatusMap.size === 0) { return true; } @@ -1167,7 +1167,7 @@ function ProtectionController(config) { 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