Files
video.js-mirror/packages/spf/docs/reference/features/start-position.md

3.9 KiB

@videojs/spf/features/start-position

Source: src/playback/features/start-position.ts

startPositionFeature

Starts playback at state.startPosition instead of zero. Also performs the seeks other features request through state.startPosition, such as the live edge and the AirPlay session-end restore.

Behaviors

  1. applyStartPosition

State

Key Type Initial Declared by Doc
currentTime number | undefined — applyStartPosition Current playback position in seconds. Defaults to 0 when undefined. (documented on loadVideoSegments)
presentation MaybeResolvedPresentation | undefined — applyStartPosition The presentation being played. A caller writes { url }; resolvePresentation parses the manifest and populates the rest. (documented on resolvePresentation)
startPosition number | undefined — applyStartPosition One-shot start-position command in presentation-timeline seconds. Written by consumers (adapter, recovery snapshot — e.g. setupAirPlay's at a session's settled end); consumed (cleared) by applyStartPosition once the element seeks.

Context

Key Type Declared by Doc
mediaElement HTMLMediaElement | undefined applyStartPosition The media element the engine drives. No behavior writes it: an adapter attaches one with engine.context.mediaElement.set(element) and detaches with set(undefined), as SPF's adapters do. (documented on setupMediaSource)

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/start-position.ts
defaultConfig const The config defaults the feature contributes. It contributes none ({}). src/playback/features/start-position.ts
initialState const The state values the feature seeds. It seeds none ({}). src/playback/features/start-position.ts

Types

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