Taro.createVideoContext(id, component)
Creates the VideoContext object for the video.
Type
(id: string, component?: Record<string, any>) => VideoContext
Parameters
Property | Type | Description |
---|---|---|
id | string | The video component's ID |
component | Record<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
API | WeChat Mini-Program | H5 | React Native |
---|---|---|---|
Taro.createVideoContext | ✔️ | ✔️ | ✔️ |