diff --git a/components/pages/work-flow/media-viewer.tsx b/components/pages/work-flow/media-viewer.tsx index 5c579de..d005b41 100644 --- a/components/pages/work-flow/media-viewer.tsx +++ b/components/pages/work-flow/media-viewer.tsx @@ -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 = () => (
@@ -484,6 +492,16 @@ export const MediaViewer = React.memo(function MediaViewer({ } }} /> + {/* 下载按钮 */} + + { + const currentVideo = taskObject.videos.data[currentSketchIndex]; + if (currentVideo && currentVideo.urls && currentVideo.urls.length > 0) { + downloadVideo(currentVideo.urls[0]); + } + }} /> + + {/* 跳转剪辑按钮 */} {showGotoCutButton && (