小程序视频循环播放3秒
小程序视频循环播放3秒
<video id="myvideo{{index}}" data-i={{index}} src="{{item.video_list}}" loop controls="{{false}}" bindtimeupdate="bind_play"></video>
bind_play(e) {
var currentTime = parseInt(e.detail.currentTime)
var i = e.currentTarget.dataset.i;
var name = "myvideo" + i
var videoContext = wx.createVideoContext(name, this);
if (currentTime == "3") {
videoContext.seek(0)
}
},