vue:
<video :id="'video'+index" :src="item.photo_list[0]" @play="videoPlayHandle('video'+index)"></video>
data:
video:null
methods:
// 视频播放需要暂停其他视频,也支持当前视频播放暂停
videoPlayHandle(id) {
let newVideo = uni.createVideoContext(id);
if (!this.video) {
this.video = newVideo;
this.video.play();
return
}
if (this.video.id !== newVideo.id) {
newVideo.play();
this.video.pause();
this.video = newVideo;
}
},
app中无效,待解决
7 个评论
要回复文章请先登录或注册
v***@sina.com
卟懂
3***@qq.com
小瓶盖1 (作者)
小瓶盖1 (作者)
Vali
Vali