rjapenga
rjapenga

Reputation: 107

How to connect just_audio_background 0.0.1-beta.13 to bluetooth headset clicks for next and previous

I am using just_audio_background and cannot see how to integrate audio_service to receive the bluetooth headset skiptoNext and skiptoPrevious track buttons. The play/pause are handled in my app fine because they apparently are handled under the hood - ie I don't have to do anything special with play/pause. I have a rolling text that follows the audio so I cannot just use what is under the hood for next and previous. So I want to manage next and previous notifications from a headset myself which means I need to be able to be notified when they are pushed.

I have tried innumerable things - all wrong apparently because they don't work. There is something I am missing. For one, I loaded the audio_service example. It works fine. My headset buttons (like they do in my app) change the volume. But that is happening under the hood because neither the logging or breakpoints of the set volume code are active on button push. (This code is in the example's common.dart).

BTW - I am attempting to handle the headset with audio_service 0.18.15 from ryan (thanks for all your hard work) which from the looks of it has what I need (and more!).

Frankly being somewhat new to Flutter (I am porting my React Native app to Flutter), the audio_service example is a bit daunting as it has more than I need but I am not sure what I need from it. Specifically common.dart seems to have everything. But I cannot seem to put breakpoints or get the logs out when I get button clicks.

Thanks in advance

Upvotes: 0

Views: 36

Answers (0)

Related Questions