forked from 77media/video-flow
Merge branch 'bugfix_1016' into dev
This commit is contained in:
commit
f680e7c002
@ -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;
|
||||||
|
|||||||
@ -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
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user