-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed orientation issue when exiting full screen mode #813
base: master
Are you sure you want to change the base?
Fixed orientation issue when exiting full screen mode #813
Conversation
@override | ||
void didUpdateWidget(Chewie oldWidget) { | ||
if (oldWidget.controller != widget.controller) { | ||
widget.controller.addListener(listener); | ||
} | ||
super.didUpdateWidget(oldWidget); | ||
if (_isFullScreen != isControllerFullScreen) { | ||
widget.controller._isFullScreen = _isFullScreen; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's no need to remove this, since if you refresh the widget with new properties, then removing this code won't update this StatefulWidget
with them.
SystemChrome.setPreferredOrientations([ | ||
DeviceOrientation.portraitUp, | ||
DeviceOrientation.portraitDown, | ||
]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The controller should not be responsible for setting SystemChrome
whatsoever.
This should be moved into ChewieState
and called before calling this method.
Also, it should not assume that it will fall back to Portrait. Instead, there's an option in the ChewieController
called deviceOrientationsAfterFullScreen
that it should be set to instead.
SystemChrome.setEnabledSystemUIMode( | ||
SystemUiMode.manual, | ||
overlays: widget.controller.systemOverlaysAfterFullScreen, | ||
); | ||
SystemChrome.setPreferredOrientations( | ||
widget.controller.deviceOrientationsAfterFullScreen, | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Restore these lines.
This pull request addresses issue #812 .
Problem:
When exiting fullscreen mode in the video player, the app was not returning to portrait orientation as expected.
Solution:
I've implemented a fix that ensures the app returns to portrait orientation after exiting fullscreen mode in the video player.
Additionally, I've tested this fix and verified that it resolves the issue.
Fixes: #812