Portrait orientation problem
cagysek opened this issue · 1 comments
cagysek commented
Hi,
my app only supports portrait orientation, but if I close the fullscreen player from landscape orientation, the app switches to landscape orientation and then to portrait orientation. Is there any way to prevent this?
Environment
- Xcode 14.2
- YouTubePlayerKit version 1.3
- Example code from usage + only iPhone portrait orientation in deployment information
Expected behaviour
- App in portrait orientation -> open fullscreen and enable landscape orientation on video -> after closing fullscreen the app stays in portrait orientation
Why I need this
- In another app I use
GeometryReader
for animations and switch to landscape after close fullscreen breaks view
Demo with slow animations
Untitled.mp4
Thanks for any help
SvenTiigi commented
Hi @cagysek
Thanks for your bug report!
Sadly there is no direct way in preventing or adjusting this behavior as the fullscreen button is displayed and controlled by the underlying YouTubePlayer iFrame JavaScript API. In addition, the presented AVPlayerViewController is managed by the WKWebView
instance which also doesn't allow any kind of additional customization e.g. supported interface orientation.