Files
video.js-mirror/packages/spf/docs/reference/features/current-time.md

3.7 KiB

@videojs/spf/features/current-time

Source: src/playback/features/current-time.ts

currentTimeFeature

Mirrors the media element's currentTime into state, which segment loading reads to plan what to load next.

Behaviors

  1. trackCurrentTime

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
defaultCurrentTime? number — trackCurrentTime Value written to state.currentTime when no media element is attached. Defaults to 0 — the HTMLMediaElement spec default.

State

Key Type Initial Declared by Doc
currentTime number | undefined — trackCurrentTime Current playback position in seconds. Defaults to 0 when undefined. (documented on loadVideoSegments)

Context

Key Type Declared by Doc
mediaElement HTMLMediaElement | undefined trackCurrentTime 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/current-time.ts
defaultConfig const The config defaults the feature contributes. It contributes none ({}). src/playback/features/current-time.ts
initialState const The state values the feature seeds. It seeds none ({}). src/playback/features/current-time.ts

Types

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