I found a bug, that the music stops playing as soon you start listen or read the volume. This happens because the default category don't allow to mix music with other apps. Now, when for example Spotify is playing the music will not stop playing on both events.
That's why I added the Category ambient to the AVAudioSession. Also, to have only one instance, I provide the session to both models.
I found a bug, that the music stops playing as soon you start listen or read the volume. This happens because the default category don't allow to mix music with other apps. Now, when for example Spotify is playing the music will not stop playing on both events.
That's why I added the Category ambient to the AVAudioSession. Also, to have only one instance, I provide the session to both models.
For reading: https://developer.apple.com/documentation/avfaudio/avaudiosessioncategory
Ambient:
Maybe, for a better use case : enable to set the options from Flutter?