From dba7c5d4d5ead25447bdb610ac9aea8291ced415 Mon Sep 17 00:00:00 2001 From: ed Date: Sun, 30 Nov 2025 22:14:26 +0000 Subject: [PATCH] iOS: bbox: fix video scrubbing; unlike android, iOS does not eat touch-events in the video controls, so it would switch to the prev/next media on seek instead of seek --- copyparty/web/baguettebox.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/copyparty/web/baguettebox.js b/copyparty/web/baguettebox.js index e6acd2d38..6686e7321 100644 --- a/copyparty/web/baguettebox.js +++ b/copyparty/web/baguettebox.js @@ -60,6 +60,15 @@ window.baguetteBox = (function () { hideOverlay(); }; + var vtouch = function (e) { + var v = vid(), + bv = v.getBoundingClientRect(), + tp = e.changedTouches[0]; + + if (bv.bottom - tp.clientY < 90) + touchFlag = true; + }; + var touchstartHandler = function (e) { touch.count = e.touches.length; if (touch.count > 1) @@ -822,6 +831,7 @@ window.baguetteBox = (function () { if (v == keep) continue; + unbind(v, 'touchstart', vtouch, nonPassiveEvent); unbind(v, 'error', lerr); v.src = ''; v.load(); @@ -1250,6 +1260,7 @@ window.baguetteBox = (function () { setloop(); } } + bind(v, 'touchstart', vtouch, nonPassiveEvent); } selbg(); mp_ctl();