视频列表页面滑动时停止视频播放
<view v-for="(item, index) in mylist" :key="index" @touchmove="scroolMove">
<video
ref="videoRef"
:id="item.user_id"
@play="handlePlay"
:show-fullscreen-btn="true"
objectFit="contain"
:src="item.target"
controls
binderror="videoErrorCallback"
:autoplay="false"
></video>
</view>
给视频每个单独的ID,批量暂停当前页面所有的视频
scroolMove(e) {
var that = this;
that.mylist.forEach(function(item, index) {
var mm = uni.createVideoContext(item.user_id, this);
mm.pause();
});
},