SimpleMobileTools / Simple-Music-Player

A clean music player with a customizable widget, stylish interface and no ads.
https://www.simplemobiletools.com
GNU General Public License v3.0
1.28k stars 407 forks source link

Unable to resume music with headphones hardware button #414

Closed martin-desktops closed 2 years ago

martin-desktops commented 2 years ago

Though pausing music is flawless, I am unable to resume music using a hardware button on my headphones

Conditions: Headphones: JBL Tune 500BT OS: Android 11 App: Simple Music Player 5.11.3

Steps to reproduce:

Expected behaviour (this is how it works in AntennaPod, Spotify, VLC…): Pressing the button again resumes music

Possibly related with: https://github.com/SimpleMobileTools/Simple-Music-Player/issues/395

tibbi commented 2 years ago

does double pressing skip to the next track?

martin-desktops commented 2 years ago

I'm afraid JBL Tune 500BT have Google Assistant/Siri assistants hard coded to double pressing. Though I can skip to the next track by holding the Volume Up button.

tibbi commented 2 years ago

ok, if I send you a test version, can you try it out? You would have to uninstall your current version. You will see some message show up on button press.

martin-desktops commented 2 years ago

Of course!

tibbi commented 2 years ago

ok, here it is. To install the test version first uninstall your current one and allow installing apps from unknown sources in the security settings of your device. Once you download the attachment on your device just remove the ".zip" extension by renaming. Github doesn't allow sending apk files directly for security reasons. After renaming just run it, it should be straightforward. If you cannot find the item related to installing apps from unknown sources, go into the device Settings -> Apps -> Special app access -> Install unknown apps and select your file manager, or the app you use for launching the sent file, then enable the "Allow from this source" item. music-player-core-release.apk.zip

tibbi commented 2 years ago

what messages do you see when pausing and when resume should happen?

martin-desktops commented 2 years ago

On pausing, I see "media 127" message, but on resuming it doesn't either resume music or show any message.

tibbi commented 2 years ago

music-player-core-release.apk.zip how about this? If you still see nothing at resuming, does it work well in other apps? Isnt your system swallowing the action for some reason?

martin-desktops commented 2 years ago

On pausing, the app says "action android.intent.action.MEDIA_BUTTON", but on resuming there is no toast notification again. I am not sure about my system, though it works that way, correctly, in the following apps: VLC, Transistor, ViMusic, AntennaPod, Vinyl, Howl, LibreTube (all of them FLOSS) and Spotify (proprietary).

tibbi commented 2 years ago

try this one please. If it wont work, Ill take a look at it some other day, it might be some bigger issue, not just the button itself. music-player-core-release.apk.zip

martin-desktops commented 2 years ago

Unfortunately the latest build doesn't fix the issue. Thanks for today's struggling

salazarbarrera commented 2 years ago

Just an addition. This used to be my main player, but I had to move to other one because apparently Simple Music Player is invisible regarding media control. Things I've noticed:

Months ago I tried to fix this myself by looking at your code and comparing it to Music Player GO, but I couldn't find any meaningful difference (edit: regarding this issue, of course). I don't know why this player is "invisible" and others aren't.

martin-desktops commented 2 years ago

Just updated to 5.14.0 - play/resume works flawlessly now. Thank you for your support!