From 147a215edd3e98b1ac8b1cee13160ee09b25f4c8 Mon Sep 17 00:00:00 2001 From: Daniel Silhavy Date: Fri, 15 Mar 2024 08:35:26 +0100 Subject: [PATCH] Check for length of content protection element when checking if media is supported (#4420) --- src/streaming/Stream.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/streaming/Stream.js b/src/streaming/Stream.js index 61081d9fbe..30202f13c6 100644 --- a/src/streaming/Stream.js +++ b/src/streaming/Stream.js @@ -431,7 +431,7 @@ function Stream(config) { return true; } - if (!!mediaInfo.contentProtection && !capabilities.supportsEncryptedMedia()) { + if (!!mediaInfo.contentProtection && mediaInfo.contentProtection.length > 0 && !capabilities.supportsEncryptedMedia()) { errHandler.error(new DashJSError(Errors.CAPABILITY_MEDIAKEYS_ERROR_CODE, Errors.CAPABILITY_MEDIAKEYS_ERROR_MESSAGE)); return false; }