fix: 匹配素材成功后自动切换镜头并加载播放

This commit is contained in:
小鱼开发
2026-05-21 21:42:04 +08:00
parent 1448cd54ab
commit 582068b599
@@ -323,8 +323,16 @@ export default function VideoGeneration() {
// 处理素材匹配(单个镜头触发匹配)
const handleMatchMaterial = async (shotId: string) => {
const result = await matchSingleMaterial(shotId);
if (result && Number(shotId) === activeScene) {
if (!result) {
return;
}
if (Number(shotId) === activeScene) {
// 当前镜头已激活,直接播放
setPreviewVideoUrl(result.url);
} else {
// 切换到该镜头,useEffect 会自动加载预览
setActiveScene(Number(shotId));
setIsComposedPreview(false);
}
};