termux-api icon indicating copy to clipboard operation
termux-api copied to clipboard

Media notifications should be controllable through headset controls

Open redcathode opened this issue 2 years ago • 2 comments

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.

redcathode avatar May 28 '22 05:05 redcathode

Seconding, this would be extremely useful. Would it be as simple as implementing and registering a MediaButtonReceiver for Termux API?

aeblyve avatar Sep 10 '23 21:09 aeblyve

for the time being I use termux-tasker for things like that

sp4rkie avatar Sep 11 '23 04:09 sp4rkie