From f2fff34d4d0e3071c147ef8573e7b9f01e962ab8 Mon Sep 17 00:00:00 2001 From: Alex Maras Date: Sat, 25 Jun 2022 23:37:18 +0800 Subject: [PATCH] fix: use chapter start as a base for the seek time if seeking within chapters --- client/components/player/PlayerTrackBar.vue | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/client/components/player/PlayerTrackBar.vue b/client/components/player/PlayerTrackBar.vue index f96e4f3e..506c34dd 100644 --- a/client/components/player/PlayerTrackBar.vue +++ b/client/components/player/PlayerTrackBar.vue @@ -83,8 +83,9 @@ export default { var offsetX = e.offsetX var perc = offsetX / this.trackWidth - const duration = this.useChapterTrack ? this.currentChapterDuration : this.duration - var time = perc * duration + const baseTime = this.useChapterTrack ? this.currentChapterStart : 0; + const duration = this.useChapterTrack ? this.currentChapterDuration : this.duration; + var time = baseTime + (perc * duration); if (isNaN(time) || time === null) { console.error('Invalid time', perc, time) return