5***@qq.com
5***@qq.com
  • 发布:2022-01-28 16:37
  • 更新:2022-02-08 14:53
  • 阅读:1147

【报Bug】uni.chooseMedia 使用 sizeType:['original']无效

分类:uni-app

产品分类: uniapp/小程序/微信

PC开发环境操作系统: Windows

PC开发环境操作系统版本号: win10

HBuilderX类型: 正式

HBuilderX版本号: 3.3.5

第三方开发者工具版本号: 1.05

基础库版本号: 3.3

项目创建方式: HBuilderX

操作步骤:

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.chooseMedia中设置 sizeType:['original']不要出现提示 压缩中,请稍等...

实际结果:

安卓手机
uni.chooseMedia中设置 sizeType:['original'] 还是出现提示 压缩中,请稍等...

bug描述:

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

2022-01-28 16:37 负责人:无 分享
已邀请:
DCloud_UNI_Anne

DCloud_UNI_Anne

sizeType:['original', 'compressed']

仅对 mediaType 为 image 时有效,是否压缩所选文件
详见文档

该问题目前已经被锁定, 无法添加新回复