googlearchive/android-MediaBrowserService

play/pause in nexus6p cannot work

mmm2006 opened this issue · 1 comments

I just test app in my nexus 6p(android7.0). It can only work one loop(pause and then play), after that, operation in headset will not take effect at all.
It is playing, but we get KEYCODE_MEDIA_PLAY in onMediaButtonEvent(). Do you know reason for that?
log:
MusicService: AudioControlService->onMediaButtonEvent()keycode: 126 ;key: 0 ;active: true

Thanks.

Hello, I suggest looking at the "UAMP" sample: https://github.com/googlesamples/android-UniversalMusicPlayer.

The UAMP sample contains a MediaBrowserService implementation that works with more Android features.
https://android-developers.googleblog.com/2018/06/a-new-universal-music-player.html
https://medium.com/androiddevelopers/making-the-uamp-sample-an-instant-app-30c3f0a050af

If you still see this issue in the UAMP sample, please open an issue there. Thank you!