// video-tool.jsx — Dedicated video generation page // Tabs: 参考图生成视频 | 开始/结束帧 | 文生视频 // URL: /video?tab=ref | /video?tab=frames | /video?tab=text const VIDEO_ACCENT = '#22d3ee'; const VIDEO_ACCENT_2 = '#a78bfa'; // ── OSS thumbnail helpers ──────────────────────────────────────────────────── // Delegates to api.js's getCdnDomain() — single fetch shared across all pages. let _vtCdnDomain = null; const _vtFetchCdn = () => { if (_vtCdnDomain !== null) return Promise.resolve(_vtCdnDomain); const p = window.YiteAPI?.getCdnDomain?.() || Promise.resolve(''); return p.then(d => { _vtCdnDomain = d; return d; }); }; // Returns a small thumbnail URL using OSS image processing if the URL is // from our CDN. Falls back to the original URL for external/provider URLs. const _vtThumbUrl = (url, tag, cdnDomain) => { if (!url || !cdnDomain || !url.startsWith(cdnDomain) || url.includes('?')) return url; if (tag === 'video') return url + '?x-oss-process=video/snapshot,t_1000,f_jpg,w_200,h_200,m_fast'; if (tag === 'image') return url + '?x-oss-process=image/resize,w_200,h_200,m_fill/format,webp'; return url; }; const _isVideoUrl = url => /\.(mp4|mov|webm|avi|mkv)(\?|$)/i.test(url); const ResultMedia = ({ url, style: s }) => _isVideoUrl(url) ?