小程序上传视频超过一定大小,上传过程中闪退 (cos.putObject),使用开发工具上传正常。
发布于 6 年前 作者 zhuguiying 6113 次浏览 来自 问答

如题

2 回复

你好,麻烦提供出现问题的具体机型、微信版本号、系统版本号,以及能复现问题的代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html

cos.postObject({
        Bucket: --,
        Region: --,
        Key: fileKey,
        FilePath: filePath,
        onProgress: function (info) {
          let oldP = _this.data.percent1;
          let percent = Math.floor(info.percent*100);
          let loaded = info.loaded;
          console.log(oldP + ":" + percent + "->" + info.loaded + ": " + info.total)
          if(oldP != percent){
            _this.setData({
              percent1: info.percent * 100
            })
          }
        }
      }, function (err, data) {
//...
}
回到顶部