didChangeAppLifecycleState method
Handle audio lifecycle changes.
Implementation
@override
void didChangeAppLifecycleState(AppLifecycleState state) {
if (state == AppLifecycleState.paused) {
_appPaused = true;
if (_playing && !_playInBackground) {
_pauseNative();
}
} else if (state == AppLifecycleState.resumed) {
_appPaused = false;
if (_playing && !_playInBackground) {
_playNative(false, _endpointSeconds);
}
}
}