Fix #970: short audio glitch when switching switching to another track with player paused

This commit is contained in:
Eliot Berriot 2019-12-26 15:35:13 +01:00
parent 7c8b592f61
commit 0d3df8ab77
No known key found for this signature in database
GPG key ID: 6B501DFD73514E14
4 changed files with 7 additions and 12 deletions

View file

@ -361,7 +361,7 @@ export default {
self.ended()
},
onunlock: function () {
if (self.$store.state.player.playing) {
if (self.$store.state.player.playing && self.sound) {
self.soundId = self.sound.play(self.soundId)
}
},
@ -581,13 +581,11 @@ export default {
}
this.currentSound = this.getSound(trackData)
this.$store.commit('player/isLoadingAudio', true)
if (this.playing) {
this.soundId = this.currentSound.play()
this.$store.commit('player/errored', false)
this.$store.commit('player/playing', true)
this.$store.dispatch('player/updateProgress', 0)
this.observeProgress(true)
}
this.soundId = this.currentSound.play()
this.$store.commit('player/errored', false)
this.$store.commit('player/playing', true)
this.$store.dispatch('player/updateProgress', 0)
this.observeProgress(true)
}
},
toggleMobilePlayer () {