fluttercommunity / fluttercommunity/chewie

On iOS, an error message is displayed when entering/exiting fullscreen

Open
#750 3 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

**What I did**

1. 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}
```
2. 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 :
```dart
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`:
```xml
UISupportedInterfaceOrientations

UIInterfaceOrientationLandscapeLeft
UIInterfaceOrientationLandscapeRight
UIInterfaceOrientationPortrait

```

And my `main.dart` forced a specific orientation:
```dart
await SystemChrome.setPreferredOrientations([
DeviceOrientation.portraitUp,
]);
```

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.