ReferencePlayer
createPlayer
Factory function that creates a typed Player component and hooks
Import
createPlayer is the entry point for setting up a Video.js player in React. It accepts a configuration object with a features array and returns hooks and components for building a player.
The hook is typed according to the provided features, giving you full type safety for state selectors and actions.
Examples
Basic Usage
API Reference
Video
createPlayer(config): CreatePlayerResult<VideoPlayerStore>
Create a player instance with a typed Player component and hooks.
Parameters
Return Value
Audio
createPlayer(config): CreatePlayerResult<AudioPlayerStore>
Create a player for audio media.
Parameters
Return Value
Generic
createPlayer<const Features extends AnyPlayerFeature[]>(config): CreatePlayerResult<PlayerStore<Features>>
Create a player with custom features.