style="{'width': winWidth, 'height': winHeight}">
</video>
</swiper-item>
</swiper>
//创建视频对象
getVideoCtx() {
return uni.createVideoContext('player' + this.currentVideo, this)
},
// 垂直滑动视频
handleSwipeVertical(e) {
let index = e.detail.current
this.progressBar = 0
this.isPlaying = false
let video = this.getVideoCtx()
if (!video) return
video.pause()
// 重新开始
video.seek(0)
this.currentVideo = index
// 自动播放
this.handlePlay()
},
//播放视频
handlePlay() {
this.$nextTick(()=>{
let video = this.getVideoCtx()
if (!video) return
video.play()
this.isPlaying = true
})
},
1***@qq.com (作者)
刚进入页面不能自动播放的问题我知道是浏览器限制,现在是 播放了第一个swiper里的视频,切换到下一屏的时候,在ios视频就没有自动播放了,安卓会
2022-11-18 12:33