forked from 77media/video-flow
fix: resolve .env.development merge conflict and prefer movieflow.ai endpoints
This commit is contained in:
parent
8b697c4152
commit
43bf001e76
@ -1,8 +1,17 @@
|
||||
|
||||
|
||||
<<<<<<< Updated upstream
|
||||
NEXT_PUBLIC_JAVA_URL = https://77.app.java.auth.qikongjian.com
|
||||
# NEXT_PUBLIC_JAVA_URL = http://192.168.120.83:8080
|
||||
NEXT_PUBLIC_BASE_URL = https://77.smartvideo.py.qikongjian.com
|
||||
NEXT_PUBLIC_CUT_URL = https://smartcut.huiying.video
|
||||
=======
|
||||
# NEXT_PUBLIC_JAVA_URL = https://77.app.java.auth.qikongjian.com
|
||||
# NEXT_PUBLIC_BASE_URL = https://77.smartvideo.py.qikongjian.com
|
||||
# NEXT_PUBLIC_CUT_URL = https://smartcut.huiying.video
|
||||
NEXT_PUBLIC_JAVA_URL = https://auth.movieflow.ai
|
||||
NEXT_PUBLIC_BASE_URL = https://api.video.movieflow.ai
|
||||
NEXT_PUBLIC_CUT_URL = https://smartcut.movieflow.ai
|
||||
>>>>>>> Stashed changes
|
||||
# 失败率
|
||||
NEXT_PUBLIC_ERROR_CONFIG = 0.1
|
||||
@ -1,15 +1,14 @@
|
||||
"use client"
|
||||
import React, { useRef, useEffect, useCallback } from "react";
|
||||
import "./style/work-flow.css";
|
||||
import { Skeleton } from "@/components/ui/skeleton";
|
||||
|
||||
import { EditModal } from "@/components/ui/edit-modal";
|
||||
import { TaskInfo } from "./work-flow/task-info";
|
||||
import { MediaViewer } from "./work-flow/media-viewer";
|
||||
import { ThumbnailGrid } from "./work-flow/thumbnail-grid";
|
||||
import { useWorkflowData } from "./work-flow/use-workflow-data";
|
||||
import { usePlaybackControls } from "./work-flow/use-playback-controls";
|
||||
import { AlertCircle, RefreshCw, Pause, Play, ChevronLast, ChevronsLeft, Bot, BriefcaseBusiness, Scissors } from "lucide-react";
|
||||
import { motion } from "framer-motion";
|
||||
import { Bot, TestTube } from "lucide-react";
|
||||
import { GlassIconButton } from '@/components/ui/glass-icon-button';
|
||||
import { SaveEditUseCase } from "@/app/service/usecase/SaveEditUseCase";
|
||||
import { useSearchParams } from "next/navigation";
|
||||
@ -17,6 +16,7 @@ import SmartChatBox from "@/components/SmartChatBox/SmartChatBox";
|
||||
import { Drawer, Tooltip, notification } from 'antd';
|
||||
import { showEditingNotification } from "@/components/pages/work-flow/editing-notification";
|
||||
import { AIEditingIframeButton } from './work-flow/ai-editing-iframe';
|
||||
import { exportVideoWithRetry } from '@/utils/export-service';
|
||||
|
||||
const WorkFlow = React.memo(function WorkFlow() {
|
||||
useEffect(() => {
|
||||
@ -36,8 +36,7 @@ const WorkFlow = React.memo(function WorkFlow() {
|
||||
const [previewVideoUrl, setPreviewVideoUrl] = React.useState<string | null>(null);
|
||||
const [previewVideoId, setPreviewVideoId] = React.useState<string | null>(null);
|
||||
const [isFocusChatInput, setIsFocusChatInput] = React.useState(false);
|
||||
const [aiEditingInProgress, setAiEditingInProgress] = React.useState(false);
|
||||
const [isHovered, setIsHovered] = React.useState(false);
|
||||
|
||||
const [aiEditingResult, setAiEditingResult] = React.useState<any>(null);
|
||||
const aiEditingButtonRef = useRef<{ handleAIEditing: () => Promise<void> }>(null);
|
||||
const [editingStatus, setEditingStatus] = React.useState<'initial' | 'idle' | 'success' | 'error'>('initial');
|
||||
@ -66,7 +65,7 @@ const WorkFlow = React.memo(function WorkFlow() {
|
||||
console.log('✨ 编辑计划生成完成,开始AI剪辑');
|
||||
setIsHandleEdit(true);
|
||||
setEditingStatus('idle');
|
||||
setIsEditingInProgress(true);
|
||||
// setIsEditingInProgress(true); // 已移除该状态变量
|
||||
isEditingInProgressRef.current = true;
|
||||
|
||||
aiEditingButtonRef.current?.handleAIEditing();
|
||||
@ -123,7 +122,7 @@ const WorkFlow = React.memo(function WorkFlow() {
|
||||
const handleExportFailed = useCallback(() => {
|
||||
console.log('Export failed, setting error status');
|
||||
setEditingStatus('error');
|
||||
setIsEditingInProgress(false);
|
||||
// setIsEditingInProgress(false); // 已移除该状态变量
|
||||
isEditingInProgressRef.current = false;
|
||||
|
||||
// 销毁当前编辑通知
|
||||
@ -219,15 +218,40 @@ const WorkFlow = React.memo(function WorkFlow() {
|
||||
// 切换到最终视频阶段
|
||||
setAnyAttribute('currentStage', 'final_video');
|
||||
|
||||
setAiEditingInProgress(false);
|
||||
// setAiEditingInProgress(false); // 已移除该状态变量
|
||||
}, [setAnyAttribute]);
|
||||
|
||||
const handleAIEditingError = useCallback((error: string) => {
|
||||
console.error('❌ AI剪辑失败:', error);
|
||||
// 这里可以显示错误提示
|
||||
setAiEditingInProgress(false);
|
||||
// setAiEditingInProgress(false); // 已移除该状态变量
|
||||
}, []);
|
||||
|
||||
// 测试导出接口的处理函数(使用封装的导出服务)
|
||||
const handleTestExport = useCallback(async () => {
|
||||
console.log('🧪 开始测试导出接口...');
|
||||
console.log('📊 当前taskObject状态:', {
|
||||
currentStage: taskObject.currentStage,
|
||||
videosCount: taskObject.videos?.data?.length || 0,
|
||||
completedVideos: taskObject.videos?.data?.filter(v => v.video_status === 1).length || 0
|
||||
});
|
||||
|
||||
try {
|
||||
// 使用封装的导出服务
|
||||
const result = await exportVideoWithRetry(episodeId, taskObject);
|
||||
console.log('🎉 导出服务完成,结果:', result);
|
||||
return result;
|
||||
} catch (error) {
|
||||
console.error('❌ 导出服务失败:', error);
|
||||
throw error;
|
||||
}
|
||||
}, [episodeId, taskObject]);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// iframe智能剪辑回调函数
|
||||
const handleIframeAIEditingComplete = useCallback((result: any) => {
|
||||
console.log('🎉 iframe AI剪辑完成,结果:', result);
|
||||
@ -244,17 +268,17 @@ const WorkFlow = React.memo(function WorkFlow() {
|
||||
// 切换到最终视频阶段
|
||||
setAnyAttribute('currentStage', 'final_video');
|
||||
|
||||
setAiEditingInProgress(false);
|
||||
// setAiEditingInProgress(false); // 已移除该状态变量
|
||||
}, [setAnyAttribute]);
|
||||
|
||||
const handleIframeAIEditingError = useCallback((error: string) => {
|
||||
console.error('❌ iframe AI剪辑失败:', error);
|
||||
setAiEditingInProgress(false);
|
||||
// setAiEditingInProgress(false); // 已移除该状态变量
|
||||
}, []);
|
||||
|
||||
const handleIframeAIEditingProgress = useCallback((progress: number, message: string) => {
|
||||
console.log(`📊 AI剪辑进度: ${progress}% - ${message}`);
|
||||
setAiEditingInProgress(true);
|
||||
// setAiEditingInProgress(true); // 已移除该状态变量
|
||||
}, []);
|
||||
|
||||
return (
|
||||
@ -342,6 +366,20 @@ const WorkFlow = React.memo(function WorkFlow() {
|
||||
)
|
||||
}
|
||||
|
||||
{/* 测试导出接口按钮 - 简化显示条件方便测试 */}
|
||||
<div
|
||||
className="fixed right-[1rem] bottom-[16rem] z-[49]"
|
||||
>
|
||||
<Tooltip title="测试剪辑计划导出接口" placement="left">
|
||||
<GlassIconButton
|
||||
icon={TestTube}
|
||||
size='md'
|
||||
onClick={handleTestExport}
|
||||
className="backdrop-blur-lg"
|
||||
/>
|
||||
</Tooltip>
|
||||
</div>
|
||||
|
||||
{/* 智能对话按钮 */}
|
||||
<div
|
||||
className="fixed right-[1rem] bottom-[10rem] z-[49]"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user