Functions & Hooks

createVideoPlayer

function createVideoPlayer(source: string | number, options?: VideoOptions & object): Promise<VideoPlayer>;

useVideo with no React: opens the player, applies the options, and owns the UI-thread frame pump and its teardown. Resolves once the video is open. Call dispose() when done - a device has only a handful of hardware decoders.

Needs react-native-reanimated and react-native-worklets, exactly as the hook does: frames are pulled on the UI thread.

Parameters

source

string | number

options?

VideoOptions & object

Returns

Promise<VideoPlayer>

On this page