Baseflow / XamarinMediaManager

Cross platform Xamarin plugin to play and control Audio and Video
https://baseflow.com
MIT License
768 stars 305 forks source link

How to make sure the audio session has terminated and my app can go suspended? #798

Open adams-family opened 3 years ago

adams-family commented 3 years ago

MediaManager plug-in works very nice with playing background audio. Even on iOS, when background audio is playing, my UI timers keep running indefinitely, they can fetch HTTP data, update media info, etc.

However, even if the user stops playing audio (I call CrossMediaManager.Current.Stop()) my timers still keep running when I minimize the iOS app. Of course, I can try to stop all timers manually (and hope not to forget for one) but I still don't know whether that is a guarantee that my app will go suspended and stop consuming energy from the iPhone's battery.

Is there a 'right' way how to terminate the Audio session?