fix: Auto Edit no longer throws "setCompositionParams is not defined"
handleAutoEdit referenced setCompositionParams and setShowPreviewModal — neither exists in ResultCard, leftovers from a prior refactor. Align it with handleSubtitle/handleHook: accumulate the generated effects into activeLayers and re-render the clip via renderInBrowser. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
42ca76c48b
commit
9575b774d0
1 changed files with 11 additions and 2 deletions
|
|
@ -88,8 +88,17 @@ export default function ResultCard({ clip, index, jobId, uploadPostKey, uploadUs
|
||||||
if (effectsRes.ok) {
|
if (effectsRes.ok) {
|
||||||
const data = await effectsRes.json();
|
const data = await effectsRes.json();
|
||||||
if (data.effects && data.effects.segments) {
|
if (data.effects && data.effects.segments) {
|
||||||
setCompositionParams(prev => ({ ...prev, effects: data.effects }));
|
const newLayers = { ...activeLayers, effects: data.effects };
|
||||||
setShowPreviewModal(true);
|
setActiveLayers(newLayers);
|
||||||
|
const blobUrl = await renderInBrowser({
|
||||||
|
videoUrl: originalVideoUrl,
|
||||||
|
durationInSeconds: clipDuration,
|
||||||
|
subtitles: newLayers.subtitles,
|
||||||
|
hook: newLayers.hook,
|
||||||
|
effects: newLayers.effects,
|
||||||
|
});
|
||||||
|
setCurrentVideoUrl(blobUrl);
|
||||||
|
if (videoRef.current) videoRef.current.load();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue