--- status: implemented date: 2026-05-20 definition: sketched --- # Preload modes The engine's loading-semantics implementation: how `preload="none|metadata|auto"` plus user / programmatic activation determine when the engine fetches the manifest, sets up MSE, and starts segment loading. Together, the `syncPreload` and `trackLoadTriggers` behaviors model loading behavior similar to native `HTMLMediaElement` playback — `state.preload` is the mode, `state.loadActivated` is the override that fires on `play` / `seeking` (or programmatic intent), and downstream gates read both. This doc captures the **capability surface**: what works, what doesn't, which behaviors / slots implement it, and how downstream features gate on it. ## Status - **Composition:** `createSimpleHlsEngine` (HLS VoD) - **Definition depth:** sketched — capability surface and implementation footprint documented; the extended-preload-value mechanism is a forward-compatibility hook with no shipped consumer yet ## Phases of complexity What's implemented today, organized as capability slices around the engine's loading-semantics contract. | Phase | What | Notes | |---|---|---| | W3C preload mode honoring | Engine respects `preload="none" \| "metadata" \| "auto"` via the `isBlockingPreload` predicate that downstream gates consume (`resolvePresentation`, the per-type segment-loading FSM). `'none'` is the strictest gate — blocks manifest fetch and all segment loading until activation. `'metadata'` resolves manifests + sets up MSE + fetches init segments only. `'auto'` runs the full pipeline | `isBlockingPreload` in `media/utils/preload.ts` is the core predicate | | Bidirectional DOM ↔ state sync | `state.preload` and `mediaElement.preload` stay synchronized for W3C values. Effects registered read-before-write so a freshly mounted `