VideoContext.seek
基础库 1.18.0 开始支持本方法,这是一个同步方法。
视频点播。
语法
VideoContext.seek(position)
参数说明
position
类型 | 默认值 | 必填 | 说明 | 最低支持版本 |
---|---|---|---|---|
number | 是 | 跳转到指定位置,单位为秒 | 1.18.0 |
返回值
无
扫码体验
请使用字节宿主APP扫码
代码示例
<video
src="https//sf1-cdn-tos.douyinstatic.com/obj/microapp/frontend/misc/test-upload.mp4"
id="myVideo"
style="width: 240px; height: 180px;"
/>
<view
style="display: flex; justify-content: space-between; align-items: center;"
>
<button bindtap="seek" size="mini">Seek</button>
</view>
Page({
videoContext: undefined,
onReady() {
this.videoContext = tt.createVideoContext("myVideo");
},
// 点播
seek() {
this.videoContext.seek(3);
},
});
Bug & Tip
无
点击纠错
该文档是否对你的开发有所帮助?
有帮助
没帮助
该文档是否对你的开发有所帮助?
有帮助
没帮助