refactor(spf): drop vestigial try/catch in syncLiveSeekableRange

setLiveSeekableRange throws only on a non-'open' readyState or an invalid
range. The readyState is checked synchronously immediately before the call
(no await between, so it can't change), and liveWindowFor guarantees
0 <= start <= end — neither throw vector is reachable. The try/catch was
load-bearing pre-split (it also wrapped a duration write that could throw
mid-append); that write is gone, leaving the catch dead.

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 0d7208d2d4
commit 02af12e9d9
@@ -49,13 +49,12 @@ function syncLiveSeekableRangeSetup({
const liveWindow = liveWindowFor(state.presentation.get(), state.selectedVideoTrackId?.get());
if (!mediaSource || mediaSource.readyState !== 'open' || !liveWindow) return;
try {
// Re-declared as the window slides so seekable tracks the live window
// (the full DVR range remains seekable; seek-to-live-edge starts near the edge).
mediaSource.setLiveSeekableRange(liveWindow.start, liveWindow.end);
} catch {
// readyState raced closed — retried on the next window change.
}
// Re-declared as the window slides so seekable tracks the live window
// (the full DVR range remains seekable; seek-to-live-edge starts near the edge).
// No try/catch: `setLiveSeekableRange` throws only on a non-'open' readyState
// (checked synchronously just above — no await between, so it can't change) or
// an invalid range (`liveWindowFor` guarantees 0 ≤ start ≤ end).
mediaSource.setLiveSeekableRange(liveWindow.start, liveWindow.end);
});
}