How to make video playable in UIWebView fullscreen on an iPad?

I am playing a YouTube video using a UIWebView, for example:

self.webView.mediaPlaybackRequiresUserAction = NO; self.webView.allowsInlineMediaPlayback = NO; [self.webView loadHTMLString:videoEmbedCode baseURL:nil]; 

I want to make the video play in full screen mode without the user clicking the button in the lower right. This works fine on the iPhone (press the player to play, and it automatically enters full screen mode), but it doesn’t work on the iPad (a regular built-in player is displayed).

I assumed that setting allowsInlineMediaPlayback to NO would do the trick, but apparently not.

Is there a way to make HTML5 video play in full screen on an iPad?

+7
source share
1 answer

If you are trying to directly play YouTube videos in full screen, use the fullScreen web view, and then process the rotation accordingly and resize the rotation player. If you need more help, I can also help you with a code on how to resize a player during rotation.

-2
source