Merge branch 'bugfix_1016' into dev

This commit is contained in:
非凡主儿 2025-10-16 16:42:10 +08:00
commit f680e7c002
2 changed files with 17 additions and 3 deletions

View File

@ -77,6 +77,7 @@ export interface MovieProject {
final_video_url: string; final_video_url: string;
final_simple_video_url: string; final_simple_video_url: string;
video_urls: string; video_urls: string;
video_snapshot_url?: string;
last_message: string; last_message: string;
updated_at: string; updated_at: string;
created_at: string; created_at: string;

View File

@ -294,6 +294,21 @@ export default function CreateToVideo2() {
onDownloadAll: ()=>{} 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 计算纵横比 // 根据 aspect_ratio 计算纵横比
const getAspectRatio = () => { const getAspectRatio = () => {
switch (project.aspect_ratio) { switch (project.aspect_ratio) {
@ -333,9 +348,7 @@ export default function CreateToVideo2() {
loop loop
playsInline playsInline
preload="auto" preload="auto"
poster={ poster={getPosterUrl(project)}
getFirstFrame(project.final_video_url || project.final_simple_video_url || project.video_urls || '', 300)
}
/> />
) : ( ) : (
<div <div