Direct full screen of html5 video when starting to play in UIWebview - ios

We serve 3rd party videos in a iOS native app through UIWebviews.
On the iPhone when playing a video it directly switches to a fullscreen video view. On the iPad the video plays inline. This is expected according to Apple documentation.
This is because the value:
webView.allowsInlineMediaPlayback
is by default set to NO on iPhone and YES to iPad.
I would like to see the same behaviour on playback on the iPhone as on the iPad. So that is plays the video directly fullscreen. Setting webView.allowsInlineMediaPlayback to NO does not do the trick.

In your HTML5 source code add playsinline like in this example:
video controls="controls" webkit-playsinline="webkit-playsinline">
In your app, in the method you are calling to setup webview add
webView.allowsInlineMediaPlayback = YES;

Unfortunately the conclusion here is that it is not possible.

Related

How to disable native fullscreen on IOS

I am using videojs to play a video. Is it possibile to disable the native fullscreen in IOS iphone and use videojs fullscreen?
I tried the playsiline tag but it doesen't work.
Thanks a lot
iPhone still doesn't support the proper full screen API. With the preferFullWindow player option (as well as playinline), Video.js will do a "fake" full screen, filling the browser window instead. Not ideal, but the only option if you need to overlay something on top of the video during full screen playback.

Plays video by phaser.js on iOS (safari) without fullscreen

How to play 2-3-5 videos by phaser on same time in inline mode (without fullscreen) on iOS?
How to check it?
https://phaser.io/examples/v2/video/change-source
In android / desktop video plays inline and no need click, but on iOS video plays only after click and opens that video in fullscreen
I had the same problem and I couldn't find the solution.
the native player keeps opening
video = game.add.video ('space');
video.addToWorld();
video.unlock();
video.setAttribute('playsinline');
video.play(true);
I've found solution for native videos play: https://github.com/bfred-it/iphone-inline-video
And made a solution for phaser based on it:
var video = game.add.video('some_video');
...
video.mute = true; // muted videos play inline without user interaction
video.unlock(); // manual phaser unlock http://phaser.io/docs/2.4.2/Phaser.Video.html#unlock
video.video.setAttribute('playsinline', 'playsinline'); // for inline mode
video.play(true); // play that video with loop

Can we avoid the native player in Full screen with Html 5 Player

I am trying to implement a html 5 player inside a Webview in my app. I added the webkit-playsinline tab in video and its now playing inline in iPhone and iPad.
The issue arises is when user hits the fullscreen button, in both the iphone and iPad, it opens up the native player, which I don't want.
Can this be achieved?
I have followed this and thats why I am able to play the video inline however, when the user click on the "Full Screen" the control transfer to the native player which I don't want.
yes, I am using a UIWebView inside my app not safari specific!!

UIWebView to play Html 5 video without going to Video Player of iOS

I want to use video player technique used in my website. I use html 5 videos in website and send normal URL to app so that they can be played using the native MPMoviePlayerController inside the app. Now I have requirements where I want to use the same technique as web inside the app as UIWebView. When I request the link to load, it opens up the default player view of iOS, which I want to avoid.
Can this be possible?
No, this is not possible. Not in the Safari browser. Videos will always be played by the native player. Trust me, I've spent a lot of time on this.
If you build a Phonegap app, it is possible by what is mentioned here:
HTML5 inline video on iPhone vs iPad/Browser
Basically:
HTML
<video id="player" width="480" height="320" webkit-playsinline>
Obj-C
webview.allowsInlineMediaPlayback = YES;

How can I force a video played in a UIWebView to be full screen on an iPad?

I'm playing a YouTube video using a UIWebView, like so:
self.webView.mediaPlaybackRequiresUserAction = NO;
self.webView.allowsInlineMediaPlayback = NO;
[self.webView loadHTMLString:videoEmbedCode baseURL:nil];
I want to force the video to play in full screen without the user tapping the button at the bottom right. This works fine on an iPhone (tap the player to play and it automatically enters full screen), but doesn't work on an iPad (the normal inline player is shown).
I assumed that setting allowsInlineMediaPlayback to NO would do the trick, but apparently not.
Is there a way to force HTML5 videos to play in full screen on an iPad?
If you are trying to play a youtube video in fullscreen directly, then Use a webview of size fullScreen and then handle its rotation accordingly and change the player size of Rotation too. If you need more help then i can help you with the code too for how to change the player size on rotation too.

Resources