diff --git a/.changeset/controller-finish-flag.md b/.changeset/controller-finish-flag.md new file mode 100644 index 0000000000..567e5db44e --- /dev/null +++ b/.changeset/controller-finish-flag.md @@ -0,0 +1,6 @@ +--- +'rrweb-player': patch +'rrweb': patch +--- + +Reset the finished flag in Controller `goto` instead of `handleProgressClick` so that it is properly handled if `goto` is called directly. diff --git a/packages/rrweb-player/src/Controller.svelte b/packages/rrweb-player/src/Controller.svelte index 57d323133e..5a352e6dd0 100644 --- a/packages/rrweb-player/src/Controller.svelte +++ b/packages/rrweb-player/src/Controller.svelte @@ -208,6 +208,7 @@ export const goto = (timeOffset: number, play?: boolean) => { currentTime = timeOffset; pauseAt = false; + finished = false; const resumePlaying = typeof play === 'boolean' ? play : playerState === 'playing'; if (resumePlaying) { @@ -250,7 +251,6 @@ percent = 1; } const timeOffset = meta.totalTime * percent; - finished = false; goto(timeOffset); };