fix(playbackmanager): remove hack for keeping status as playing

This commit is contained in:
Fernando Fernández 2021-01-18 11:44:00 +01:00
parent 326c7a7320
commit ce8cb5052d
2 changed files with 5 additions and 4 deletions

View File

@ -4,7 +4,7 @@
autoplay
@timeupdate="onAudioProgress"
@pause="onAudioPause"
@play="onAudioProgress"
@play="onPlay"
@ended="onAudioStopped"
></audio>
</template>
@ -133,6 +133,7 @@ export default Vue.extend({
...mapActions('snackbar', ['pushSnackbarMessage']),
...mapActions('playbackManager', [
'pause',
'unpause',
'setNextTrack',
'setMediaSource',
'setCurrentTime',
@ -189,6 +190,9 @@ export default Vue.extend({
}
}
},
onPlay(_event?: Event): void {
this.unpause();
},
onAudioProgress(_event?: Event): void {
if (this.$refs.audioPlayer) {
const currentTime = (this.$refs.audioPlayer as HTMLAudioElement)

View File

@ -193,9 +193,6 @@ export const mutations: MutationTree<PlaybackManagerState> = {
{ time }: { time: number | null }
) {
state.currentTime = time;
// Sometimes, the PlaybackStatus was being reported as stopped. We set it as playing again here
// at every time report.
state.status = PlaybackStatus.playing;
},
CHANGE_CURRENT_TIME(
state: PlaybackManagerState,