requestFullScreen 在开发者工具上会同时执行2次,真机下无效: 代码如下
videoFullscreenchange(e: any){
console.log('eeee',e)
let {fullScreen} = e.detail
this.setData({
fullScreen: fullScreen
})
if(!fullScreen){
let video: any = this.data.video
video.pause()
}
},
videoPlay(e : any){
let {videoid} = e.currentTarget.dataset
let video: any = wx.createVideoContext(videoid, this);
console.log(videoid)
setTimeout(() => {
video.requestFullScreen({
direction: 0,
})
}, 500)
this.setData({
video: video,
fullScreen: true
})
video.play()
}
输出结果
请具体描述问题出现的流程,并提供能复现问题的简单代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)。
绑定事件时,需要使用 bindPay , 在真机上可全屏