Sithira / FlutterRadioPlayer

Flutter Radio Player, A Plugin to handle streaming audio without a hassle
MIT License
139 stars 64 forks source link

In android 9 the notification does not close when the app closes. #21

Closed cjamcu closed 2 years ago

cjamcu commented 4 years ago

I have noticed that in android 9 when the app is closed the music continues to run since the notification is still open.

Sithira commented 4 years ago

Hi, @cjamcu that's the default behavior of ExoPlayer on a Foreground service. You should stop the player manually by the notification bar.

What is your point of view?

cjamcu commented 4 years ago

When users close the application, the notification must be removed and thus the Foreground service stops. In versions lower than Android 9 if it has this behavior.

Sithira commented 4 years ago

I think this is doable with a Flutter life-cycle event. It's just a matter of calling the StreamingCore's stop method. That will detach the notification making the foreground service stop

afkcodes commented 4 years ago

how can we add metas for notification ? like images and track metadata ? @Sithira @cjamcu

Sithira commented 4 years ago

how can we add metas for notification? like images and track metadata ? @Sithira @cjamcu

You mean like dynamic content? Dynamic images?

JanStorm commented 3 years ago

@cjamcu idk if this is the problem you were facing, but the foreground service should definitely stop when the app gets destroyed. Like in Android when i remove app from "recent apps" list. is this the problem you mentioned?

Sithira commented 2 years ago

Has been updated to v2. Please check the master branch