From 64b861c665d9412469d57c93381dcad5df14dd94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Velad=20Galv=C3=A1n?= Date: Tue, 3 Dec 2024 11:22:20 +0100 Subject: [PATCH] fix: Allow set maxLatency and minLatency to 0 (#7704) --- lib/player.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/player.js b/lib/player.js index 5a0b160728..1c11110dae 100644 --- a/lib/player.js +++ b/lib/player.js @@ -6984,7 +6984,7 @@ shaka.Player = class extends shaka.util.FakeEventTarget { 's). Updating playbackRate to ' + minPlaybackRate); this.trickPlay(minPlaybackRate, /* useTrickPlayTrack= */ false); } - } else if (maxLatency && maxPlaybackRate && + } else if (maxLatency != undefined && maxPlaybackRate && (latency - offset) > maxLatency) { if (playbackRate != maxPlaybackRate) { shaka.log.debug('Latency (' + latency + 's) is greater than ' + @@ -6993,7 +6993,7 @@ shaka.Player = class extends shaka.util.FakeEventTarget { this.trickPlay(maxPlaybackRate, /* useTrickPlayTrack= */ false); } this.targetLatencyReached_ = null; - } else if (minLatency && minPlaybackRate && + } else if (minLatency != undefined && minPlaybackRate && (latency - offset) < minLatency) { if (playbackRate != minPlaybackRate) { shaka.log.debug('Latency (' + latency + 's) is smaller than ' +