mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-04 22:29:17 +02:00
Properly handle redundant MediaSession play/pause requests
MediaSession pause requests may happen even when Funkwhale is already in a paused state. Previously FW would flip between play/pause without consideration for the current state instead of doing nothing when the playback state matches the requested one. Notably, this made Funkwhale resume audio playback when entering sleep mode on my system.
This commit is contained in:
parent
38f0fd3b60
commit
7900c2d065
4 changed files with 47 additions and 14 deletions
|
@ -96,7 +96,7 @@
|
|||
v-if="!playing"
|
||||
:title="labels.play"
|
||||
:aria-label="labels.play"
|
||||
@click.prevent.stop="togglePlay"
|
||||
@click.prevent.stop="resumePlayback"
|
||||
class="control">
|
||||
<i :class="['ui', 'play', {'disabled': !currentTrack}, 'icon']"></i>
|
||||
</span>
|
||||
|
@ -105,7 +105,7 @@
|
|||
v-else
|
||||
:title="labels.pause"
|
||||
:aria-label="labels.pause"
|
||||
@click.prevent.stop="togglePlay"
|
||||
@click.prevent.stop="pausePlayback"
|
||||
class="control">
|
||||
<i :class="['ui', 'pause', {'disabled': !currentTrack}, 'icon']"></i>
|
||||
</span>
|
||||
|
@ -308,7 +308,8 @@ export default {
|
|||
unmute: "player/unmute",
|
||||
clean: "queue/clean",
|
||||
toggleMute: "player/toggleMute",
|
||||
togglePlay: "player/togglePlay",
|
||||
resumePlayback: "player/resumePlayback",
|
||||
pausePlayback: "player/pausePlayback",
|
||||
}),
|
||||
reorder: function(event) {
|
||||
this.$store.commit("queue/reorder", {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue