Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

flutter

How to check audio is completed or not?

On finished change icon from pause to play.

like image 741
Sanskardham Gurukul Avatar asked Oct 24 '25 14:10

Sanskardham Gurukul


1 Answers

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

      audioPlayer.playerStateStream.listen((state) {
        if (state.processingState == ProcessingState.completed) {
          onComplete();
        }
      });
like image 51
Netharu Methmitha Avatar answered Oct 26 '25 05:10

Netharu Methmitha