Your Name 1912bcd25b
Some checks failed
Lint / build (20) (push) Has been cancelled
Playwright Tests / test (push) Has been cancelled
chore: sync all remaining local workspace changes
2026-05-08 11:26:57 +08:00

54 lines
1.7 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
* Extracted from browser-delivered Turbopack chunk: 1da3af88666fe4c8.e799ee1631.js
* Module id: 89472
* For reading/searching only; this factory depends on the original Turbopack runtime.
*/
const moduleFactory = (e) => {
"use strict";
let t = "请上传小于 1.5G 且时长在 15分钟 以内的视频";
async function r(e, r) {
if (!e.type.startsWith("video/")) return null;
if (e.size > 0x60000000) return t;
let o = r?.minDurationSec,
n = r?.maxDurationSec ?? 900,
i = await new Promise((t) => {
let r = URL.createObjectURL(e),
o = document.createElement("video");
o.preload = "metadata";
let n = () => {
o.removeAttribute("src"), o.load(), URL.revokeObjectURL(r);
},
i = setTimeout(() => {
n(), t(null);
}, 1e4);
(o.onloadedmetadata = () => {
clearTimeout(i);
let e =
Number.isFinite(o.duration) && o.duration > 0 ? o.duration : null;
n(), t(e);
}),
(o.onerror = () => {
clearTimeout(i), n(), t(null);
}),
(o.src = r);
});
return null === i
? null != o
? "无法读取视频时长,请更换文件或稍后再试"
: null
: null != o
? i < o || i > n
? `请上传时长在 ${o}~${n} 秒之间的视频`
: null
: i > n
? r?.maxDurationSec != null
? `请上传时长不超过 ${n} 秒的视频`
: t
: null;
}
e.s(["validateVideoFile", () => r]);
};
export default moduleFactory;