From 1952834b74adeb99c5855aa8b50cc5fc77d4c90e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?A=CC=81lvaro=20Velad=20Galva=CC=81n?= Date: Tue, 3 Dec 2024 11:02:57 +0100 Subject: [PATCH] fix: Allow set maxLatency and minLatency to 0 --- lib/player.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/player.js b/lib/player.js index 0e6b7b4be8..1177cb800a 100644 --- a/lib/player.js +++ b/lib/player.js @@ -7023,7 +7023,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 ' + @@ -7032,7 +7032,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 ' +