diff --git a/api/constants.ts b/api/constants.ts index 4abafbc..eb4fbba 100644 --- a/api/constants.ts +++ b/api/constants.ts @@ -1 +1,2 @@ -export const BASE_URL = process.env.NEXT_PUBLIC_API_BASE_URL +export const BASE_URL = "https://77.smartvideo.py.qikongjian.com" +// process.env.NEXT_PUBLIC_API_BASE_URL diff --git a/api/resources.ts b/api/resources.ts index 9b9cbe0..ee7eea0 100644 --- a/api/resources.ts +++ b/api/resources.ts @@ -1,5 +1,4 @@ import { ApiResponse } from './common'; -import { BASE_URL } from './constants'; import { post } from './request'; // 资源列表请求参数 @@ -17,9 +16,9 @@ export interface Resource { script_id: number; created_at: string; } - + // 获取资源列表 - 按创建者筛选 export const getResourcesList = async (data: ResourcesListRequest): Promise> => { - return post>(BASE_URL+'/resources/list', data); -}; \ No newline at end of file + return post>('/resources/list', data); +}; diff --git a/api/video_flow.ts b/api/video_flow.ts index 02cc529..465cce2 100644 --- a/api/video_flow.ts +++ b/api/video_flow.ts @@ -591,7 +591,7 @@ export const generateScriptStream = ( onData: (data: any) => void ): Promise => { return new Promise((resolve, reject) => { - streamJsonPost("/text_to_script/generate_script_stream", request, (data) => { + streamJsonPost("/text_to_script/stream", request, (data) => { switch(data.status) { case 'streaming': onData(data.content); diff --git a/components/pages/work-flow/media-viewer.tsx b/components/pages/work-flow/media-viewer.tsx index 4edb065..e97a251 100644 --- a/components/pages/work-flow/media-viewer.tsx +++ b/components/pages/work-flow/media-viewer.tsx @@ -46,11 +46,11 @@ export function MediaViewer({ }: MediaViewerProps) { const mainVideoRef = useRef(null); const finalVideoRef = useRef(null); - + // 音量控制状态 const [isMuted, setIsMuted] = useState(false); const [volume, setVolume] = useState(0.8); - + // 最终视频控制状态 const [isFinalVideoPlaying, setIsFinalVideoPlaying] = useState(true); const [isFullscreen, setIsFullscreen] = useState(false); @@ -113,7 +113,7 @@ export function MediaViewer({ if (finalVideoRef.current) { setFinalVideoReady(true); applyVolumeSettings(finalVideoRef.current); - + // 如果当前状态是应该播放的,尝试播放 if (isFinalVideoPlaying) { finalVideoRef.current.play().catch(error => { @@ -237,7 +237,7 @@ export function MediaViewer({ onClick={toggleMute} size="sm" /> - + {/* 音量滑块 - 一直显示 */}
@@ -249,11 +249,11 @@ export function MediaViewer({ value={volume} onChange={(e) => handleVolumeChange(parseFloat(e.target.value))} className="w-16 h-1 bg-white/20 rounded-lg appearance-none cursor-pointer - [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:w-3 [&::-webkit-slider-thumb]:h-3 + [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:w-3 [&::-webkit-slider-thumb]:h-3 [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:bg-white [&::-webkit-slider-thumb]:cursor-pointer [&::-webkit-slider-thumb]:shadow-lg - [&::-moz-range-thumb]:w-3 [&::-moz-range-thumb]:h-3 [&::-moz-range-thumb]:rounded-full - [&::-moz-range-thumb]:bg-white [&::-moz-range-thumb]:cursor-pointer + [&::-moz-range-thumb]:w-3 [&::-moz-range-thumb]:h-3 [&::-moz-range-thumb]:rounded-full + [&::-moz-range-thumb]:bg-white [&::-moz-range-thumb]:cursor-pointer [&::-moz-range-thumb]:border-none [&::-moz-range-thumb]:shadow-lg" style={{ background: `linear-gradient(to right, white 0%, white ${volume * 100}%, rgba(255,255,255,0.2) ${volume * 100}%, rgba(255,255,255,0.2) 100%)` @@ -273,9 +273,9 @@ export function MediaViewer({ const finalVideo = final || { url: 'https://cdn.qikongjian.com/videos/1750389908_37d4fffa-8516-43a3-a423-fc0274f40e8a_text_to_video_0.mp4' }; - + return ( -
onControlsChange(true)} @@ -297,12 +297,12 @@ export function MediaViewer({ muted /> - + {/* 最终成片视频 */} )} - + {/* 视频信息浮层 */} - - + {/* 音量控制 */} {renderVolumeControls()} - + {/* 全屏按钮 */} onControlsChange(true)} onMouseLeave={() => onControlsChange(false)} @@ -447,20 +447,20 @@ export function MediaViewer({ {/* 只在生成过程中或没有视频时使用ProgressiveReveal */} {(isGeneratingVideo || !taskVideos[currentSketchIndex]) ? ( taskVideos[currentSketchIndex] ? ( -
- + {/* 视频 */} - + {/* 视频 修复播放没有声音 */} - + {/* 音量控制 */} {renderVolumeControls()} @@ -622,9 +622,9 @@ export function MediaViewer({ const currentSketch = taskSketch[currentSketchIndex]; const defaultBgColors = ['RGB(45, 50, 70)', 'RGB(75, 80, 100)', 'RGB(105, 110, 130)']; const bgColors = currentSketch?.bg_rgb || defaultBgColors; - + return ( -
onControlsChange(true)} onMouseLeave={() => onControlsChange(false)} @@ -634,17 +634,17 @@ export function MediaViewer({ currentSketch ? ( {/* 动态渐变背景 */} - {/* 动态光效 */} - -
) - + ) : ( /* 生成完成后直接显示图片,不使用ProgressiveReveal */ { - scriptData ? ( + mockScriptData ? ( ) : (
@@ -838,4 +838,4 @@ export function MediaViewer({ } return renderSketchContent(); -} \ No newline at end of file +}