已解决,代码如下: <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(); } } },
多视频播放问题播放某个视频,如何暂停其他正在播放的视频?
2019-07-11