视频时长限制
This commit is contained in:
parent
3e9235844a
commit
2836b0712f
|
|
@ -67,6 +67,7 @@ const handleUpload = async (userId, type, sourceType = ['album', 'camera'], uplo
|
|||
// ========== 【核心新增:图片比例校验 结束】 ==========
|
||||
} else if (uploadType == 'video') {
|
||||
const res = await uni.chooseVideo({
|
||||
maxDuration:60,
|
||||
count: 1,
|
||||
sourceType: ['album', 'camera'],
|
||||
compressed: false
|
||||
|
|
@ -77,6 +78,7 @@ const handleUpload = async (userId, type, sourceType = ['album', 'camera'], uplo
|
|||
// #ifdef APP-PLUS || MP-WEIXIN
|
||||
file = res;
|
||||
// #endif
|
||||
console.log(res,'resresres');
|
||||
const duration = res.duration;
|
||||
if (duration < 3) {
|
||||
uni.showToast({
|
||||
|
|
@ -85,7 +87,7 @@ const handleUpload = async (userId, type, sourceType = ['album', 'camera'], uplo
|
|||
});
|
||||
return null;
|
||||
}
|
||||
if (duration > 59.9) {
|
||||
if (duration > 61) {
|
||||
uni.showToast({
|
||||
title: "视频时长不能超过1分钟",
|
||||
icon: "none",
|
||||
|
|
|
|||
Loading…
Reference in New Issue