<video id="video" bindtimeupdate="timeUpdate"/>
this.videoContext = wx.createVideoContext('video');
timeUpdate (e) {
if (e.detail.currentTime > 3) {
this.videoContext.pause()
}
上述代码中,在不拖动进度条的情况下能够正常执行视频暂停, 但在拖动进度条之后时间到三秒之后就会发现视频没有被暂停,且无法用任何事件阻止
<video id="video" bindtimeupdate="timeUpdate"/>
this.videoContext = wx.createVideoContext('video');
timeUpdate (e) {
if (e.detail.currentTime > 3) {
this.videoContext.pause()
}
上述代码中,在不拖动进度条的情况下能够正常执行视频暂停, 但在拖动进度条之后时间到三秒之后就会发现视频没有被暂停,且无法用任何事件阻止
2 个回答
麻烦提供能复现问题的代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)
this,videoContext.pause() this后面是个逗号啊,没报错吗?可否提供示例代码片段,我测试一下