viki
viki

Reputation: 627

How to stop the video player from playing when moving from one page to another

I am using video_player package for displaying a video. I have written the video player inside separate class. The issue is, during the video playing, when I try to close the page by pressing back button, a bottomsheet will be presented on the screen. After clicking on the bottom sheet, the user will be navigated to another page. During this process, the audio from the video_player is heard.

If we are not using bottomsheet and directly pressing backbutton, the video_player is properly disposed.

Have anyone encountered this scenario before?

Upvotes: 1

Views: 1032

Answers (1)

Sugan Pandurengan
Sugan Pandurengan

Reputation: 723

Try calling pop() before navigating to new page from bottom sheet.

Keep me posted.

Upvotes: 3

Related Questions