forked from 77media/video-flow
Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
df4754a044
@ -1,7 +1,7 @@
|
||||
"use client";
|
||||
|
||||
import { useState, useEffect, useRef, useCallback } from 'react';
|
||||
import { ArrowLeft, ListOrdered, Play, Loader2, Pause, MoreHorizontal, Edit2, Check, X, RefreshCw, Calendar, Clock, Eye, Heart, Share2, Video } from 'lucide-react';
|
||||
import { ArrowLeft, ListOrdered, Play, Loader2, Pause, MoreHorizontal, Edit2, Check, X, RefreshCw, Calendar, Clock, Eye, Heart, Share2, Video, Pencil, Trash } from 'lucide-react';
|
||||
import { useRouter, useSearchParams } from 'next/navigation';
|
||||
import './style/create-to-video2.css';
|
||||
|
||||
@ -9,6 +9,7 @@ import { getScriptEpisodeListNew } from "@/api/script_episode";
|
||||
import { ChatInputBox } from '@/components/ChatInputBox/ChatInputBox';
|
||||
import cover_image1 from '@/public/assets/cover_image1.jpg';
|
||||
import { motion } from 'framer-motion';
|
||||
import { Tooltip, Button } from 'antd';
|
||||
|
||||
|
||||
// ideaText已迁移到ChatInputBox组件中
|
||||
@ -167,7 +168,7 @@ export default function CreateToVideo2() {
|
||||
return (
|
||||
<div
|
||||
key={project.project_id}
|
||||
className="group flex flex-col bg-black/20 rounded-lg overflow-hidden cursor-pointer"
|
||||
className="group flex flex-col bg-black/20 rounded-lg overflow-hidden cursor-pointer hover:bg-white/5 transition-all duration-300"
|
||||
onClick={() => router.push(`/movies/work-flow?episodeId=${project.project_id}`)}
|
||||
onMouseEnter={() => handleMouseEnter(project.project_id)}
|
||||
onMouseLeave={() => handleMouseLeave(project.project_id)}
|
||||
@ -202,11 +203,21 @@ export default function CreateToVideo2() {
|
||||
</div>
|
||||
|
||||
{/* 底部信息 */}
|
||||
<div className="p-4">
|
||||
<div className="p-4 group">
|
||||
<div className="flex items-center justify-between">
|
||||
<h2 className="text-sm font-medium text-white line-clamp-1">
|
||||
{/* {project.name || "Unnamed"} */}
|
||||
</h2>
|
||||
<div className="flex items-center gap-2">
|
||||
<h2 className="text-sm font-medium text-white line-clamp-1">
|
||||
{project.name || "Unnamed"}
|
||||
</h2>
|
||||
{/* TODO 编辑标题 */}
|
||||
{/* <Tooltip title="Edit Title">
|
||||
<Button size="small" type="text" className="p-0 hidden group-hover:block transition-all duration-300"><Pencil className="w-4 h-4 text-white" /></Button>
|
||||
</Tooltip> */}
|
||||
</div>
|
||||
{/* TODO 删除 */}
|
||||
{/* <Tooltip title="Delete">
|
||||
<Button size="small" type="text" className="p-0 hidden group-hover:block transition-all duration-300"><Trash className="w-4 h-4 text-white" /></Button>
|
||||
</Tooltip> */}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
|
||||
import React, { useRef, useEffect, useState, SetStateAction, useMemo } from 'react';
|
||||
import { motion, AnimatePresence } from 'framer-motion';
|
||||
import { Edit3, Play, Pause, Volume2, VolumeX, Maximize, Minimize, Loader2, X, Scissors, RotateCcw, MessageCircleMore } from 'lucide-react';
|
||||
import { Edit3, Play, Pause, Volume2, VolumeX, Maximize, Minimize, Loader2, X, Scissors, RotateCcw, MessageCircleMore, Download } from 'lucide-react';
|
||||
import { ProgressiveReveal, presets } from '@/components/ui/progressive-reveal';
|
||||
import { GlassIconButton } from '@/components/ui/glass-icon-button';
|
||||
import { ScriptRenderer } from '@/components/script-renderer/ScriptRenderer';
|
||||
@ -273,6 +273,14 @@ export const MediaViewer = React.memo(function MediaViewer({
|
||||
};
|
||||
}, []);
|
||||
|
||||
// 下载视频
|
||||
const downloadVideo = (url: string) => {
|
||||
const a = document.createElement('a');
|
||||
a.href = url;
|
||||
a.download = url.split('/').pop() || '';
|
||||
a.click();
|
||||
};
|
||||
|
||||
// 渲染音量控制组件
|
||||
const renderVolumeControls = () => (
|
||||
<div className="flex items-center gap-2">
|
||||
@ -484,6 +492,16 @@ export const MediaViewer = React.memo(function MediaViewer({
|
||||
}
|
||||
}} />
|
||||
</Tooltip>
|
||||
{/* 下载按钮 */}
|
||||
<Tooltip placement="top" title="Download video">
|
||||
<GlassIconButton icon={Download} size='sm' onClick={() => {
|
||||
const currentVideo = taskObject.videos.data[currentSketchIndex];
|
||||
if (currentVideo && currentVideo.urls && currentVideo.urls.length > 0) {
|
||||
downloadVideo(currentVideo.urls[0]);
|
||||
}
|
||||
}} />
|
||||
</Tooltip>
|
||||
{/* 跳转剪辑按钮 */}
|
||||
{showGotoCutButton && (
|
||||
<Tooltip placement="top" title='Go to AI-powered editing platform'>
|
||||
<GlassIconButton icon={Scissors} size='sm' onClick={onGotoCut} />
|
||||
|
||||
@ -392,7 +392,7 @@ export function useWorkflowData() {
|
||||
throw new Error(response.message);
|
||||
}
|
||||
|
||||
const { status, data, tags, mode, original_text, title } = response.data;
|
||||
const { status, data, tags, mode, original_text, title, name } = response.data;
|
||||
|
||||
const { current: taskCurrent } = tempTaskObject;
|
||||
|
||||
@ -401,7 +401,7 @@ export function useWorkflowData() {
|
||||
taskCurrent.status = status as Status;
|
||||
|
||||
// 设置标题
|
||||
if (!title) {
|
||||
if (!name) {
|
||||
// 如果没有标题,轮询获取
|
||||
const titleResponse = await getScriptTitle({ project_id: episodeId });
|
||||
console.log('titleResponse', titleResponse);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user