0

How to stop the video player when switching to another screen. I have a player and when I move across another screen the video doesn't stop and keeps running because it's still on the stack. I can't _chewieController.pause(); because my widget is in other space I cannot use the player controller there.How to stop it(I can't do Navigator.pop() because need navigate back when user want)?

1 Answers1

0

When everything seems to fail, just create a global variable to be used as a flag for things like this, that can stop your player, whenever you click on an action that leaves the view.

Canilho
  • 944
  • 5
  • 11