let obj = {
sourceType: ['album', 'camera']
}
console.log("this.maxDuration == null ||this.maxDuration == undefined: ", this.maxDuration ==
null ||
this.maxDuration == undefined);  
                    let maxDuration = this.maxDuration ? this.maxDuration : 60  
                    let minDuration = this.minDuration ? this.minDuration : 1  
                    if (maxDuration && maxDuration <= 60 && minDuration <= 60) {  
                        obj.maxDuration = maxDuration  
                    }  
                    if (minDuration && minDuration > 60) {  
                        obj.sourceType = ['album']  
                    }  
                    console.log('obj: ',obj);  
                    uni.chooseVideo({  
                        ...obj,  
                        compressed: this.compressVideo,  
                        success: async (res) => {  
                            console.log(res);  
                            console.log("this.maxDuration: ", this.maxDuration);  
                            if (maxDuration && (res.duration > parseInt(maxDuration + 1) || res  
                                    .duration <= parseInt(minDuration))) {  
                                if (this.minDuration > 0) {  
                                    _this.$tip.toast('视频时长最小' + minDuration + 's,视频时长最大' + maxDuration +  
                                        's')  
                                } else {  
                                    _this.$tip.toast('视频时长最大' + maxDuration + 's')  
                                }  
                                return  
                            }  
                            // uni.showLoading({  
                            //  title: '正在上传视频'  
                            // })  
                            let result = ''  
                            result = await _this.uploadFile(res.tempFilePath)  
                            _this.fileList.push(result)  
                            uni.hideLoading()  
                        },  
                        fail(e) {  
                            console.log(e);  
                            // _this.$tip.toast(e.errMsg)  
                        }  
                    }) 
             
             
             
			 
                                        
                                     
            
2 个回复
清欢浮世 (作者)
{
"errMsg": "chooseVideo:fail null",
"errCode": -99,
"code": -99
}
HuiCute
蹲一个,相同问题