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 && (
|
||||
<div className="absolute inset-0 bg-red-500/5 flex items-center justify-center">
|
||||
<div
|
||||
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 className="absolute inset-0 bg-[#fcb0ba1a] flex items-center justify-center">
|
||||
<img src={error_image.src} alt="error" className="w-12 h-12" />
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
@ -623,10 +614,18 @@ export const MediaViewer = React.memo(function MediaViewer({
|
||||
)}
|
||||
</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={{
|
||||
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"}>
|
||||
@ -641,6 +640,30 @@ export const MediaViewer = React.memo(function MediaViewer({
|
||||
/>
|
||||
</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去编辑 按钮 */}
|
||||
<Tooltip placement="top" title="Edit video with chat">
|
||||
<GlassIconButton icon={MessageCircleMore} size='sm' onClick={() => {
|
||||
@ -659,17 +682,6 @@ export const MediaViewer = React.memo(function MediaViewer({
|
||||
setIsLoadingDownloadAllVideosBtn(false);
|
||||
}} />
|
||||
</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 && (
|
||||
<Tooltip placement="top" title='Go to AI-powered editing platform'>
|
||||
@ -677,8 +689,9 @@ export const MediaViewer = React.memo(function MediaViewer({
|
||||
</Tooltip>
|
||||
)}
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
{/* 操作按钮组 */}
|
||||
{/* <AnimatePresence>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user