docs(spf): explain why syncLiveSeekableRange doesn't clear on termination

Reframe the "clearLiveSeekableRange() on termination" follow-up as a
deliberate non-action rather than a gap. Per the W3C MSE spec, the live
seekable range is consulted only while duration === Infinity; when a live
stream ends, endOfStream() sets a finite duration and the UA derives seekable
from buffered + duration, ignoring the live range — so clearing is unnecessary.
Clearing on the ENDLIST->finite-Track.duration transition would also be
premature (duration is still Infinity until endOfStream) and shrink seekable to
buffered-only. No logic change; the existing behavior (bail on null window) is
already correct, and the 'no-ops for a complete playlist' test locks it.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Christian Pillsbury
2026-06-25 10:00:21 -07:00
co-authored by Claude Opus 4.8
parent 81fb61b354
commit 57a426db6b
2 changed files with 13 additions and 10 deletions
@@ -14,9 +14,16 @@
*
* Duration is owned solely by `updateMediaSourceDuration`; this behavior only
* declares the seekable range (`setLiveSeekableRange` requires only
* `readyState === 'open'` per the W3C MSE spec, not a set `duration`). Out of
* scope (tracked follow-up): `clearLiveSeekableRange()` on the live→ended
* transition.
* `readyState === 'open'` per the W3C MSE spec, not a set `duration`).
*
* No `clearLiveSeekableRange()` on termination, by design: the MSE spec consults
* the live seekable range *only* while `duration === Infinity`. When a live
* stream ends, `endOfStream()` sets a finite duration and the UA derives
* `seekable` from buffered + duration, ignoring the live range — so clearing is
* unnecessary. Clearing on the `ENDLIST`→finite-`Track.duration` transition
* (when the window goes `null`) would also be premature: `duration` is still
* `Infinity` until `endOfStream`, so clearing would shrink `seekable` to
* buffered-only while the stream is still effectively live.
*/
import type { Behavior } from '../../../core/composition/create-composition';
import { effect } from '../../../core/signals/effect';