收藏
回答

wx.createVideoContext 的 requestFullScreen调用无效?

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()
   }

 输出结果

回答关注问题邀请回答
收藏

2 个回答

登录 后发表内容