From 762b1e7b8b0a9f1443cd82ef388e5a3ce04a3f5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Velad=20Galv=C3=A1n?= Date: Tue, 31 Jan 2023 18:21:28 +0100 Subject: [PATCH] fix(MCap): Remove robustness when robustness value is default (#4953) Fixes https://github.com/shaka-project/shaka-player/issues/4659 --- 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 8dc7de6105..4fd70a1f51 100644 --- a/lib/util/stream_utils.js +++ b/lib/util/stream_utils.js @@ -703,26 +703,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 = {}; } } }