forked from 77media/video-flow
失败展示
This commit is contained in:
parent
0e09519633
commit
aac7ccb4e0
@ -559,17 +559,8 @@ export const MediaViewer = React.memo(function MediaViewer({
|
|||||||
)}
|
)}
|
||||||
{/* 生成失败 */}
|
{/* 生成失败 */}
|
||||||
{taskObject.videos.data[currentSketchIndex].video_status === 2 && (
|
{taskObject.videos.data[currentSketchIndex].video_status === 2 && (
|
||||||
<div className="absolute inset-0 bg-red-500/5 flex items-center justify-center">
|
<div className="absolute inset-0 bg-[#fcb0ba1a] flex items-center justify-center">
|
||||||
<div
|
<img src={error_image.src} alt="error" className="w-12 h-12" />
|
||||||
className="text-[#813b9dcc] text-2xl font-bold flex items-center gap-2"
|
|
||||||
>
|
|
||||||
<RotateCcw className="w-10 h-10 cursor-pointer" onClick={() => {
|
|
||||||
const video = taskObject.videos.data[currentSketchIndex];
|
|
||||||
if (onRetryVideo && video?.video_id) {
|
|
||||||
onRetryVideo(video.video_id);
|
|
||||||
}
|
|
||||||
}} />
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
@ -623,23 +614,55 @@ export const MediaViewer = React.memo(function MediaViewer({
|
|||||||
)}
|
)}
|
||||||
</motion.div>
|
</motion.div>
|
||||||
|
|
||||||
{/* 跳转剪辑按钮 */}
|
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{/* 操作按钮组 */}
|
||||||
|
{
|
||||||
|
taskObject.videos.data[currentSketchIndex].video_status !== 0 && (
|
||||||
<div className="absolute top-2 right-2 z-[21] flex items-center gap-2 transition-right duration-100" style={{
|
<div className="absolute top-2 right-2 z-[21] flex items-center gap-2 transition-right duration-100" style={{
|
||||||
right: aspectRatio === '16:9' ? toosBtnRight : ''
|
right: aspectRatio === '16:9' ? toosBtnRight : ''
|
||||||
}}>
|
}}>
|
||||||
{/* 视频编辑模式切换按钮 - 通过服务器配置控制显示 */}
|
{taskObject.videos.data[currentSketchIndex].video_status === 1 ? (
|
||||||
{enableVideoEdit && showVideoModification && (
|
<>
|
||||||
<Tooltip placement="top" title={isVideoEditMode ? "Exit edit mode" : "Enter edit mode"}>
|
{/* 视频编辑模式切换按钮 - 通过服务器配置控制显示 */}
|
||||||
<GlassIconButton
|
{enableVideoEdit && showVideoModification && (
|
||||||
icon={PenTool}
|
<Tooltip placement="top" title={isVideoEditMode ? "Exit edit mode" : "Enter edit mode"}>
|
||||||
size='sm'
|
<GlassIconButton
|
||||||
onClick={() => {
|
icon={PenTool}
|
||||||
console.log('🖊️ 钢笔图标被点击,切换编辑模式:', !isVideoEditMode);
|
size='sm'
|
||||||
setIsVideoEditMode(!isVideoEditMode);
|
onClick={() => {
|
||||||
}}
|
console.log('🖊️ 钢笔图标被点击,切换编辑模式:', !isVideoEditMode);
|
||||||
className={isVideoEditMode ? 'bg-blue-500/20 border-blue-500/50' : ''}
|
setIsVideoEditMode(!isVideoEditMode);
|
||||||
/>
|
}}
|
||||||
</Tooltip>
|
className={isVideoEditMode ? 'bg-blue-500/20 border-blue-500/50' : ''}
|
||||||
|
/>
|
||||||
|
</Tooltip>
|
||||||
|
)}
|
||||||
|
|
||||||
|
<Tooltip placement="top" title="Download video">
|
||||||
|
<GlassIconButton icon={Download} loading={isLoadingDownloadBtn} size='sm' onClick={async () => {
|
||||||
|
const currentVideo = taskObject.videos.data[currentSketchIndex];
|
||||||
|
if (currentVideo && currentVideo.urls && currentVideo.urls.length > 0) {
|
||||||
|
setIsLoadingDownloadBtn(true);
|
||||||
|
await downloadVideo(currentVideo.urls[0]);
|
||||||
|
setIsLoadingDownloadBtn(false);
|
||||||
|
}
|
||||||
|
}} />
|
||||||
|
</Tooltip>
|
||||||
|
</>
|
||||||
|
) : (
|
||||||
|
<>
|
||||||
|
<Tooltip placement="top" title="Regenerate video">
|
||||||
|
<GlassIconButton icon={RotateCcw} size='sm' onClick={() => {
|
||||||
|
const video = taskObject.videos.data[currentSketchIndex];
|
||||||
|
if (onRetryVideo && video?.video_id) {
|
||||||
|
onRetryVideo(video.video_id);
|
||||||
|
}
|
||||||
|
}} />
|
||||||
|
</Tooltip>
|
||||||
|
</>
|
||||||
)}
|
)}
|
||||||
{/* 添加到chat去编辑 按钮 */}
|
{/* 添加到chat去编辑 按钮 */}
|
||||||
<Tooltip placement="top" title="Edit video with chat">
|
<Tooltip placement="top" title="Edit video with chat">
|
||||||
@ -659,17 +682,6 @@ export const MediaViewer = React.memo(function MediaViewer({
|
|||||||
setIsLoadingDownloadAllVideosBtn(false);
|
setIsLoadingDownloadAllVideosBtn(false);
|
||||||
}} />
|
}} />
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
{/* 下载按钮 */}
|
|
||||||
<Tooltip placement="top" title="Download video">
|
|
||||||
<GlassIconButton icon={Download} loading={isLoadingDownloadBtn} size='sm' onClick={async () => {
|
|
||||||
const currentVideo = taskObject.videos.data[currentSketchIndex];
|
|
||||||
if (currentVideo && currentVideo.urls && currentVideo.urls.length > 0) {
|
|
||||||
setIsLoadingDownloadBtn(true);
|
|
||||||
await downloadVideo(currentVideo.urls[0]);
|
|
||||||
setIsLoadingDownloadBtn(false);
|
|
||||||
}
|
|
||||||
}} />
|
|
||||||
</Tooltip>
|
|
||||||
{/* 跳转剪辑按钮 */}
|
{/* 跳转剪辑按钮 */}
|
||||||
{showGotoCutButton && (
|
{showGotoCutButton && (
|
||||||
<Tooltip placement="top" title='Go to AI-powered editing platform'>
|
<Tooltip placement="top" title='Go to AI-powered editing platform'>
|
||||||
@ -677,8 +689,9 @@ export const MediaViewer = React.memo(function MediaViewer({
|
|||||||
</Tooltip>
|
</Tooltip>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</>
|
)
|
||||||
)}
|
}
|
||||||
|
|
||||||
|
|
||||||
{/* 操作按钮组 */}
|
{/* 操作按钮组 */}
|
||||||
{/* <AnimatePresence>
|
{/* <AnimatePresence>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user