Skip to main content
Version: 3.x

Taro.createVideoContext(id, component)

Creates the VideoContext object for the video.

Reference

Type

(id: string, component?: Record<string, any>) => VideoContext

Parameters

PropertyTypeDescription
idstringThe video component's ID
componentRecord<string, any>The this object of the current component instance in custom components. It is used with the video component

Sample Code

videoContext = Taro.createVideoContext('myVideo')

API Support

APIWeChat Mini-ProgramH5React Native
Taro.createVideoContext✔️✔️✔️