forked from 77media/video-flow
Merge branch 'pre' into dev
This commit is contained in:
commit
6ca77aff55
@ -49,6 +49,7 @@ export function ThumbnailGrid({
|
|||||||
behavior: 'smooth'
|
behavior: 'smooth'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
console.log('taskVideos', taskVideos);
|
||||||
}, [currentSketchIndex, taskSketch.length]);
|
}, [currentSketchIndex, taskSketch.length]);
|
||||||
|
|
||||||
// 处理鼠标/触摸拖动事件
|
// 处理鼠标/触摸拖动事件
|
||||||
@ -170,9 +171,9 @@ export function ThumbnailGrid({
|
|||||||
|
|
||||||
// 渲染视频阶段的缩略图
|
// 渲染视频阶段的缩略图
|
||||||
const renderVideoThumbnails = () => (
|
const renderVideoThumbnails = () => (
|
||||||
taskSketch.map((sketch, index) => {
|
taskVideos.map((video, index) => {
|
||||||
const defaultBgColors = ['RGB(45, 50, 70)', 'RGB(75, 80, 100)', 'RGB(105, 110, 130)'];
|
const defaultBgColors = ['RGB(45, 50, 70)', 'RGB(75, 80, 100)', 'RGB(105, 110, 130)'];
|
||||||
const bgColors = sketch?.bg_rgb || defaultBgColors;
|
const bgColors = defaultBgColors;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
@ -185,9 +186,9 @@ export function ThumbnailGrid({
|
|||||||
<div className="w-full h-full transform hover:scale-105 transition-transform duration-500">
|
<div className="w-full h-full transform hover:scale-105 transition-transform duration-500">
|
||||||
<img
|
<img
|
||||||
className={`w-full h-full object-cover transition-all duration-300 ${
|
className={`w-full h-full object-cover transition-all duration-300 ${
|
||||||
(!taskVideos[index] && !isPlaying) ? 'filter blur-sm opacity-60' : ''
|
(!taskSketch[index] && !isPlaying) ? 'filter blur-sm opacity-60' : ''
|
||||||
}`}
|
}`}
|
||||||
src={sketch.url}
|
src={taskSketch[index] ? taskSketch[index].url : video.url}
|
||||||
alt={`Thumbnail ${index + 1}`}
|
alt={`Thumbnail ${index + 1}`}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
@ -236,7 +237,6 @@ export function ThumbnailGrid({
|
|||||||
playsInline
|
playsInline
|
||||||
loop
|
loop
|
||||||
muted
|
muted
|
||||||
poster={sketch.url}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</ProgressiveReveal>
|
</ProgressiveReveal>
|
||||||
@ -249,7 +249,6 @@ export function ThumbnailGrid({
|
|||||||
playsInline
|
playsInline
|
||||||
loop
|
loop
|
||||||
muted
|
muted
|
||||||
poster={sketch.url}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
@ -350,7 +349,7 @@ export function ThumbnailGrid({
|
|||||||
onMouseUp={handleMouseUp}
|
onMouseUp={handleMouseUp}
|
||||||
onMouseLeave={() => setIsDragging(false)}
|
onMouseLeave={() => setIsDragging(false)}
|
||||||
>
|
>
|
||||||
{Number(currentStep) > 2 && Number(currentStep) < 6
|
{Number(currentStep) > 2 && taskVideos.length > 0 && Number(currentStep) < 6
|
||||||
? renderVideoThumbnails()
|
? renderVideoThumbnails()
|
||||||
: renderSketchThumbnails()
|
: renderSketchThumbnails()
|
||||||
}
|
}
|
||||||
|
|||||||
@ -20,6 +20,7 @@ const LOADING_TEXT_MAP = {
|
|||||||
sketchComplete: 'Sketch generation complete',
|
sketchComplete: 'Sketch generation complete',
|
||||||
character: 'Drawing characters...',
|
character: 'Drawing characters...',
|
||||||
newCharacter: (count: number, total: number) => `Drawing character ${count + 1 > total ? total : count + 1}/${total}...`,
|
newCharacter: (count: number, total: number) => `Drawing character ${count + 1 > total ? total : count + 1}/${total}...`,
|
||||||
|
getVideoStatus: 'Getting video status...',
|
||||||
video: (count: number, total: number) => `Generating video ${count + 1 > total ? total : count + 1}/${total}...`,
|
video: (count: number, total: number) => `Generating video ${count + 1 > total ? total : count + 1}/${total}...`,
|
||||||
videoComplete: 'Video generation complete',
|
videoComplete: 'Video generation complete',
|
||||||
audio: 'Generating background audio...',
|
audio: 'Generating background audio...',
|
||||||
@ -135,7 +136,7 @@ export function useWorkflowData() {
|
|||||||
// 角色生成完成
|
// 角色生成完成
|
||||||
finalStep = '3';
|
finalStep = '3';
|
||||||
|
|
||||||
loadingText = LOADING_TEXT_MAP.video(0, sketchCount);
|
loadingText = LOADING_TEXT_MAP.getVideoStatus;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (task.task_name === 'generate_videos' && task.task_result) {
|
if (task.task_name === 'generate_videos' && task.task_result) {
|
||||||
@ -302,7 +303,7 @@ export function useWorkflowData() {
|
|||||||
} else {
|
} else {
|
||||||
finalStep = '3';
|
finalStep = '3';
|
||||||
if (!data.video || !data.video.data || !data.video.data.length) {
|
if (!data.video || !data.video.data || !data.video.data.length) {
|
||||||
loadingText = LOADING_TEXT_MAP.video(0, data.video.total_count || data.sketch.total_count);
|
loadingText = LOADING_TEXT_MAP.getVideoStatus;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user