This commit is contained in:
ct
2025-06-16 23:16:10 +08:00
parent 4220709b57
commit ef2871a983
6 changed files with 142 additions and 19 deletions

View File

@@ -518,13 +518,17 @@ const VideoEditor = ({ width, height }) => {
emitter.on('video-play', handlePlay);
emitter.on('video-reset', handleReset);
emitter.on('video-seek', handleSeek);
emitter.on('text-update', ({ elementId, updates }) => {
handleElementUpdate(elementId, updates);
});
return () => {
emitter.off('video-play', handlePlay);
emitter.off('video-reset', handleReset);
emitter.off('video-seek', handleSeek);
emitter.off('text-update');
};
}, [emitter, handlePlay, handleReset, handleSeek]);
}, [emitter, handlePlay, handleReset, handleSeek, handleElementUpdate]);
return (
<div style={{ width: dimensions.width, height: dimensions.height }} className="rounded-3xl">