From f2ea608a493e05a31d5d08b56793411593fce918 Mon Sep 17 00:00:00 2001 From: chme Date: Sun, 30 Dec 2018 08:53:40 +0100 Subject: [PATCH] [web-src] Stop playback if playing a stream or a pipe forked-daapd can not pause playback from a stream or a pipe and returns an error and aborts playback in that case. This works around this issue by stopping playback if the now playing item is a stream or a pipe. --- web-src/src/components/PlayerButtonPlayPause.vue | 10 ++++++++-- web-src/src/webapi/index.js | 4 ++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/web-src/src/components/PlayerButtonPlayPause.vue b/web-src/src/components/PlayerButtonPlayPause.vue index 32ad3ac7..7b6ecb3a 100644 --- a/web-src/src/components/PlayerButtonPlayPause.vue +++ b/web-src/src/components/PlayerButtonPlayPause.vue @@ -1,6 +1,6 @@ @@ -15,13 +15,19 @@ export default { computed: { is_playing () { return this.$store.state.player.state === 'play' + }, + + is_pause_allowed () { + return this.$store.getters.now_playing && this.$store.getters.now_playing.data_kind !== 'url' && this.$store.getters.now_playing.data_kind !== 'pipe' } }, methods: { toggle_play_pause: function () { - if (this.is_playing) { + if (this.is_playing && this.is_pause_allowed) { webapi.player_pause() + } else if (this.is_playing && !this.is_pause_allowed) { + webapi.player_stop() } else { webapi.player_play() } diff --git a/web-src/src/webapi/index.js b/web-src/src/webapi/index.js index fe387e9e..a733392a 100644 --- a/web-src/src/webapi/index.js +++ b/web-src/src/webapi/index.js @@ -91,6 +91,10 @@ export default { return axios.put('/api/player/pause') }, + player_stop () { + return axios.put('/api/player/stop') + }, + player_next () { return axios.put('/api/player/next') },