Upload Β· Compress Β· Preview Β· Share
Drop MP4s anywhere
πŸ“
Drop your MP4 banners here
Drag & drop multiple files or click to browse
Compressed to ≀ 4 MB Β· Previewed at 50% of original size
MP4 onlyMultiple files ≀ 4 MB output50% preview Shareable link
Loading FFmpeg engine…
Compressing
Banner Preview
Displayed at 50% of original size Β· Autoplay Β· Loop Β· Muted
`; } async function tryOwnServer(){ try{ const id=Date.now().toString(36)+Math.random().toString(36).slice(2,6); const fd=new FormData(); fd.append('id',id); fd.append('date',new Date().toLocaleDateString('en-US',{month:'short',day:'numeric',year:'numeric'})); fd.append('meta',JSON.stringify(S.banners.map(b=>({ name:b.name,origSize:b.origSize,compSize:b.compSize,origW:b.origW,origH:b.origH })))); for(const b of S.banners) fd.append('files[]',b.blob,b.name); const timeout=ms=>new Promise((_,rej)=>setTimeout(()=>rej(new Error('timeout')),ms)); const r=await Promise.race([fetch('upload.php',{method:'POST',body:fd}),timeout(60000)]); if(!r.ok) return null; const j=await r.json(); return j.url||null; }catch(e){ return null; } } async function tryUpload(html){ const blob=new Blob([html],{type:'text/html'}); const timeout=ms=>new Promise((_,rej)=>setTimeout(()=>rej(new Error('timeout')),ms)); try{ const r=await Promise.race([ fetch('https://transfer.sh/banner-preview.html',{method:'PUT',body:blob,headers:{'Max-Days':'14'}}), timeout(15000) ]); if(r.ok) return (await r.text()).trim(); }catch{} try{ const fd=new FormData(); fd.append('file',blob,'banner-preview.html'); const r=await Promise.race([ fetch('https://0x0.st',{method:'POST',body:fd}), timeout(15000) ]); if(r.ok) return (await r.text()).trim(); }catch{} return null; } function dlShareHTML(){ if(!S.shareCache){toast('Not ready.');return;} const nameInput=el('share-name'); const name=(nameInput&&nameInput.value.trim())||suggestShareName(); const a=document.createElement('a'); a.href=URL.createObjectURL(new Blob([S.shareCache],{type:'text/html'})); a.download=name.replace(/\.html$/i,'')+'.html'; a.click(); toast('Downloaded!'); } function blobToDataURL(blob){ return new Promise((res,rej)=>{const r=new FileReader();r.onload=()=>res(r.result);r.onerror=rej;r.readAsDataURL(blob);}); } // ── Clear all ────────────────────────────────────────────────── function clearAll(){ if(!confirm('Clear all banners?')) return; S.banners.forEach(b=>URL.revokeObjectURL(b.url)); S.banners=[]; S.shareCache=''; S.active=0; setShareBusy(false); el('prog-list').innerHTML=''; el('grid').innerHTML=''; el('stats').innerHTML=''; zone.style.display='block'; document.querySelector('main').classList.add('empty'); addZone.style.display='none'; ['progress-panel','preview','action-bar'].forEach(id=>el(id).style.display='none'); el('add-btn').style.display='none'; el('clr-btn').style.display='none'; }