VideoContext
解释: swan.createVideoContext 的返回值
示例
跳转编辑工具
扫码体验
代码示例
请使用百度APP扫码
图片示例
代码示例
- SWAN
- JS
<view class="wrap">
<video id="myVideo" enable-danmu="true" src="https://b.bdstatic.com/swan-temp/940fe716b0eaad38f47b209d61657490.mp4"></video>
<button type="primary" bindtap="play">play</button>
<button type="primary" bindtap="stop">stop</button>
<button type="primary" bindtap="pause">pause</button>
<button type="primary" bindtap="seek">seek</button>
<button type="primary" bindtap="sendDanmu">sendDanmu</button>
<button type="primary" bindtap="fullScreen">requestFullScreen</button>
<button type="primary" data-set="0.75" bindtap="playbackRate">点击0.75倍速播放</button>
<button type="primary" data-set="1.0" bindtap="playbackRate">点击1.0倍速播放</button>
<button type="primary" data-set="1.25" bindtap="playbackRate">点击1.25倍速播放</button>
<button type="primary" data-set="1.5" bindtap="playbackRate">点击1.5倍速播放</button>
<button type="primary" data-set="2.0" bindtap="playbackRate">点击2.0倍速播放</button>
</view>
错误码
Android
错误码 | 说明 |
---|---|
202 | 解析失败,请检查参数是否正确 |
1001 | 执行失败 |
iOS
错误码 | 说明 |
---|---|
202 | 解析失败,请检查参数是否正确 |