diff --git a/api/video_flow.ts b/api/video_flow.ts index beccef3..43bdf45 100644 --- a/api/video_flow.ts +++ b/api/video_flow.ts @@ -665,6 +665,16 @@ export const regenerateShot = async (request: { return post("/movie/regenerate_shot_video", request); }; +// 重新生成视频 +export const regenerateVideo = async (request: { + /** 项目ID */ + project_id: string; + /** 视频ID */ + video_id: string; +}): Promise> => { + return post("/movie_cut/regenerate_video", request); +}; + /** * 获取分镜列表 diff --git a/components/pages/work-flow.tsx b/components/pages/work-flow.tsx index 52e3846..14f2f84 100644 --- a/components/pages/work-flow.tsx +++ b/components/pages/work-flow.tsx @@ -139,6 +139,7 @@ const WorkFlow = React.memo(function WorkFlow() { taskObject={taskObject} currentSketchIndex={currentSketchIndex} onSketchSelect={setCurrentSketchIndex} + onRetryVideo={handleRetryVideo} /> )} diff --git a/components/pages/work-flow/media-viewer.tsx b/components/pages/work-flow/media-viewer.tsx index bde8956..5c579de 100644 --- a/components/pages/work-flow/media-viewer.tsx +++ b/components/pages/work-flow/media-viewer.tsx @@ -430,10 +430,14 @@ export const MediaViewer = React.memo(function MediaViewer({ {taskObject.videos.data[currentSketchIndex].video_status === 2 && (
- - Retry + { + const video = taskObject.videos.data[currentSketchIndex]; + if (onRetryVideo && video?.video_id) { + onRetryVideo(video.video_id); + } + }} />
)} @@ -442,7 +446,7 @@ export const MediaViewer = React.memo(function MediaViewer({ {/* 视频 多个 取第一个 */} - { taskObject.videos.data[currentSketchIndex].urls && ( + { taskObject.videos.data[currentSketchIndex].urls && taskObject.videos.data[currentSketchIndex].urls.length > 0 && ( <> applyVolumeSettings(mainVideoRef.current!)} onEnded={() => { if (isVideoPlaying) { // 自动切换到下一个视频的逻辑在父组件处理 @@ -471,17 +474,6 @@ export const MediaViewer = React.memo(function MediaViewer({
- {/* 重试按钮 */} - {taskObject.videos.data[currentSketchIndex].video_status === 2 && ( - - { - const video = taskObject.videos.data[currentSketchIndex]; - if (onRetryVideo && video?.video_id) { - onRetryVideo(video.video_id); - } - }} /> - - )} {/* 添加到chat去编辑 按钮 */} { diff --git a/components/pages/work-flow/thumbnail-grid.tsx b/components/pages/work-flow/thumbnail-grid.tsx index 106c43d..4e86a09 100644 --- a/components/pages/work-flow/thumbnail-grid.tsx +++ b/components/pages/work-flow/thumbnail-grid.tsx @@ -12,13 +12,15 @@ interface ThumbnailGridProps { taskObject: TaskObject; currentSketchIndex: number; onSketchSelect: (index: number) => void; + onRetryVideo: (video_id: string) => void; } export function ThumbnailGrid({ isDisabledFocus, taskObject, currentSketchIndex, - onSketchSelect + onSketchSelect, + onRetryVideo }: ThumbnailGridProps) { const thumbnailsRef = useRef(null); const [isDragging, setIsDragging] = useState(false); @@ -186,19 +188,24 @@ export function ThumbnailGrid({ )} {taskObject.videos.data[index].video_status === 2 && (
-
- +
+
)} - {taskObject.videos.data[index].urls ? ( -