Skip to content
This repository has been archived by the owner on Sep 7, 2024. It is now read-only.

Commit

Permalink
fix: progress slider sync
Browse files Browse the repository at this point in the history
  • Loading branch information
kamiya10 committed Apr 29, 2024
1 parent 783eda6 commit be5612e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/components/replay/ReplayController.vue
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,15 @@ watch(
}
);
const slidestart = () => {
syncProgress.value = false;
};
const slideend = () => {
syncProgress.value = true;
emit("seek", sliderProgress.value);
};
const endReplay = () => {
router.back();
};
Expand All @@ -59,7 +68,8 @@ const endReplay = () => {
:class="{ loaded: !loading }"
:min="0"
:max="frames"
@slideend="() => emit('seek', sliderProgress)"
@change="slidestart"
@slideend="slideend"
/>
</div>
<div class="replay-actions">
Expand Down
1 change: 1 addition & 0 deletions src/view/ReplayView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ const scheduleNextFrame = () => {
player = window.setTimeout(() => {
if (isPlaying.value) {
currentFrame.value++;
progress.value = (currentFrame.value / replayData.value.length) * 100;
player = null;
scheduleNextFrame();
} else {
Expand Down

0 comments on commit be5612e

Please sign in to comment.