2 回复
已解决,代码如下:
<view wx:for=’{{detail.video}}’>
<video id=‘video{{index}}’ src=’{{item}}’ bindplay=‘play’></video>
</view>
play(e) {
var id = e.currentTarget.id;
for (var i = 0; i < this.data.detail.video.length; i++) {
if (id === ‘video’ + i) {
console.log(‘播放视频不做处理’);
} else {
console.log(‘暂停其他正在播放的视频’);
this.videoContext = wx.createVideoContext([“video”, i].join(’’), this);
this.videoContext.pause();
}
}
},