pod_player icon indicating copy to clipboard operation
pod_player copied to clipboard

Is there any callback for when the video ends?

Open jatinhemnani01 opened this issue 2 years ago • 3 comments

jatinhemnani01 avatar Aug 13 '22 07:08 jatinhemnani01

As of now there's no callback for this.. But you can listen to video using controller.addListner

newtaDev avatar Aug 15 '22 15:08 newtaDev

can you give a simple example for this. I would really appreciate it. Thank in advanced.

thivankasarathchandra avatar Aug 20 '22 07:08 thivankasarathchandra

Hello, you can make it like this example,


  @override
  void initState() {
    controller = PodPlayerController(
        playVideoFrom: widget.url,
      ..initialise();
    controller.addListener(() {
      if (controller.currentVideoPosition == controller.totalVideoLength) {
        if (controller.isFullScreen) {
          controller.disableFullScreen(context);
        }
      }
    });
    super.initState();
  }

furkankurt avatar Apr 02 '23 18:04 furkankurt