handle:function(id){
// 检测 this.video 的值
// 停止播放
// do something ...
//控制只播放一个
let newVideo = uni.createVideoContext(id);
console.log(newVideo);
if (!this.video) {
this.video = newVideo;
this.video.play();
return
}
if (this.video.id !== newVideo.id) {
newVideo.play();
this.video.pause();
this.video = newVideo;
}
}
这个是方法
1 个回复
Vali (作者)
在HBuilderX上面写的代码