From 981a7cd9dda0acedbc7f53b2c44adb241c38cb84 Mon Sep 17 00:00:00 2001 From: ed Date: Sun, 8 Mar 2026 10:24:04 +0000 Subject: [PATCH] bbox: probably fix #1348 (currentTime rhs was NaN) --- copyparty/web/baguettebox.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/copyparty/web/baguettebox.js b/copyparty/web/baguettebox.js index ad0f7ada..3bd2a53e 100644 --- a/copyparty/web/baguettebox.js +++ b/copyparty/web/baguettebox.js @@ -420,7 +420,7 @@ window.baguetteBox = (function () { playpause(); else if (kl == "u" || kl == "o") relseek(kl == "u" ? -10 : 10); - else if (v && /^[0-9]$/.test(k)) + else if (v && /^[0-9]$/.test(k) && isNum(v.duration)) v.currentTime = v.duration * parseInt(k) * 0.1; else if (kl == "m" && v) { v.muted = vmute = !vmute; @@ -1176,8 +1176,11 @@ window.baguetteBox = (function () { } function relseek(sec) { - if (vid()) - vid().currentTime += sec; + var v = vid(), + t = v && v.currentTime; + + if (isNum(t)) + v.currentTime = t + sec; } function vidEnd() {