nstudio / nativescript-audio

:microphone: NativeScript plugin to record and play audio :musical_note:
Other
149 stars 104 forks source link

feat(android): better focus management between multiple players #191

Closed edusperoni closed 2 years ago

edusperoni commented 2 years ago

Introduce AudioFocusManager on android that will manage focus.

When audioMixing is true, player will use a global AudioFocusManager

If the developer doesn't want to handle focus at all, they just need to do player.setAudioFocusManager(null);

This allows for a single instance of focusRequest that will request focus at start and keeps track of when it needs to abandon focus

NathanWalker commented 2 years ago

Excellent @edusperoni 👍 - I think now that this is in we'll then take master and move it over to the plugin workspace here to improve managing this in future: https://github.com/nstudio/nativescript-plugins