mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-07-13 10:55:05 +02:00
Update:Handle multiple sessions open, sync when paused, show alert of multiple sessions open when both are playing #1660
This commit is contained in:
parent
9712bdf5f0
commit
53c96b2540
5 changed files with 44 additions and 10 deletions
|
@ -268,6 +268,10 @@ export default {
|
|||
seek(time) {
|
||||
this.playerHandler.seek(time)
|
||||
},
|
||||
playbackTimeUpdate(time) {
|
||||
// When updating progress from another session
|
||||
this.playerHandler.seek(time, false)
|
||||
},
|
||||
setCurrentTime(time) {
|
||||
this.currentTime = time
|
||||
if (this.$refs.audioPlayer) {
|
||||
|
@ -477,12 +481,14 @@ export default {
|
|||
mounted() {
|
||||
this.$eventBus.$on('cast-session-active', this.castSessionActive)
|
||||
this.$eventBus.$on('playback-seek', this.seek)
|
||||
this.$eventBus.$on('playback-time-update', this.playbackTimeUpdate)
|
||||
this.$eventBus.$on('play-item', this.playLibraryItem)
|
||||
this.$eventBus.$on('pause-item', this.pauseItem)
|
||||
},
|
||||
beforeDestroy() {
|
||||
this.$eventBus.$off('cast-session-active', this.castSessionActive)
|
||||
this.$eventBus.$off('playback-seek', this.seek)
|
||||
this.$eventBus.$off('playback-time-update', this.playbackTimeUpdate)
|
||||
this.$eventBus.$off('play-item', this.playLibraryItem)
|
||||
this.$eventBus.$off('pause-item', this.pauseItem)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue