From 4293a1421ada4b189d64b8c3f87a7599bc7b1a8f Mon Sep 17 00:00:00 2001 From: Joey Parrish Date: Wed, 10 Aug 2022 13:59:30 -0700 Subject: [PATCH] feat: Improve gap-detection robustness (#4399) This raises the default gap-detection threshold from 0.1 seconds for some platforms and 0.5 seconds for others to 0.5 second universally. This fixes test flake in gap-jumping tests on Android and may improve gap-jumping generally for certain platforms or content. --- lib/util/player_configuration.js | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/lib/util/player_configuration.js b/lib/util/player_configuration.js index b61490eac7..f737530bab 100644 --- a/lib/util/player_configuration.js +++ b/lib/util/player_configuration.js @@ -147,7 +147,7 @@ shaka.util.PlayerConfiguration = class { ignoreTextStreamFailures: false, alwaysStreamText: false, startAtSegmentBoundary: false, - gapDetectionThreshold: 0.1, + gapDetectionThreshold: 0.5, durationBackoff: 1, forceTransmuxTS: false, // Offset by 5 seconds since Chromecast takes a few seconds to start @@ -173,15 +173,6 @@ shaka.util.PlayerConfiguration = class { maxDisabledTime: 30, }; - // Some browsers will stop earlier than others before a gap (e.g., Edge - // stops 0.5 seconds before a gap). So for some browsers we need to use a - // larger threshold. See: https://bit.ly/2K5xmJO - if (shaka.util.Platform.isLegacyEdge() || - shaka.util.Platform.isTizen() || - shaka.util.Platform.isChromecast()) { - streaming.gapDetectionThreshold = 0.5; - } - // WebOS, Tizen, and Chromecast have long hardware pipelines that respond // slowly to seeking. Therefore we should not seek when we detect a stall // on one of these platforms. Instead, default stallSkip to 0 to force the