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

playlistFinished event is triggering onData even before the song has completed #805

Open
ishitajoshi-splash opened this issue Sep 28, 2023 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@ishitajoshi-splash
Copy link

Flutter Version

My version : 3.3.10

Lib Version

My version : 3.0.6

Platform (Android / iOS / web) + version

Platform : web

Describe the bug
playlistFinished is calling onData function before the audio is finished.

Small code to reproduce

//Stop speaking once the audio is finished
    AssetsAudioPlayer player = AssetsAudioPlayer.newPlayer();

      player?.open(Audio.network(audioPath), autoStart: true);
      player?.playlistFinished.listen((finished) {
        print("[log][audio] finished: $finished audio: : $audioPath");

        if (finished == true) {
          audioPlayerCallback(splashRiveVm);
          setState(() {
            audioReadyToPlay = false;
          });
        }
      }, 
      onDone: () {
        print('done');
         audioPlayerCallback(splashRiveVm);
          setState(() {
            audioReadyToPlay = false;
          });
      },
      
      onError: (error) {
        print('[log][audio][error]$error');

        GlobalExceptionHandler().reportError(error, StackTrace.current);
        audioPlayerCallback(splashRiveVm);
      });
@ishitajoshi-splash ishitajoshi-splash added the bug Something isn't working label Sep 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants