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

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

Related

Is it Possible to play video in UIwebView while app in Background mode?

In my app i have UIWebView in which i had give option to user for watch video from video hosting sites(i.e. Youtube, Vimeo, DailyMotion). When I click Home button the app goes to background mode, the video is paused.
I wants to Play sound of that video while app in background mode.
I had implemented same while play local video in AVPlayer. But till now having no luck to achieve this.
I already refereed below stuff:
--> UIWebView: HTML5 audio pauses in iOS 6 when app enters background
--> Is it possible to play video using Avplayer in Background?
If you guys have any solution with this it will be great help.

js sdk method play not working on ios

i try to play a DM video on a page on clicking a custom button. It works perfectly on desktop browsers but not on ios devices.
Here is how i proceed using js sdk and jquery.
function _on_apiready(){
$custom_button.one("click", _playVideo)
}
function _playVideo(e){
player.play();
$custom_button.click(function(){player.togglePlay();})
}
var player = DM.player(dom_el,
{
video:dm_id,
params:{html:1, autoplay:0, info:0, logo:0, related:0},
events:{
apiready: _on_apiready,
timeupdate: _on_progress,
playing: _on_playing,
pause: _on_pause
}
}
);
On ios devices, the video seems to load but doesn't play. I need to press the play button of the player to start the video and then may use my custom button to togglePlay.
Doing something wrong ?
Thx
this question has been answered here already: Dailymotion embedded player on iOS devices (HTML5)
Basically, mobile devices prevent videos from being played automatically, this is why it's not playing with your code. As you say, those devices require an user interaction to first play the video.

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

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.

how to close the native video player in Air for iOS using StageWebView

I open a video to play in the StageWebView:
var webView:StageWebView = new StageWebView();
var path:String = 'http://www.winterlife.com/files/apps/zhdk/test.mp4';
webView.stage = this.stage;
webView.viewPort = new Rectangle( x, y, width, height);
webView.loadURL(path);
This works fine, video starts playing.
Question 1: If I want to close the StageWebVideo, I touch "Done/Close". But nothing happens, except the video stops. (I want to close the video player and go back to my app.)
Question 2: How can I set the video to autoplay?
Question 3: When I start StageWebView, a white background appears for some short time. What is that, and how can I avoid it.
Thank you very much!
You have zero control over the video player in StageWebView by default. No events, no auto-play, nothing. What you want to do is simply not possible using that component.
You have two options:
Use a replacement ANE that mimics the functionality and gives you access to the things you want. UIWebView from Darkredz may be a possible substitute, though I haven't used it in 18 months, it hasn't been updated in 12, and it's not free.
Use StageVideo and build your own player around it. This is my preferred method. It still uses the native video player, but gives you great control over the video and a plethora of events to listen for. Plus you can design your own controls for it.
You can close the native video player by adding StageWebView in the popup container with a close button. Because, .mp4 is not supported flex video player in ios, instead of this we use native player to play the video.
While we use StageWebView it automatically take Native player in IOS. So we can add StageWebView in a popup container with a custom close button for dispose() StageWebView and close the popup container. By this method we can close our native video player in IOS.
StageWebView is always open in top of our application, when you click the link, the popup will open in top of the application, and stagewebview also will open in top of the application. You can modify the viewPort for adding close button.

Jwplayer 6: html5 fullscreen when video clicked to play

I want to be able to use jwplayer so that when the user clicks on the video the video will start to play in fullscreen mode.
I want this functionality to work on mobile devices that support html5.
If the video is played on a mobile device it will take up the whole screen.
Youtube and Vimeo currently do this on mobile devices.
The Link Below uses Html5 video tag, which plays in fullscreen on mobile device when the video is clicked on.
The only way I that I know that jwplayer allows fullscreen is that I manually click on the fullscreen button, but it would be nice to only click on the video to trigger the video to play in full screen.

Resources