AnimationVideo.seek
解释:跳转到指定位置(单位:s)
方法参数
Number position
示例
在开发者工具中预览效果
扫码体验
请使用百度APP扫码
图片示例
代码示例
-
<view class="container"> <animation-video id ="myAnimationVideo" path = "{{path}}" bindstarted = "started" bindended = "ended" resource-width="800" resource-height="400" canvas-style ="width: 100%" > </animation-video> <button class="btn" type="primary" bindtap="seek">跳转到2s</button></view>
-
Page({ data: { path: 'https://efe-h2.cdn.bcebos.com/ceug/resource/res/2020-1/1577964961344/003e2f0dcd81.mp4' }, onLoad() { // 创建动画组件实例 this.myAnimationVideo = swan.createAnimationVideo('myAnimationVideo'); }, seek() { // 动画跳转到 2 s this.myAnimationVideo.seek(2); }});
