How to check Audio is finished or not in just audio library?

Viewed 552

How to check audio is completed or not?

On finished change icon from pause to play.

2 Answers

there is a way to listen to state changes you can use that

      audioPlayer.playerStateStream.listen((state) {
        if (state.processingState == ProcessingState.completed) {
          onComplete();
        }
      });
Related