video2slides: 修缩略图/大图 400 — img 标签带不了头,改用 ?c= query 传 client
deploy video2slides / build-and-deploy (push) Successful in 1m40s

This commit is contained in:
Fam Zheng
2026-06-14 21:42:44 +01:00
parent bb65c4c415
commit 25a28ea092
2 changed files with 20 additions and 4 deletions
+1 -1
View File
@@ -128,7 +128,7 @@ async function api(path,opts={}){
const ct=r.headers.get('content-type')||'';
return ct.includes('json')?r.json():r;
}
function imgUrl(vid,kind,idx){return `/api/videos/${vid}/${kind}/${idx}`;}
function imgUrl(vid,kind,idx){return `/api/videos/${vid}/${kind}/${idx}?c=${encodeURIComponent(CLIENT)}`;}
const fmtDur=s=>{s=Math.round(s||0);const m=Math.floor(s/60),x=s%60;return `${m}:${String(x).padStart(2,'0')}`;};
const fmtSize=b=>b>1e9?(b/1e9).toFixed(1)+'G':b>1e6?(b/1e6).toFixed(1)+'M':(b/1e3|0)+'K';
const fmtT=s=>{s=Math.round(s);const h=Math.floor(s/3600),m=Math.floor(s%3600/60),x=s%60;const p=n=>String(n).padStart(2,'0');return h?`${h}:${p(m)}:${p(x)}`:`${m}:${p(x)}`;};