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