camera组件 录制视频 3秒结束后上传,后台无法识别?
发布于 5 年前 作者 yangmao 8938 次浏览 来自 问答
stopRecord() {
    let that = this
    let token = fns.getStorage('token');
    console.log("开始")
    this.ctx.stopRecord({
      success(res) => {
        console.log(res)
        
        wx.getFileSystemManager().readFile({
          filePath: res.tempVideoPath,
          encoding'base64', 
          success(base) =>{
            console.log(base.data) // 
            net.request(urls.liveDetection,{videoStr:base.data}).then(res =>{
              console.log(res)
            }).catch(err =>{
              console.log(err)
            })
          }
        })
      }
    })

  },

结束录制以后,把视频转base64格式 传给后台

后台无法接受,用开发者工具调试 也一直掉线重连

回到顶部