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)?
Asked
Active
Viewed 18 times
0
-
can you include sample code snippet that will reproduce the same issue ? – Md. Yeasin Sheikh Aug 04 '23 at 16:25
1 Answers
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
-
Thanks for answer if I don't find other solution I will do like that) – Tony Stark Aug 05 '23 at 07:53