uni-app uni.chooseMedia 使用 sizeType:['original']无效

uni-app uni.chooseMedia 使用 sizeType:[‘original’]无效 产品分类:uniapp/小程序/微信

项目 内容
PC开发环境操作系统 Windows
PC开发环境操作系统版本号 win10
HBuilderX类型 正式
HBuilderX版本号 3.3.5
第三方开发者工具版本号 1.05
基础库版本号 3.3
项目创建方式 HBuilderX

bug描述:

创建在unipp是小程序应用 使用的uni.chooseMedia 设置sizeType:[‘original’],但是在安卓手机测试还是会提示压缩中,请稍等…

操作步骤:

selectVideo() {
uni.chooseMedia({
count: this.MAXNUM,
mediaType: ["video"],
sourceType: ['album', 'camera'],
maxDuration: 30,
camera: "back",
sizeType:['original'],
compressed:false,
success: async (res) => {
const files = res.tempFiles;
if (files.length > 0) {
this.upLoading = true;
for (let i = 0; i < files.length; i++) {
const fileObj = files[i];
//为处理是否有重复视频
VideoAddList.push({
path: fileObj.tempFilePath,
});
//渲染上传列表
let viewData = {
vido_url: fileObj.tempFilePath, //VideoAddList[VideoAddList.length-1].path
server_path: null, //服务器资源地址
del: false, //删除状态
cover: fileObj.thumbTempFilePath,
compress: true, //压缩中
upRate: 1, //上传进度
error: false, //上传失败
};
this.video.push(viewData);
//有待验证逻辑
const currentView = this.video[this.video.length - 1];
//判定是否超出数量
if (this.video.length >= 8) {
this.canUpVideo = false;
}
//刷新path与index对应关系
this.reloadVideoIndex();
// if (fileObj.size > this.MAX_SIZE && this.is_compress) {
//   this.$refs.uTips.show({
//     title: "视频文件较大,将在压缩后为您上传",
//     type: "warning",
//     duration: "2500",
//   });
//   this.videoCompressAndUpload(fileObj.tempFilePath, currentView);
// } else {
//   currentView.compress = false;
//   this.videoUpload(fileObj.tempFilePath, currentView);
// }  

          if (i === files.length - 1) {  
            this.upLoading = false;  
          }  
        }  
      } else {  
        this.upLoading = false;  
      }  
    },  
  });  
},

更多关于uni-app uni.chooseMedia 使用 sizeType:['original']无效的实战教程也可以访问 https://www.itying.com/category-93-b0.html

1 回复

更多关于uni-app uni.chooseMedia 使用 sizeType:['original']无效的实战教程也可以访问 https://www.itying.com/category-93-b0.html


sizeType:[‘original’, ‘compressed’] 仅对 mediaType 为 image 时有效,是否压缩所选文件 详见文档

回到顶部