Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

playerStateStream not changing playing state after playlist is completed #1328

Open
rphm opened this issue Sep 18, 2024 · 2 comments
Open

playerStateStream not changing playing state after playlist is completed #1328

rphm opened this issue Sep 18, 2024 · 2 comments
Assignees
Labels
1 backlog bug Something isn't working

Comments

@rphm
Copy link

rphm commented Sep 18, 2024

Which API doesn't behave as documented, and how does it misbehave?

The playerStateStream in the just_audio package is not updating the playing state to false after a playlist has completed. It remains true even though the processingState is correctly set to ProcessingState.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 line 364 (Commit: b5fad79)
  2. Select the last item in the playlist.
  3. Wait for the item to complete playback.
  4. Observe that the playerStateStream shows playing=true and processingState=ProcessingState.completed.

Error messages

No errors

Expected behavior
After the last item in a playlist completes playback, the playerStateStream should update to show playing=false and processingState=ProcessingState.completed

Desktop (please complete the following information):

  • not tested

Smartphone (please complete the following information):

  • Device: moto g04s
  • OS: Android 14

Flutter SDK version

[√] Flutter (Channel stable, 3.24.2)
[√] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
@rphm rphm added 1 backlog bug Something isn't working labels Sep 18, 2024
@rphm
Copy link
Author

rphm commented Sep 18, 2024

#783

@rphm
Copy link
Author

rphm commented Sep 18, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1 backlog bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants