summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoriza <59828082+izadoesdev@users.noreply.github.com>2025-06-25 16:01:02 +0300
committerGitHub <noreply@github.com>2025-06-25 16:01:02 +0300
commit9ba57d86b60140e251e94c8fce955376bee6c5b1 (patch)
treec2d2aeee8982bf998906f73439a3507421e19e62
parent92a8466368ba6a04bc4a66399456753940911f68 (diff)
parentd9fcef93852d84a8f95778cef535fcd7233418a0 (diff)
downloadopencut-9ba57d86b60140e251e94c8fce955376bee6c5b1.tar.gz
Merge pull request #100 from DevloperAmanSingh/fix/timeline-redbar-fix
Fix: Reset playhead to start after video ends
-rw-r--r--apps/web/src/stores/playback-store.ts6
1 files changed, 6 insertions, 0 deletions
diff --git a/apps/web/src/stores/playback-store.ts b/apps/web/src/stores/playback-store.ts
index 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 start
state.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