chewie icon indicating copy to clipboard operation
chewie copied to clipboard

Listener callBack is not being invoked.

Open safield opened this issue 4 years ago • 2 comments

I am trying to detect when a Chewie video is playing, and when it is not playing, so I can add a text overlay to the video only when it is not playing. I am using the built in chewie video controls UI.

I have added a listener by calling addListener() on the ChewieController...

_controller.addListener(() {
      if (_isPlaying != _controller.isPlaying) {
        setState(() { _isPlaying = _controller.isPlaying; });
      }
});

This call back is not being invoked when the video state changes (play button is push, or pause button is pushed).

safield avatar Apr 27 '21 20:04 safield

It will only get invoked when you hook your listener to the VideoController instead. Adding listener to ChewieController won't work.

Tak1za avatar Sep 10 '22 10:09 Tak1za