Closed appcapsergen closed 9 months ago
Hello, your bug report does not follow the instructions. The two options were to either indicate the bug is reproduced via the unmodified official example, OR fork the official example and make minimal modifications to it to reproduce the bug.
My apologies, I've made a new issue for this https://github.com/ryanheise/audio_service/issues/1058
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs, or use StackOverflow if you need help with audio_service.
Documented behaviour
Could not find anything related since I don't get an error or anything, the audio session just doesn't close.
Actual behaviour
In my Flutter app the user is able to play a video, I use the
chewie
package for this. This player uses aVideoPlayerController
(from thevideo_player
package) to somewhat control the video player, which ultimately allows me to use theaudio_service
package to create an audio session. I use this to continue playing the video when the app is paused (in the background or when the phone is locked).The problem I'm faced with now is that when I've started a video with background audio playback successfully, but then want to close that video, I can't seem to get the audio session to stop as well. This is especially visible on iOS (like in this screenshot), where the media player stays active even though I shut down the video and attempted to shut down the audio session as well.
Runtime error
There's no error, audio session just doesn't close.
Minimal reproduction project
Official example: main.dart
Here's my audio handler, I basically close the audio handler by calling
resetVideoFunctions
. I have tried multiple things though, like closing/disposing themediaItem
, closing/disposing the player state, closing/disposing thestreamController
, closing/disposing the video controller, etc., etc... Nothing worksMyAudioHandler
```dart class MyAudioHandler extends BaseAudioHandler { StreamControllerReproduction steps
Output of flutter doctor
• No issues found!