收藏
回答

调用 xr-scene.share.recordStart() 失败?

// 开始录制
    recordStartasync function()
    {
      console.log("share.recordState="+this.scene.share.recordState);
      const xrFrameSystem = wx.getXrFrameSystem();
      if (this.scene.share.recordState === xrFrameSystem.EShareRecordState.Recording) {
        console.log("正在录制");
        return;
      }
      //录制参数
      const options: XrFrame.IShareRecordOptions = {
        fps30,
        widththis.scene.width,
        heightthis.scene.height,
        videoBitsPerSecond1000
      };
      //启动录制
      const share = this.scene.share;
      await share.recordStart(options); //这句代码有时会失败。不是必失败。
      //录制x秒后自动停止,并保存到相册
      this.timeoutID = setTimeout(async function(){
        await share.recordFinishToAlbum(options);
        console.log("record finish");
      }, 8000);
    },
回答关注问题邀请回答
收藏
登录 后发表内容