Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Reset the finished flag in goto
If the player finishes a replaying a video the `finished` boolean is set to true. This allows the video to be restarted at the beginning if the controller is toggled again. If a user clicks on the progress bar the `finished` boolean is reset so if the `toggle` API is called it starts at the right place. If a user programatically calls `goto` which is the underlying API that handling the progress click calls the next invocation of `toggle` will start the video at the beginning instead of the proper location.
  • Loading branch information
charliegracie authored Apr 5, 2023
commit c3b7a897dc19b7849c70e17dd715ce2212166054
2 changes: 1 addition & 1 deletion packages/rrweb-player/src/Controller.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -250,7 +251,6 @@
percent = 1;
}
const timeOffset = meta.totalTime * percent;
finished = false;
goto(timeOffset);
};

Expand Down