FrameworkStyle

selectControls

Select the controls state slice from the player store

Import

import { selectControls } from '@videojs/core/dom';

Usage

Pass selectControls to usePlayer (React) or PlayerController (HTML) to subscribe to controls state. Returns undefined if the controls feature is not configured.

The returned state includes whether controls are visible and whether the user is active (interacting with the player).

import { createPlayer, features, MediaElement } from '@videojs/html';
import { selectControls } from '@videojs/core/dom';

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

class ControlsOverlay extends MediaElement {
  #controls = new PlayerController(this, context, selectControls);
}

API Reference

Parameters

Parameter Type Default
state* {}

Return Value

MediaControlsState | undefined

VideoJS