Open davecraig opened 3 days ago
In order to get the media control button input it looks like we'll need to make our SoundscapeService a MediaSessionService see https://developer.android.com/media/media3/session/background-playback. I've started work on a branch named media-transport-controls
on my fork. To create a MediaSession we also need a dummy media player. This all seems rather hard work for what we need so I've put it aside and will mull it over and confer.
I got this one from the tutorials. The text there is:
Obviously we can ignore the mention of Apple here and support whatever we can via Android. The tutorial goes on to explain that you can access the following features in Soundscape using the media control buttons on your headphones:
⏯ Play/Pause: Mute any current callouts and if the audio beacon is set, toggle the beacon audio.
⏭ Next: Callout "My Location".
⏮ Previous: Repeat last callout.
⏩ Skip Forward: Toggle callouts On and Off.
⏪ Skip Backward: Callout "Around Me".
The interaction will be with the soundscape foreground service as it needs to work when the phone is locked. We should also support and test external media controls e.g. https://www.amazon.co.uk/dp/B07JQ8Q6X6.