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:
Timo
2026-07-02 14:38:26 +02:00
parent 8fe1c6dfbc
commit 2fbcbc4f83
2 changed files with 27 additions and 12 deletions
+2
View File
@@ -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),