Merge pull request #100 from DevloperAmanSingh/fix/timeline-redbar-fix

Fix: Reset playhead to start after video ends
This commit is contained in:
iza
2025-06-25 16:01:02 +03:00
committed by GitHub

View File

@ -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