termux-api
termux-api copied to clipboard
Media notifications should be controllable through headset controls
Feature description
Media notifications (so, ones made by termux-notification --type media ...
) should be able to be triggered by headset buttons. Currently, pressing the media play/pause button on my headphones doesn't trigger any actions on Termux media notifications, while it toggles playback on most other apps. Although, since playing and pausing are separate actions, maybe it'd be a good idea to make an action specific to the headset pause/play button?
Reference implementation
Have you checked if the feature is accessible through the Android API? https://developer.android.com/reference/android/content/Intent.html#ACTION_MEDIA_BUTTON, I think? Do you know of other open-source apps that has a similar feature as the one you want? (Provide links) Audioserve is one, but most apps (that I've come across) that have media controls support headset controls.
Seconding, this would be extremely useful.
Would it be as simple as implementing and registering a MediaButtonReceiver
for Termux API?
for the time being I use termux-tasker for things like that