Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mpris commands behave strange (react but time out / no reaction and time out) #2321

Closed
timo opened this issue Mar 16, 2017 · 4 comments
Closed

Comments

@timo
Copy link
Contributor

timo commented Mar 16, 2017

OS:

Fedora 25

Issue Descriptions:

I noticed this when I received a call and KDE Connect didn't pause my music. instead, after the call ends it pauses the music.

I used dbus-monitor to figure out what's going on and here's what i found:

KDEC asks for CanPause, which returns true, then calls Pause which does nothing.

When the call ends, KDEC uses PlayPause instead, which works, and causes the player to stop.

Trying to call the mpris methods manually via busctl (because i can't be arsed to figure out dbus-send) gives me "Connection timed out" for Pause, PlayPause, Next, Previous, Play, and Stop. Out of those commands the only one that does nothing is Pause.

Steps to Reproduce:

Call busctl --user call org.mpris.MediaPlayer2.google-play-music-desktop-player /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player Pause, notice that nothing happens, see that "Connection timed out" appears after a few seconds.

Call busctl --user call org.mpris.MediaPlayer2.google-play-music-desktop-player /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player Stop while music is running, notice that the music immediately stops, see that "Connection timed out" appears after a few seconds.

@timo
Copy link
Contributor Author

timo commented Mar 16, 2017

diff --git a/src/main/features/linux/mprisService.js b/src/main/features/linux/mprisService.js
index dfc8e35..a555222 100644
--- a/src/main/features/linux/mprisService.js
+++ b/src/main/features/linux/mprisService.js
@@ -30,6 +30,12 @@ function mprisService() {
     }
   });
 
+  player.on('pause', () => {
+    if (PlaybackAPI.isPlaying()) {
+      Emitter.sendToGooglePlayMusic('playback:playPause');
+    }
+  });
+
   player.on('playpause', () => {
     Emitter.sendToGooglePlayMusic('playback:playPause');
   });

here's a patch that makes it react to "pause" by pausing the music.

@MarshallOfSound
Copy link
Owner

@timo PR would be great 😄

@jostrander
Copy link
Collaborator

Yeah that's totally an oversight on my part. I was only working with the task bar integrations for cinnamon and gnome which weren't using pause.

@MarshallOfSound
Copy link
Owner

Fixed in #2323

Thanks @timo 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants