The open-source CapCut alternative
fix(playback-store): reset playhead and notify video elements on completion
DevloperAmanSinghd9fcef93852d
diff --git a/apps/web/src/stores/playback-store.ts b/apps/web/src/stores/playback-store.tsindex 0127edff..0cc01cc1 100644--- a/apps/web/src/stores/playback-store.ts+++ b/apps/web/src/stores/playback-store.ts@@ -21,7 +21,13 @@ const startTimer = (store: any) => {const newTime = state.currentTime + delta * state.speed;if (newTime >= state.duration) {+ // When video completes, pause and reset playhead to startstate.pause();+ state.setCurrentTime(0);+ // Notify video elements to sync with reset+ window.dispatchEvent(+ new CustomEvent("playback-seek", { detail: { time: 0 } })+ );} else {state.setCurrentTime(newTime);// Notify video elements to sync