swan.createVideoContext

解释: 创建并返回 video 上下文 videoContext 对象。通过 videoId 跟一个 video 组件绑定,通过它可以操作一个 video 组件。

方法参数

String videoId

返回值

VideoContext

示例

跳转编辑工具

在开发者工具中打开

在 WEB IDE 中打开

扫码体验

代码示例

百度智能小程序

请使用百度APP扫码

图片示例

swan.createVideoContext - 图2

代码示例

  • SWAN
  • JS
  1. <view class="wrap">
  2. <video id="myVideo" enable-danmu="true" src="https://b.bdstatic.com/swan-temp/940fe716b0eaad38f47b209d61657490.mp4"></video>
  3. </view>