Files
v10/packages
Christian PillsburyandClaude Opus 4.8 bfb5ef7aae feat(spf): fold live HLS support into createSimpleHlsEngine
Compose the live behaviors into the VoD engine so one composition handles
both VoD and live, keying every live-vs-VoD decision off playlist
completeness rather than streamType:

- resolveSelectedTrackDuration: new completeness-based duration resolver, now
  the engine default. Returns the resolved track's finite duration when its
  playlist is complete (#EXT-X-ENDLIST), else Infinity (still growing → live).
  Keys off completeness because deriveStreamType marks any playlist lacking
  #EXT-X-PLAYLIST-TYPE:VOD as 'live', which would wrongly force Infinity on a
  plain VoD stream that only carries #EXT-X-ENDLIST.
- seekToLiveEdge: guarded to no-op for complete playlists, so it's inert for
  VoD when composed unconditionally.
- createSimpleHlsEngine: composes scheduleVideoTrackReload/Audio/Text,
  anchorLiveTracks, and guarded seekToLiveEdge — all inert for VoD (complete
  playlists never reload; the anchor is a no-op without PDT / shift 0). Adds
  the startSequence config knob.

Also make updateMediaSourceDuration's live write defer to a non-updating
SourceBuffer instant: Infinity needn't precede appends (it overrides any finite
live-edge value an append pinned), but the MSE spec forbids setting duration
while a buffer is updating, so a racing synchronous write threw.

Verified live playback end-to-end through createSimpleHlsEngine (real-time,
presentation.duration Infinity, seeked to edge) against a Mux LL-HLS stream;
full VoD suite green (1071 passed). The separate live engine is retained for
now. Known follow-up: mediaSource.duration can stay finite during initial
buffer fill (continuous appends leave no idle instant) — to be fixed by
writing Infinity synchronously at sourceopen, ahead of the buffer actors.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-25 09:59:23 -07:00
..