From 067006f4065e82eb20b5e057497d66dc182ce143 Mon Sep 17 00:00:00 2001 From: Alex Maras Date: Sat, 25 Jun 2022 23:24:40 +0800 Subject: [PATCH 1/2] fix: use chapter duration when seeking on track bar --- client/components/player/PlayerTrackBar.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/client/components/player/PlayerTrackBar.vue b/client/components/player/PlayerTrackBar.vue index 84f8f729..f96e4f3e 100644 --- a/client/components/player/PlayerTrackBar.vue +++ b/client/components/player/PlayerTrackBar.vue @@ -83,7 +83,8 @@ export default { var offsetX = e.offsetX var perc = offsetX / this.trackWidth - var time = perc * this.duration + const duration = this.useChapterTrack ? this.currentChapterDuration : this.duration + var time = perc * duration if (isNaN(time) || time === null) { console.error('Invalid time', perc, time) return From f2fff34d4d0e3071c147ef8573e7b9f01e962ab8 Mon Sep 17 00:00:00 2001 From: Alex Maras Date: Sat, 25 Jun 2022 23:37:18 +0800 Subject: [PATCH 2/2] 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