From 83315aa7f506a96755011a6c359f2571478b4ea8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9D=9E=E5=87=A1=E4=B8=BB=E5=84=BF?= <15541157+extraordinary-lord@user.noreply.gitee.com> Date: Thu, 16 Oct 2025 16:14:32 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E9=A6=96=E5=B8=A7=E9=A2=84=E8=A7=88bug?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/script_episode.ts | 1 + components/pages/create-to-video2.tsx | 19 ++++++++++++++++--- 2 files changed, 17 insertions(+), 3 deletions(-) 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)} /> ) : (