FrameworkStyle

selectSource

Select the source state slice from the player store

Pass selectSource to PlayerController to subscribe to source state. Returns undefined if the source feature is not configured.

The returned state includes the current src and type.

import { createPlayer, MediaElement } from '@videojs/html';
import { videoFeatures } from '@videojs/html/video';
import { selectSource } from '@videojs/core/dom';

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

class SourceInfo extends MediaElement {
  #source = new PlayerController(this, context, selectSource);
}

API Reference

Parameters

Parameter Type Default
state* object

Return Value

MediaSourceState | undefined

VideoJS