From f2ac24e62329753ad0e64ff3fa9ddf6538fc0898 Mon Sep 17 00:00:00 2001 From: mikiher Date: Sun, 13 Oct 2024 10:56:38 +0300 Subject: [PATCH] Fix next/previous chapter behavior on public share player --- client/pages/share/_slug.vue | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/client/pages/share/_slug.vue b/client/pages/share/_slug.vue index 384a9513..f4f93b1d 100644 --- a/client/pages/share/_slug.vue +++ b/client/pages/share/_slug.vue @@ -10,7 +10,7 @@

{{ mediaItemShare.playbackSession.displayAuthor }}

- +
@@ -51,7 +51,8 @@ export default { windowHeight: 0, listeningTimeSinceSync: 0, coverRgb: null, - coverBgIsLight: false + coverBgIsLight: false, + currentTime: 0 } }, computed: { @@ -83,6 +84,9 @@ export default { chapters() { return this.playbackSession.chapters || [] }, + currentChapter() { + return this.chapters.find((chapter) => chapter.start <= this.currentTime && this.currentTime < chapter.end) + }, coverAspectRatio() { const coverAspectRatio = this.playbackSession.coverAspectRatio return coverAspectRatio === this.$constants.BookCoverAspectRatio.STANDARD ? 1.6 : 1 @@ -154,6 +158,7 @@ export default { // Update UI this.$refs.audioPlayer.setCurrentTime(time) + this.currentTime = time }, setDuration() { if (!this.localAudioPlayer) return