flutter_sound
flutter_sound copied to clipboard
[HELP]: Stop Audio when app goes to Background
Is there a way to stop audio playing when the user leaves the app?
A clue how to achieve it is that i read in this issue that Android API as a parameter that can be set: https://github.com/Canardoux/tau/issues/341
I also see mentions about background audio playback here https://github.com/Canardoux/tau/issues/525 and here https://github.com/Canardoux/tau/issues/600 yet I cant find how to turn it off
You could use the WidgetsBindingObserver mixin and override the didChangeAppLifecycleState method and check if the app has switched to the background, and pause/stop playback when desired.
This issue is stale because it has been open 90 days with no activity. Leave a comment or this will be closed in 7 days.