Files
video.js-mirror/packages/spf/docs/reference/features/hls-loading.md

4.9 KiB

@videojs/spf/features/hls-loading

Source: src/playback/features/hls-loading.ts

hlsLoadingFeature

Fetches and parses the source's HLS multivariant playlist into the presentation the other features read.

Behaviors

  1. resolvePresentation

Config

Feature default is the value a feature's defaultConfig supplies. A behavior's own fallback for a key left unset is described under Doc.

Key Type Feature default Read by Doc
defaultPreload? StandardPreload — resolvePresentation Fallback used when state.preload is unset (undefined / empty) for the resolution-gate decision. Defaults to 'metadata', matching syncPreload's own defaultPreload.
parsePresentation ParsePresentation parseMultivariantPlaylist resolvePresentation Parses a manifest body into a resolved Presentation.
requestCredentials? RequestCredentialsPolicy — resolvePresentation The credentials mode the engine's requests are made with: the manifest, media playlists, segments, and the chapters document; absent → the platform default.

State

Key Type Initial Declared by Doc
loadActivated boolean | undefined — resolvePresentation Sticky-true per source. Flips to true the first time an event occurs that should switch loading behavior from preload-based to standard load (currently DOM play / seeking). Reset to false on source change. Read by resolvePresentation and loadVideoSegments / loadAudioSegments to mirror native HTMLMediaElement preload semantics — only meaningful when preload !== 'auto', which already loads fully regardless. (documented on trackLoadTriggers)
preload "metadata" | "auto" | "none" | undefined — resolvePresentation The preload hint the engine honors. syncPreload keeps it in step with the element's authored preload attribute (both ways) and backfills its defaultPreload when nothing supplied one; resolvePresentation holds manifest resolution while it is 'none' unless loadActivated, and the loadXSegments dispatchers choose their load mode from it. (documented on syncPreload)
presentation MaybeResolvedPresentation | undefined — resolvePresentation The presentation being played. A caller writes { url }; resolvePresentation parses the manifest and populates the rest.

Composed by

Other functions and constants

Name Kind Description Source
behaviors const The behaviors the feature composes, in setup order. Listed under Behaviors. src/playback/features/hls-loading.ts
defaultConfig const The config defaults the feature contributes. Its value: { parsePresentation: parseMultivariantPlaylist }. src/playback/features/hls-loading.ts
initialState const The state values the feature seeds. It seeds none ({}). src/playback/features/hls-loading.ts

Types

Name Kind Description Source
Behaviors type The type of behaviors. src/playback/features/hls-loading.ts
Config type Every config key the behaviors read. Listed under Config. src/playback/features/hls-loading.ts
Context type Every context key the behaviors declare. src/playback/features/hls-loading.ts
State type Every state key the behaviors and external signals declare. Listed under State. src/playback/features/hls-loading.ts