uniapp 制作手机app程序, 使用uni.chooseVideo录制视频,视频播放模糊分辨率低的原因

原因:compressed参数是true,这个参数的意思是‘是否压缩所选的视频源文件,默认值为 true,需要压缩’。如果不加这个参数默认就是true,就会默认压缩视频播放出来就是模糊的,改为false就可以了

可以参考uniapp API开发文档 uni.chooseVideo

					uni.chooseVideo({
    
    
                    maxDuration: 60,
                    count: 1,
                    compressed:false,//是否压缩所选的视频源文件,默认值为 true,需要压缩。
                    // camera: this.cameraList[this.cameraIndex].value,
                    sourceType: ['camera'],
                    success: (responent) => {
    
    
                        this.videoPath = responent.tempFilePath;
                    
                        // this.src = responent.tempFilePath;  //头条
                    }
                })

抖音真实需求案例

				uni.chooseVideo({
    
    
					compressed:false,//是否压缩所选的视频源文件,默认值为 true,需要压缩。
					sourceType: ['album','camera'],
					success(e) {
    
    
						uni.navigateTo({
    
    
							url: "/pages/publish/publish?fileObjectEvent=" + JSON.stringify(e)
						})
						
						/**
						 * 或者采用uniCloud,在客户端完成上传,减少链路,因为文件大,通信链路和耗时是双倍的
						 */
					}
				})

猜你喜欢

转载自blog.csdn.net/weixin_40816738/article/details/125452417