From e07e7f70d6c1d5f9522d2f3008e17226bf67109e Mon Sep 17 00:00:00 2001 From: advplyr Date: Mon, 4 Jul 2022 18:42:43 -0500 Subject: [PATCH] Fix:Buffered progress bar for chapter track #250 --- components/app/AudioPlayer.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/app/AudioPlayer.vue b/components/app/AudioPlayer.vue index b1a0c53a..fbbd908d 100644 --- a/components/app/AudioPlayer.vue +++ b/components/app/AudioPlayer.vue @@ -447,7 +447,7 @@ export default { if (this.useChapterTrack && this.currentChapter) { var currChapTime = this.currentTime - this.currentChapter.start percentDone = currChapTime / this.currentChapterDuration - bufferedPercent = (this.bufferedTime - this.currentChapter.start) / this.currentChapterDuration + bufferedPercent = Math.max(0, Math.min(1, (this.bufferedTime - this.currentChapter.start) / this.currentChapterDuration)) } var ptWidth = Math.round(percentDone * this.trackWidth) this.$refs.playedTrack.style.width = ptWidth + 'px'