Flutter-AssetsAudioPlayer icon indicating copy to clipboard operation
Flutter-AssetsAudioPlayer copied to clipboard

PlayInBackground.disabledRestoreOnForeground does not work in first use

Open l-giza opened this issue 3 years ago • 4 comments

Flutter Version

My version : 2.5.3

Lib Version

My version : 3.0.3+6

Platform (Android / iOS / web) + version

Platform : Android - Pixel 3 (emulator) API 31, iPhone 13 (emulator)

Describe the bug

When I start a music, I want it to be played only when user is in my app. When he switches to another one (or in general - when my app is not the topmost one) I want it to be paused. And then when app goes back to foreground I need it to be resumed.

To achieve that I use PlayInBackground.disabledRestoreOnForeground setting in player.Open method. It works generally fine EXCEPT the first try after starting the music. When I use "Overview" button on android device and switch to another one, the music is still playing. Then i go back to my app and switch to another one once again - and since then pausing works correctly. The same behavior is on IOS.

l-giza avatar Nov 08 '21 07:11 l-giza

I have the same problem, using Pixel 4 API 30

Svaly avatar Nov 16 '21 07:11 Svaly

The same issue iPhone12 :/

AndrzejKoziel avatar Nov 16 '21 07:11 AndrzejKoziel

same on iPhone11 iOS 15, any chances this could be fixed soon? thanks!

kowann avatar Nov 16 '21 11:11 kowann

The same for me on Pixel 4 API 30 :(

tomeksabramowicz avatar Nov 16 '21 14:11 tomeksabramowicz