From b81227265c832dfe28c64a2137619a9dffdb60ed Mon Sep 17 00:00:00 2001 From: Sijmen Date: Tue, 2 May 2023 02:00:44 +0200 Subject: [PATCH] Clamp progress bar to 100% --- templates/player.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/player.html b/templates/player.html index ed64167..66a8aab 100644 --- a/templates/player.html +++ b/templates/player.html @@ -75,7 +75,7 @@ progressInterval = window.setInterval(() => { elapsed += 1.0; - let progress = elapsed / duration; + let progress = Math.min(elapsed / duration, 1.0); progressBar.style.width = `${progress * 100}%`; }, 1000); {% endif %}