<video
:src="url"
controls
id="video"
@play="play"
@fullscreenchange="fullscreenchange">
</video>
// 播放时进入全屏
play() {
let videoContext = uni.createVideoContext('video', this)
videoContext.requestFullScreen()
},
//退出全屏时暂停
fullscreenchange(e) {
if (!e.detail.fullScreen) {
uni.createVideoContext('video', this).pause();
}
},
//退出全屏时停止
fullscreenchange (e){
if(!e.detail.fullScreen){
this.videoContext.stop()
}
}
注意:微信小程序模拟器下调试无效,必须真机调试有用!!!!
注意:微信小程序模拟器下调试无效,必须真机调试有用!!!!
注意:微信小程序模拟器下调试无效,必须真机调试有用!!!!