florent37 / Flutter-AssetsAudioPlayer

Play simultaneously music/audio from assets/network/file directly from Flutter, compatible with android / ios / web / macos, displays notifications
https://pub.dartlang.org/packages/assets_audio_player
Apache License 2.0
757 stars 370 forks source link

Music stops when the mobile screen off #793

Open Joe2316 opened 1 year ago

Joe2316 commented 1 year ago

I'm working on flutter music player app using assets_audio_player: ^3.1.0

when the mobile screen is off the music player stops working until I turn the mobile screen on again music starts playing how to fix it?

kalismeras61 commented 1 year ago

Please read documentation for background... `NSAppTransportSecurity

NSAllowsArbitraryLoads UIBackgroundModes audio fetch com.apple.security.network.client

`

Joe2316 commented 1 year ago

android:usesCleartextTraffic="true" already in AndroidManifest.xml because the app works on Android only! is there any way to fix this?

kalismeras61 commented 1 year ago

I have no such issues with app continuing to play while my screen is locked. I would recommend checking if you have background restrictions in place for your media apps. Test different devices, make sure you are not on data saver mode etc..

Antivery commented 1 year ago

I am having the same issue using IOS. When I lock the screen or the app is not actively open the audio stops.