Skip to main content
Version: v7 Alpha

Function: useVideoPlayer()

function useVideoPlayer(source, setup?): VideoPlayer;

Defined in: hooks/useVideoPlayer.ts:30

Creates a VideoPlayer instance and manages its lifecycle.

if initializeOnCreation is true (default), the setup function will be called when the player is started loading source. if initializeOnCreation is false, the setup function will be called when the player is created. changes made to player made before initializing will be overwritten when initializing.

Parameters

ParameterTypeDescription
source| VideoSource | VideoConfigThe source of the video to play
setup?(player) => voidA function to setup the player

Returns

VideoPlayer

The VideoPlayer instance

We are TheWidlarzGroupPremium support →