From 174ca1a07273d701bd66bbd328beb106c1e68d4e Mon Sep 17 00:00:00 2001 From: LogicalKarma <> Date: Thu, 28 May 2026 23:19:48 +0300 Subject: [PATCH] fix(player): resume from saved position and protect it across keep-alive Clicking a video from history (or any cached watch page) restarted it from 0 instead of resuming, and history bars showed stale positions. Four shared-path bugs, all engine-agnostic: - The resume position was computed but never applied: Shaka's load(uri, startTime) doesn't perform the initial seek for lazily-fetched segment indexes, so playback began at 0. Apply the resume explicitly with a runtime seek once load() resolves. - initialSeekComplete (gates progress saving until the resume seek lands) was never reset per-load. On a reactivated player it stayed true from the previous play, so a timeupdate at currentTime=0 during rebuild churn overwrote the saved position before the resume read ran. Reset it at the start of loadVideo. - Leaving a watch page (destroy) empties the media element -> currentTime snaps to 0 and a stray timeupdate fires while initialSeekComplete is still true, clobbering the saved position. Gate the save on destroying as well. - HistoryPage: re-read watch_history in onActivated so progress bars reflect the current saved position instead of a stale first-mount snapshot. Kept off onMounted to avoid double-loading (both fire on first keep-alive mount). Co-Authored-By: Claude Opus 4.7 --- src/components/HistoryPage.vue | 18 ++++++++++-------- src/components/VideoPlayer.vue | 20 +++++++++++--------- 2 files changed, 21 insertions(+), 17 deletions(-) diff --git a/src/components/HistoryPage.vue b/src/components/HistoryPage.vue index 12f0ce7c..f839f2e0 100644 --- a/src/components/HistoryPage.vue +++ b/src/components/HistoryPage.vue @@ -61,7 +61,7 @@