video2slides: 修缩略图/大图 400 — img 标签带不了头,改用 ?c= query 传 client
deploy video2slides / build-and-deploy (push) Successful in 1m40s
deploy video2slides / build-and-deploy (push) Successful in 1m40s
This commit is contained in:
@@ -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)}`;};
|
||||
|
||||
Reference in New Issue
Block a user