0

Anyone know if there's a way to control the buttons on both regular and bluetooth headsets?

I want to use the regular answer button to play/pause the current media that I'm playing through the Ti.Media.AudioPlayer.

I've tried to get the Ti.Android.ACTION_MEDIA_BUTTON to work on Android but without any success the BroadCastListener isn't firing when i press button on either a regular headset or a bluetooth headset.

For iOS I have no clue if this is possible to solve.

Fokke Zandbergen
  • 3,866
  • 1
  • 11
  • 28

1 Answers1

0

On iOS if you set the audioSessionCategory to PLAYBACK and the controls on your headset should interact with the music you're playing.

For Android it looks like you'd need a module to expose a broadcast receiver that would pick up the events as explained here. I couldn't find an existing module that does this already.

Community
  • 1
  • 1
Fokke Zandbergen
  • 3,866
  • 1
  • 11
  • 28