chewie
chewie copied to clipboard
can't exit fullscreen when rotating on iphone 13
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
@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.