diff --git a/client/components/app/StreamContainer.vue b/client/components/app/StreamContainer.vue index 5775cf27..cdd144fb 100644 --- a/client/components/app/StreamContainer.vue +++ b/client/components/app/StreamContainer.vue @@ -377,6 +377,10 @@ export default { libraryItem, episodeId }) + this.$nextTick(() => { + if (this.$refs.audioPlayer) this.$refs.audioPlayer.checkUpdateChapterTrack() + }) + this.playerHandler.load(libraryItem, episodeId, true, this.initialPlaybackRate) }, pauseItem() { diff --git a/client/components/player/PlayerUi.vue b/client/components/player/PlayerUi.vue index 608f33ca..c23c9f9f 100644 --- a/client/components/player/PlayerUi.vue +++ b/client/components/player/PlayerUi.vue @@ -226,6 +226,13 @@ export default { }) this.updateTimestamp() }, + checkUpdateChapterTrack() { + // Changing media in player may not have chapters + if (!this.chapters.length && this.useChapterTrack) { + this.useChapterTrack = false + if (this.$refs.trackbar) this.$refs.trackbar.setUseChapterTrack(this.useChapterTrack) + } + }, seek(time) { this.$emit('seek', time) }, @@ -286,7 +293,10 @@ export default { }, init() { this.playbackRate = this.$store.getters['user/getUserSetting']('playbackRate') || 1 - this.useChapterTrack = this.$store.getters['user/getUserSetting']('useChapterTrack') || false + + var _useChapterTrack = this.$store.getters['user/getUserSetting']('useChapterTrack') || false + this.useChapterTrack = this.chapters.length ? _useChapterTrack : false + if (this.$refs.trackbar) this.$refs.trackbar.setUseChapterTrack(this.useChapterTrack) this.$emit('setPlaybackRate', this.playbackRate) },