title: Taro.createVideoContext(id, component)

sidebar_label: createVideoContext

Creates the VideoContext object for the video.

Reference

Type

  1. (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

  1. videoContext = Taro.createVideoContext('myVideo')

API Support

API WeChat Mini-Program H5 React Native
Taro.createVideoContext ✔️ ✔️ ✔️