amazon-music-linux icon indicating copy to clipboard operation
amazon-music-linux copied to clipboard

Media play/pause gets lost

Open goodfront opened this issue 7 years ago • 11 comments

Nice little app! I found that if the app is in the background the media play/pause key stops working.

I'm using Ubuntu 18.04, Gnome 3.28.3.

The media play/pause key works fine for Clementine and other media players. I imagine this is a little more tricky.

goodfront avatar Sep 17 '18 19:09 goodfront

@goodfront Thank you for creating this issue. I experienced this also once. I'll take a look into this but this could also be an electron thing.

flokol120 avatar Sep 17 '18 19:09 flokol120

It could be my Bluetooth headset throwing things off. I'll keep playing around with it and see if I can find a pattern.

goodfront avatar Sep 17 '18 19:09 goodfront

@goodfront You are right with that for sure. I think this happened to me, when my OS locked itself.

flokol120 avatar Sep 17 '18 19:09 flokol120

i can comment on this one too, it will work initially, got some dedicated media keys, all of em works fine when you launch the app, but i think it will stops working when lock the desktop and login again or came back from a sleep state. i thought it was just me. not sure these are related, anyways i'll check again and let you know.

ajithrn avatar Sep 28 '18 22:09 ajithrn

I did a similar project and didn't get it working. I'm using Gnome on Arch i can help you testing it. I got an solution for ubuntu but that didn't worked for Arch.

danieldaeschle avatar Oct 27 '18 15:10 danieldaeschle

I'm on Debian (Cinnamon DE), and I noticed two things:

  1. When the app is in the background, the previous and next actions (pressing play/pause twice for next, thrice for previous) works. But play/pause single click somehow doesn't work.
  2. If I right click on the app icon in the dock, then all controls work fine.

I'd love to investigate, but I need a starting point for this. Can someone help? @flokol120

siddhanthgupta avatar Jan 09 '19 09:01 siddhanthgupta

@siddhanthgupta regarding no. 1: I am not quite sure what you mean by pressing play/pause twice or thrice. Pressing the media key twice or thrice only pauses/plays the song two/three times.

regarding no. 2: The tray controls do not have anything to do with this issue. This issue is about the registration of the media keys (play/pause, skip and previous) are somehow getting lost, apparently because of a sleep state. This issue may be related to electron but if you happen to find a fix/workaround feel free to contribute.

flokol120 avatar Jan 09 '19 11:01 flokol120

I have the same issue. Play/Pause and Next/Prev song does not work.

Play works when the app is launched, but if minimize it to the icon try, it will never work again, even if you show the app again.

Next/prev Song does not work

xkill avatar Jan 10 '19 16:01 xkill

@xkill What you are describing seems not to be related with this issue. please start the player via the console by executing amazon-music-linux and reply with what is printed out to the console window. Please also provide your Distro.

flokol120 avatar Jan 10 '19 19:01 flokol120

$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 18.10
Release:	18.10
Codename:	cosmic
$ amazon-music-linux 
mediaplaypause registered!
medianexttrack registered!
mediaprevioustrack registered!
mediastop registered!
listening on *:3000

Now was not able to reproduce the bug with the play/pause button, but next/prev track are not working. I checked that the buttons are working fine with Rhythmbox (I closed Rhythmbox before opening amazon-music-player)

xkill avatar Jan 11 '19 10:01 xkill

@xkill once a media key is registered, electron cannot override it. Probably you had some program opened which only grabbed the next and previous key. If you you happen to experience this bug again, please open a new issue.

flokol120 avatar Jan 11 '19 10:01 flokol120