WKPreferences isElementFullscreenEnabled disables screen rotation - ios

Starting on iOS 15.4 and macOS 12.3 WKPreferences has the new property isElementFullscreenEnabled, part of WKWebViewConfiguration, which enables JavaScript to make elements full-screen in a WKWebView, but enabling it on an iOS app that only supports Portrait Orientation disables screen rotation on full-screen for any playback (YouTube videos for example).
This is important if you have an app that only supports portrait mode but wants screen rotation when playing a video on full-screen (going back to portrait when the video finishes).
Having isElementFullscreenEnabled = false, you can still play videos on full-screen (at least on YouTube), and it allows screen rotation but disables making other HTML elements full-screen.
Important to note that on macOS, preferences.isElementFullscreenEnabled = true is needed if you want full-screen videos.
Question
Is there a workaround to have both: isElementFullscreenEnabled = true and screen rotation for videos on iOS when only supporting portrait mode?

Related

Android TV portrait WebView

I am writing an application that runs on Android TV 5.1 or newer that uses the WebView as the display rendering engine. I am able to set the desired display orientation, but the WebView rotates back to landscape within the display and maintains the correct aspect ratio.
I have tried using CSS to perform a transform but the aspect ratio is not correct. I have not found a method to force the WebView to rotate and fit the parent window.
Is there any method to set the orientation and size of the WebView itself? I see the same behavior on multiple devices.
This behavior is device specific. Some of the devices I have tested rotate as expected, another device rotates the display, but the WebView rotates back into landscape. The remaining devices I have tested do not rotate at all.
I will make this will be a known limitation of running this application on Android TV devices.

Is it possible to autorotate AVPlayer even if the device turned on "Lock Portrait Orientation"?

I want to play a video with AVPlayerViewController() from Apple's AVKit framework. well, the video plays nicely, auto rotate works well and rotate smoothly. But, is it possible to autorotate that (so it could rotate to landscape or rotate to portrait, not just one of it) even if the device turned on "Lock Portrait Orientation" ?
What i mean for "Lock Portrait Orientation" is the one from device's Control Center like this : Lock Portrait Orientation

Awkward Landscape keyboard in portrait mode, IOS 8

I have a portrait app that have Built-In UIViewController (portrait only) with the UIWebView that opens youtube video. Upon video playback user can rotate to landscape mode. After returning from video app correctly rotates to portrait but if user starts text editing - an awkward keyboard appears. I've tried adding landscape support to all screens - it doesn't solve the problem.
Simple steps are:
UIViewController (portrait only)
push UIVIewController (portrait
only) with UIWebView (youtube video)
start video playback, go fullscreen, rotate landscape
press Done go back to first UIViewController
activate textField
In swift:
UIDevice.currentDevice().setValue(1, forKey: "orientation")
UIViewController.attemptRotationToDeviceOrientation()
By using this block in view will appear you solve this issue.

how to use html5 video landscape in ios

I use phonegap to create a ios project.I want to use htmlt5 video to play a video in landscape.
So there is a way from webkit or in my application to switch in landscape mode only when i showing a HTML5 video?
Thanks!
Create view and add webView as subview to that view. Set orientation of that view to LandscapeLeft and LandScapeRight and load HTML5 video on webview. call that view when ever you want to play video; view will always appear in landscape mode.

play video landscape Iphone sdk 3.2 4.0 with standard api

how to play video landscape with standard api?
video play only portrait !!!
change the app orientation landscape is not useful, because video start portrait forever.
i have a portrait app with a button, when pressed video must play landscape.
yourmoviecontrollername setOrientation:UIDeviceOrientationPortrait animated:NO];
is not allowed by Apple
Maybe the regular videoplayercontroller doesnt do landscape by itself...i would suggest using MPMoviePlayerViewController available in 3.2, you set it up and use view controllers presentMoviePlayerController method in order to display, should work fine for you. here is a ref MPViewcontroller

Resources