GPMDP / google-play-music-desktop-remote

A React-Native app to remote control Google Play Music Desktop
192 stars 36 forks source link

[Android] Allow media keys to control playback #18

Closed Kisty closed 6 years ago

Kisty commented 6 years ago

Would be great to enable media keys for playback. I know how to do this in vanilla Android. Is it possible to do so using the Android SDK in the app?

Kisty commented 6 years ago

Oh, apparently it's already implemented, but it doesn't work with swiping two fingers down on my OnePlus. Might I suggest using Android's MediaSession API?

MarshallOfSound commented 6 years ago

We do already use MediaSessionCompat internally

https://github.com/GPMDP/google-play-music-desktop-remote/blob/master/android/app/src/main/java/com/marshallofsound/gpmdp/remote/InternalMediaService.java#L58

Kisty commented 6 years ago

Thanks for getting back. Then why doesn't the two fingers swipe down work to pause/play, then? I'll try and do the same with my bluetooth headphones to see if the issue happens with them

Kisty commented 6 years ago

Hmm, so my bluetooth headphones too are not causing the playback to pause or play. Can you double check this works on your end?

MarshallOfSound commented 6 years ago

This definitely works on my end, I use this every day 😄 Idk what command your headphones are sending out but it isn't going into media sessions 🤔

Kisty commented 6 years ago

Very strange. Thanks for this app and desktop app. Very helpful!

Kisty commented 6 years ago

Still doesn't work. Going to try and build the app and run on an emulator to see if I can repro with that.