收藏
回答

wx.chooseMedia()获取的size有误?

型号:iphone13promax;接口wx.chooseMedia()

export default function({ maxDuration = 60, maxSize = 30, sourceType = ['camera', 'album'] } = {}) {
	const max = Number(maxSize) * 1024 * 1024
	return new Promise(resolve => {
		wx.chooseMedia({
			sizeType: ['original'],
			mediaType: ['video'],
			sourceType,
			maxDuration,
			count: 1,
			success: (res) => {
				console.log(res.tempFiles[0])
				if (res.tempFiles[0].size > max) {
					wx.showModal({
						title: '温馨提示',
						content: `最大上传视频${maxSize}M`,
						showCancel: false
					})
					resolve(null)
				} else {
					resolve(res.tempFiles[0].tempFilePath)
				}
			},
			fail: (err) => {
				console.log('视频', err)
			}
		})
	})
}

我用了安卓的红米k50和IOS的iPhone12测试是没问题,但是这个客户的就不行


回答关注问题邀请回答
收藏

2 个回答

登录 后发表内容