chewie
chewie copied to clipboard
On iOS, an error message is displayed when entering/exiting fullscreen
What I did
- When entering fullscreen, an error is display in the console:
Failed to change device orientation: Error Domain=UISceneErrorDomain Code=101 "None of the requested orientations are
supported by the view controller. Requested: landscapeLeft, landscapeRight; Supported: portrait" UserInfo=
{NSLocalizedDescription=None of the requested orientations are supported by the view controller. Requested: landscapeLeft,
landscapeRight; Supported: portrait}
- When exiting fullscreen, an error is also display in the console:
Failed to change device orientation: Error Domain=UISceneErrorDomain Code=101 "None of the requested orientations are
supported by the view controller. Requested: portrait; Supported: landscapeLeft, landscapeRight" UserInfo=
{NSLocalizedDescription=None of the requested orientations are supported by the view controller. Requested: portrait;
Supported: landscapeLeft, landscapeRight}
Tested on: iOS Simulator Iphone 14 Pro Max iOS 16.4
Note: The error seems to only appears in iOS devices.
Here is my chewieController setup :
chewieController = ChewieController(
aspectRatio: 16 / 9,
autoInitialize: true,
fullScreenByDefault: false,
deviceOrientationsAfterFullScreen: [
DeviceOrientation.portraitUp,
],
videoPlayerController: _controller,
autoPlay: true,
looping: false,
);
In case I have setup the available orientations in Info.plist:
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
<string>UIInterfaceOrientationPortrait</string>
</array>
And my main.dart forced a specific orientation:
await SystemChrome.setPreferredOrientations([
DeviceOrientation.portraitUp,
]);
Have you tried setting all orientations before going to fullscreen and back to default when escaping full screen?
Have you tried setting all orientations before going to fullscreen and back to default when escaping full screen?
I tried to use deviceOrientationOnFullScreen with the following setup :
deviceOrientationsOnEnterFullScreen: [
DeviceOrientation.landscapeLeft,
DeviceOrientation.landscapeRight,
DeviceOrientation.portraitUp, // If not added, the error persist
],
There is no longer an error but it does not put the video on landscape mode automatically on fullscreen.
I would like to avoid setting the orientations through SystemChrome.setPreferredOrientations() as I want my app to be strictly used in portrait mode (unless it is a video).
Any update? I have same issues.