fluttercommunity / fluttercommunity/chewie

can't exit fullscreen when rotating on iphone 13

Open
#632 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Dart
Stars
2.1k
Forks
1.1k
Avg merge
6d 8h
Merged PRs (30d)
6

Description

Hi,
here is the scenario.
The version of chewie : chewie: ^1.3.0

- I read a video in portrait mode.
- I rotate the Iphone in landscape, then the video enter in fullscreen ( by entering in my code didChangeMetrics)
- I rotate the IPhone to portrait mode, but the video still in landscape mode. ( because we did not enter in didChangeMetrcis)
- When I manually exit the fullscreen, I then rotate, it goes in didChangeMetrics.

Here is the code of the overrided method didChangeMetrics

``` dart
@override
void didChangeMetrics() {
WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
if (_chewieController != null && !widget.isTablet) {
if (MediaQuery.of(context).orientation == Orientation.landscape &&
!_chewieController!.isFullScreen) {
_chewieController!.enterFullScreen();
} else if (MediaQuery.of(context).orientation == Orientation.portrait &&
_chewieController!.isFullScreen) {
_chewieController!.exitFullScreen();
}
}
});
}
```

Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 3.0.0, on Microsoft Windows [version 10.0.19044.1706], locale fr-FR)
[√] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
[√] Visual Studio - develop for Windows (Visual Studio Enterprise 2022 17.2.0)
[√] Android Studio (version 2021.2)
[√] VS Code, 64-bit edition (version 1.67.1)
[√] Connected device (1 available)
[√] HTTP Host Availability

Thanks.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.