Files
shumai/packages/webui/components/viewers/video
90f076f3ba fix(webui): stop duplicate seeks on the video progress bar (#532)
* fix(webui): avoid duplicate seek on progress bar tap

A single tap/click fired onSeek twice: once on pointer-down and again
on pointer-up at the same position. The second seek restarted the
native seek right as data began arriving, which stalled playback for
several seconds on slow connections. Track pointer movement and only
re-seek on release after an actual drag.

Co-Authored-By: Claude <noreply@anthropic.com>

* fix(webui): suppress synthetic mouse seek after touch on progress bar

Mobile browsers dispatch synthetic mousedown/mouseup after touch
interactions. The mouse path re-queued a seek to the same position,
which restarted the native seek ~500ms later and stalled playback on
slow connections. Ignore mouse-down within 700ms of a touch end.

Co-Authored-By: Claude <noreply@anthropic.com>

* fix(webui): reset progress bar drag state on touchcancel

OS gestures (app switch, palm rejection, notification pull) cancel
touches without a touchend. The drag/hover state then stayed stuck
until the next interaction. Reset state without seeking.

Co-Authored-By: Claude <noreply@anthropic.com>

* perf(webui): load seek preview video metadata only

The hidden 180p preview video used preload="auto", downloading the
whole file alongside main playback. On constrained connections it
competed for bandwidth exactly when a seek needed data, lengthening
rebuffering. Metadata is enough until the user actually scrubs.

Co-Authored-By: Claude <noreply@anthropic.com>

* test(webui): cover progress bar seeking on click, tap and touch cancel

Check that a plain click or tap seeks once, a real drag seeks again on release, synthetic mouse events right after a touch are ignored, a cancelled touch resets without seeking, and the hidden preview video preloads metadata only.

Co-Authored-By: Claude <noreply@anthropic.com>

* docs(changelog): note the progress bar seek fixes

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: phj1081 <5908832+phj1081@users.noreply.github.com>
Co-authored-by: Claude <noreply@anthropic.com>
2026-11-27 10:12:53 +08:00
..