fluttercommunity / fluttercommunity/chewie
Cannot exit fullscreen programmatically
- Dominant language
- Dart
- Stars
- 2.1k
- Forks
- 1.1k
- Avg merge
- 6d 8h
- Merged PRs (30d)
- 6
Description
I create a chewie player that defaults to fullscreen. I register a listener with the VideoPlayerController, and use it to exit fullscreen automatically once the video has nearly finished. However, exiting fullscreen doesn't work. The controls and the status bar briefly appear, then disappear again, and the video remains fullscreen. It does this repeatedly because chewieController.isFullScreen remains true, so it keeps calling exitFullScreen() repeatedly.
Here's how I set up the ChewieController:
```
chewieController = ChewieController(
videoPlayerController: videoPlayerController,
aspectRatio: 16 / 9,
autoPlay: true,
fullScreenByDefault: true,
looping: false,
);
```
Here's the VideoPlayerController's listener:
```
static final VoidCallback videoPlayerListener = ()
{
if ((chewieController != null) && (videoPlayerController != null) && (chewieController.isFullScreen) && (videoPlayerController.value.position >= Duration(seconds: 234))) {
chewieController.exitFullScreen();
}
}
};
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.