oja / amazon-music-linux

linux desktop player for amazon music
Mozilla Public License 2.0
46 stars 16 forks source link

Media play/pause gets lost #16

Open goodfront opened 6 years ago

goodfront commented 6 years ago

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.

flokol120 commented 6 years ago

@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.

goodfront commented 6 years ago

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

flokol120 commented 6 years ago

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

ajithrn commented 6 years ago

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.

danieldaeschle commented 6 years ago

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.

siddhanthgupta commented 5 years ago

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

flokol120 commented 5 years ago

@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.

xkill commented 5 years ago

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

flokol120 commented 5 years ago

@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.

xkill commented 5 years ago
$ 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)

flokol120 commented 5 years ago

@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.