Skip to content
FrameworkStyle

Time

Playback position and duration state for the player store

Tracks playback position and duration.

API Reference

State

PropertyTypeDetails
currentTimenumber
durationnumber
seekingboolean

Actions

ActionTypeDetails
seek(time: number) => Promise<number>

Selector

Pass selectTime to PlayerController to subscribe to time state. Returns undefined if the time feature is not configured.

import { createPlayer, MediaElement, selectTime } from '@videojs/html';
import { videoFeatures } from '@videojs/html/video';

const { PlayerController, context } = createPlayer({ features: videoFeatures });

class TimeDisplay extends MediaElement {
  readonly #time = new PlayerController(this, context, selectTime);
}