Youtube_player_flutter: [BUG] Keep loading after video ended

Created on 28 Oct 2020  ·  3Comments  ·  Source: sarbagyastha/youtube_player_flutter

Found out that the player will keep loading after ended the video.

Happened on both Android and iPhone device:
WhatsApp Image 2020-10-28 at 11 37 50

Anyone know how to fix this problem?
Just wanna stop the video, and no more loading screen after.

bug youtube_player_flutter

Most helpful comment

@rebeccalee-ysd, As a workaround, this is what I did.

YoutubePlayer(
      controller: _controller,
      .......
      ........
      onEnded: (metaData) {
        _controller.seekTo(Duration.zero);
        _controller.pause();
        setState(() {

        });
      },
      );

All 3 comments

same thing happened with my app too . keep loading when video ends

bool show = true;
YoutubePlayer(
controller: _controller,
showVideoProgressIndicator: show,
onEnded: (){
setState(() {
show = false;
});
}
)

@rebeccalee-ysd, As a workaround, this is what I did.

YoutubePlayer(
      controller: _controller,
      .......
      ........
      onEnded: (metaData) {
        _controller.seekTo(Duration.zero);
        _controller.pause();
        setState(() {

        });
      },
      );
Was this page helpful?
0 / 5 - 0 ratings