forked from 77media/video-flow
优化 重生分镜 交互
This commit is contained in:
parent
83e264f5e2
commit
b6e230b937
@ -57,9 +57,10 @@ export const ShotTabContent = (props: ShotTabContentProps) => {
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (pendingRegeneration) {
|
if (pendingRegeneration) {
|
||||||
console.log('pendingRegeneration', pendingRegeneration, shotData[selectedIndex]?.lens);
|
console.log('pendingRegeneration', pendingRegeneration, shotData[selectedIndex]?.lens);
|
||||||
regenerateVideoSegment();
|
regenerateVideoSegment().then(() => {
|
||||||
setPendingRegeneration(false);
|
setPendingRegeneration(false);
|
||||||
setIsRegenerate(false);
|
setIsRegenerate(false);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}, [pendingRegeneration]);
|
}, [pendingRegeneration]);
|
||||||
|
|
||||||
@ -243,12 +244,12 @@ export const ShotTabContent = (props: ShotTabContentProps) => {
|
|||||||
whileHover={{ scale: 1.02 }}
|
whileHover={{ scale: 1.02 }}
|
||||||
whileTap={{ scale: 0.98 }}
|
whileTap={{ scale: 0.98 }}
|
||||||
>
|
>
|
||||||
{shot.status === 0 && (
|
{(shot.status === 0 || shot.videoUrl.length === 0) && (
|
||||||
<div className="w-full h-full flex items-center justify-center">
|
<div className="w-full h-full flex items-center justify-center">
|
||||||
<Loader2 className="w-4 h-4 animate-spin text-blue-500" />
|
<Loader2 className="w-4 h-4 animate-spin text-blue-500" />
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
{shot.status === 1 && shot.videoUrl[0] ? (
|
{shot.status === 1 && shot.videoUrl[0] && (
|
||||||
<video
|
<video
|
||||||
src={shot.videoUrl[0].video_url}
|
src={shot.videoUrl[0].video_url}
|
||||||
key={shot.videoUrl[0].video_url}
|
key={shot.videoUrl[0].video_url}
|
||||||
@ -259,10 +260,6 @@ export const ShotTabContent = (props: ShotTabContentProps) => {
|
|||||||
onMouseEnter={(e) => e.currentTarget.play()}
|
onMouseEnter={(e) => e.currentTarget.play()}
|
||||||
onMouseLeave={(e) => e.currentTarget.pause()}
|
onMouseLeave={(e) => e.currentTarget.pause()}
|
||||||
/>
|
/>
|
||||||
) : (
|
|
||||||
<div className="w-full h-full flex items-center justify-center bg-red-500/10">
|
|
||||||
<CircleX className="w-4 h-4 text-red-500" />
|
|
||||||
</div>
|
|
||||||
)}
|
)}
|
||||||
{/* 任务失败 */}
|
{/* 任务失败 */}
|
||||||
{shot.status === 2 && (
|
{shot.status === 2 && (
|
||||||
@ -397,7 +394,7 @@ export const ShotTabContent = (props: ShotTabContentProps) => {
|
|||||||
</motion.div>
|
</motion.div>
|
||||||
)}
|
)}
|
||||||
</AnimatePresence>
|
</AnimatePresence>
|
||||||
{(shotData[selectedIndex]?.status === 2 || !shotData[selectedIndex]?.videoUrl.length) && (
|
{(shotData[selectedIndex]?.status === 2) && (
|
||||||
<div className="w-full h-full flex gap-1 items-center justify-center rounded-lg bg-red-500/10">
|
<div className="w-full h-full flex gap-1 items-center justify-center rounded-lg bg-red-500/10">
|
||||||
<CircleX className="w-4 h-4 text-red-500" />
|
<CircleX className="w-4 h-4 text-red-500" />
|
||||||
<span className="text-white/50">Failed, click to regenerate</span>
|
<span className="text-white/50">Failed, click to regenerate</span>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user