diff --git a/api/script_episode.ts b/api/script_episode.ts index 490333b..771f8f4 100644 --- a/api/script_episode.ts +++ b/api/script_episode.ts @@ -77,6 +77,7 @@ export interface MovieProject { final_video_url: string; final_simple_video_url: string; video_urls: string; + video_snapshot_url?: string; last_message: string; updated_at: string; created_at: string; diff --git a/components/pages/create-to-video2.tsx b/components/pages/create-to-video2.tsx index ff03a77..f0c1152 100644 --- a/components/pages/create-to-video2.tsx +++ b/components/pages/create-to-video2.tsx @@ -294,6 +294,21 @@ export default function CreateToVideo2() { onDownloadAll: ()=>{} }); }; + + const getPosterUrl = (project: MovieProject): string => { + if (project.video_snapshot_url && project.video_snapshot_url.trim() !== '') { + return project.video_snapshot_url; + } + + //使用getFirstFrame生成 + const videoUrl = project.final_video_url || project.final_simple_video_url || project.video_urls || ''; + if (videoUrl && videoUrl.trim() !== '') { + return getFirstFrame(videoUrl, 300); + } + + return ''; + }; + // 根据 aspect_ratio 计算纵横比 const getAspectRatio = () => { switch (project.aspect_ratio) { @@ -333,9 +348,7 @@ export default function CreateToVideo2() { loop playsInline preload="auto" - poster={ - getFirstFrame(project.final_video_url || project.final_simple_video_url || project.video_urls || '', 300) - } + poster={getPosterUrl(project)} /> ) : (