xbmc / Kore

Kore is a simple and easy-to-use Kodi remote.
Apache License 2.0
644 stars 244 forks source link

[Feature request] Act as media player by receiving Media Buttons intents #784

Open ljl-covid opened 3 years ago

ljl-covid commented 3 years ago

Other Android apps that provide media playing and typically a notification with play/pause and seek buttons, like Kore can, are able to receive Intent.ACTION_MEDIA_BUTTON and register for them and react.

I would like Kore to behave the same way, even though the playback is not (necessarily) happening locally.

Use case

Other applications, like in my case the open source Gadgetbridge, are able to send "fake" media button events in order to trigger playback or other actions, based on events relevant to the user. In my particular use case, Gadgetbridge is able to detect when the user falls asleep, and can stop playback of media apps when that happens. However, it is unable to do so with Kore due to the fact it doesn't behave like a media player.

Possible Implementation

This line in the Gadgetbridge source code shows the actual intent being registered. I believe this is the relevant Android documentation for implementing this functionality.

bishtawi commented 3 years ago

Another good usecase for properly supporting media notification controls is integration with KDE Connect. Currently I can use KDE Connect to control the media playing on my phone. It would be if it could also interface with Kore to remotely control Kodi.