From 27346992c321930c3a80f228619a8b55307c6ec4 Mon Sep 17 00:00:00 2001 From: Alvaro Velad Galvan Date: Tue, 31 Jan 2023 15:58:55 +0100 Subject: [PATCH] fix(MCap): Remove robustness when robustness value is default --- lib/util/stream_utils.js | 40 ++++++++++++++++++++++++++-------------- 1 file changed, 26 insertions(+), 14 deletions(-) diff --git a/lib/util/stream_utils.js b/lib/util/stream_utils.js index c852706863..412fc7210a 100644 --- a/lib/util/stream_utils.js +++ b/lib/util/stream_utils.js @@ -768,26 +768,38 @@ shaka.util.StreamUtils = class { } if (audio) { - if (!keySystemConfig.audio) { + // See: https://github.com/shaka-project/shaka-player/issues/4659 + if (info.audioRobustness != '') { + if (!keySystemConfig.audio) { + // KeySystemTrackConfiguration + keySystemConfig.audio = { + robustness: info.audioRobustness, + }; + } else { + keySystemConfig.audio.robustness = + keySystemConfig.audio.robustness || info.audioRobustness; + } + } else if (!keySystemConfig.audio) { // KeySystemTrackConfiguration - keySystemConfig.audio = { - robustness: info.audioRobustness, - }; - } else { - keySystemConfig.audio.robustness = - keySystemConfig.audio.robustness || info.audioRobustness; + keySystemConfig.audio = {}; } } if (video) { - if (!keySystemConfig.video) { + // See: https://github.com/shaka-project/shaka-player/issues/4659 + if (info.videoRobustness != '') { + if (!keySystemConfig.video) { + // KeySystemTrackConfiguration + keySystemConfig.video = { + robustness: info.videoRobustness, + }; + } else { + keySystemConfig.video.robustness = + keySystemConfig.video.robustness || info.videoRobustness; + } + } else if (!keySystemConfig.video) { // KeySystemTrackConfiguration - keySystemConfig.video = { - robustness: info.videoRobustness, - }; - } else { - keySystemConfig.video.robustness = - keySystemConfig.video.robustness || info.videoRobustness; + keySystemConfig.video = {}; } } }