FrameworkStyle

selectControls

Select the controls state slice from the player store

Pass selectControls to PlayerController 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, MediaElement } from '@videojs/html';
import { videoFeatures } from '@videojs/html/video';
import { selectControls } from '@videojs/core/dom';

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

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

API Reference

Parameters

Parameter Type Default
state* object

Return Value

MediaControlsState | undefined