mirror of
https://github.com/Shik3i/KoalaSync.git
synced 2026-07-26 12:08:15 +00:00
Harden Disney+ time fallback against <video> element recreation
When the control overlay (and its live time readout) is briefly absent,
the old fallback recomputed the timeline from the raw blob-relative
video.currentTime via a cached scale/start. Disney recreates the <video>
element on some play/pause transitions, which resets currentTime, so that
math produced a wildly wrong time ("loses the time" after a pause).
The native clock advances 1:1 with real playback, so instead anchor the
last live UI position to video.currentTime and extrapolate by the elapsed
native delta. If the delta is negative or implausibly large (element
recreated / seek), freeze at the last known position rather than emitting
a garbage time.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -94,6 +94,8 @@ function loadTimelineFns(hostname, document = makeDocument()) {
|
||||
'let lastKnownDisneyPlusDuration = 0;',
|
||||
'let lastKnownDisneyPlusScale = 1;',
|
||||
'let lastKnownDisneyPlusStart = 0;',
|
||||
'let lastDisneyPlusUiCurrent = null;',
|
||||
'let lastDisneyPlusNativeAtUi = null;',
|
||||
extractFunction('scanShadowDom', source),
|
||||
extractFunction('querySelectorAllShadow', source),
|
||||
extractFunction('hostMatchesUrl', source),
|
||||
|
||||
Reference in New Issue
Block a user