-
Notifications
You must be signed in to change notification settings - Fork 13
I have a error when I exit full screen in ios. Systemdevice be locked landscape not change to potrait #18
Comments
When you create an instance of MeeduPlayerController you can pass the param screenManager these must be an instance of ScreenManager and define the default device orientations after close the fullscreen page. Here and example how to allow landscape and portrait mode after exit fullscreen List<DeviceOrientation> orientations = [
DeviceOrientation.portraitDown,
DeviceOrientation.portraitUp,
DeviceOrientation.landscapeLeft,
DeviceOrientation.landscapeRight,
];
_meeduPlayerController = MeeduPlayerController(
screenManager: ScreenManager(
orientations: orientations,
),
); For example if you have an smartphone you maybe only allow portrait mode but in a tablet you allow landscape and portrait. List<DeviceOrientation> orientations = [
DeviceOrientation.portraitDown,
DeviceOrientation.portraitUp,
];
if (isTablet) {
orientations.addAll([
DeviceOrientation.landscapeLeft,
DeviceOrientation.landscapeRight,
]);
}
_meeduPlayerController = MeeduPlayerController(
screenManager: ScreenManager(
orientations: orientations,
),
); |
i try it but i not work. i have a issue and it work for me |
that not good because my project support only portraitup. My code before good for android and error for ios. I hope you fix proplem you soon. I really like package of you. thank for support |
I am not sure what is the problem because you don't provide enough information. For example I need some code to reproduce the error, what versión of this library are you using, the flutter sdk versión and the ios device that you are using to test. I run the example project on my iPhone x and it works fine. |
when I exit fullscreen my device is locked in landscape view while my device only allows potraitUp. It doesn't generate an error but I don't know how it stays in landscape view, it just ends when I close the app and restart. I use the latest package and the sdk is always the newest (dart: 2.10.2 , flutter: 1.22.2) |
I believe I experienced the same issue as you on iOS but after enabling landscape mode on the info.plist I was able to control the behavior. If you wanna allow the user to go on landscape mode when on fullscreen but restore the portraitUp when is minimized, your app indeed supports landscape mode (at least on 1 screen), so you should enable that on: AndroidManifest.xml already has enabled the ability to change the orientation dynamically in the mainactivity On your main.dart you should allow only portraitUp: @override
void initState() {
super.initState();
SystemChrome.setPreferredOrientations([
DeviceOrientation.portraitUp
]);
} On your Widget, you should use @gamestap99 method to go back to portrait mode when the user minimizes it: Give it a try and let me know if that works for you :) Now, on the other hand, if your project only supports portraitUp and you wanna keep the user in portrait mode regardless of fullscreen mode, the ScreenManager has a property called _meeduPlayerController = MeeduPlayerController(
screenManager: ScreenManager(
forceLandScapeInFullscreen: false,
),
); Regardless of your use case, you might wanna use 'forceLandScapeInFullscreen' as follows: _meeduPlayerController = MeeduPlayerController(
screenManager: ScreenManager(
forceLandScapeInFullscreen: videoAspectRatio >= 1,
),
); This way, when fullscreen is tapped, portrait videos will stay on portraitUp, and landscape videos will force landscape mode. Cheers |
No description provided.
The text was updated successfully, but these errors were encountered: