Open rphm opened 2 months ago
If I call pause manually like this, the playerState is set back to false as expected
_audioPlayer.playerStateStream.listen((playerState) async {
print('playerState: ${playerState.toString()}');
if(playerState.processingState == ProcessingState.completed) {
await _audioPlayer.pause();
}
});
I/flutter (19434): playerState: playing=true,processingState=ProcessingState.completed
I/flutter (19434): playerState: playing=false,processingState=ProcessingState.completed
Which API doesn't behave as documented, and how does it misbehave?
The
playerStateStream
in the just_audio package is not updating theplaying
state tofalse
after a playlist has completed. It remains true even though theprocessingState
is correctly set toProcessingState.completed
.Minimal reproduction project
The example
To Reproduce (i.e. user steps, not code)
1) Run the
example_playlist.dart
example with break point at line364
(Commit: b5fad794dee004a9cb92804fce6fcb12d025a0f8) 3) Select the last item in the playlist. 4) Wait for the item to complete playback. 5) Observe that the playerStateStream showsplaying=true
andprocessingState=ProcessingState.completed
.Error messages
Expected behavior After the last item in a playlist completes playback, the
playerStateStream
should update to showplaying=false
andprocessingState=ProcessingState.completed
Desktop (please complete the following information):
Smartphone (please complete the following information):
Flutter SDK version