Close of video player in iphone - iphone

Am using html5 to play video on iphone. Is there is way to know when video player is close because i want to call function after clicking on done button. I can't use 'ended' this event occurs only after completion of video. I appreciate your suggesions.

Related

No back button for Handheld.PlayFullScreenMovie method

I am trying play a fullscreen video in my app (iOS&Android). When users press on video I use the
Handheld.PlayFullScreenMovie method and it displays the videos perfectly. BUT, there is no back button in the player. The only way to exit player and switch back to the scene is to wait untill the video ends. How can I fix this problem? It is so obvious that users may need the back button and idk why Unity does not added it

Why does WebRTC video freeze in iPhone Safari browser?

I am using Ant Media Server for ultra-low latency WebRTC streaming. But video stream is freezing when I play it from the iPhone Safari browser. How can I solve this?
Yeah it's about safari autoplay scenario in WebRTC. In documentation, It says that
However, for a one-way video conferencing scenario, such as a webinar, the user does not give explicit permission to the camera. Without a user gesture to indicate playback, the video cannot start. Add a play button to your media controls for one-way WebRTC experiences, so the user can start the video.
Another place in documentation also says that
By default, autoplay executes only if the video doesn’t contain an audio track, or if the video element includes the muted attribute.
So solution is that, you either play content explicitly or you can mute the player and let the safari autoplay work for you. For some cases, it does not even auto play if it's muted so that you need some failover scenario again.
From our experience, if it freezes in the first frame with unmuted content, just click the play button on the screen as shown below works every time.
Browser will autoplay VIDEO element only if muted.
Solution is to add a Tap for Audio and start it muted or a Tap to Play button if important to start with sound. As in this HTML5 Videocall App.
use
setTimeOut(()=>{
video.play();
});
The Safari browser wants the user intervention to start/stop video stream. The above code snippet mimics that behaviour and starts the video stream in the video element.
If you are drawing the video element on canvas then you have to set the opacity=0.001 and width and height of the video element to 1px at least.

phaser game freezes in iphone

I am developing a game using phaser js. This game has a tutorial video at the beginning which starts playing automatically when I launch a level. The video plays in iphone's native video player. While the video is playing, if I click the "Done" button that is seen on the top left corner of the video player, the video stops (which is fine) but unfortunately the background tutorial screen is frozen.
I am new to phaser and I don't know how to handle this issue. Would appreciate it if someone could guide me to resolve this issue?
I am pasting a sample link below.
https://phaser.io/examples/v2/video/change-source
This has videos that play as soon as the page is loaded. If you stop the video by tapping the Done button, you will notice that the background will be frozen.
Need to add event listener
tutorialVideo.video.addEventListener('webkitendfullscreen', (() => {
this.game.cache.removeVideo("tutorialVideo");
}), true);
Try it This Will Work

How to stop the camera movie player stop playing the captured video after selecting to use it?

Hi this is what I am trying to do:
open Camera
capture a new video
use it
create a MPMoviePlayerController to get the thumbnail and duration of the selected video.
All the above steps work FINE if I don't play the new video after capturing it in the Camera, however as soon as I play the video in the camera movie player, and while the video is being played then I click on 'Use' button, it will crash my app in the area of where I try to create a MPMoviePlayerController to get the thumbnail and duration of the selected video. I believe you cannot have more than 1 instance of movie player running.
Anyone got any idea how to fix this?

Closing iPhone Video Player using Javascript

I have a web page with several html5 tags, offering users a number of posters/thumbnails for videos they can choose to play. When a user touches one of the them the iPhone video player opens and the video plays. I want to be able to automatically close the video player after the video has finished and return the user to the thumbnails.
I have set the event listener for the "ended" event and I can detect that the video has finished, but I can't figure out how to close the video player and return to the thumbnails. It just waits for the user to touch the "done" button. Is there any way of doing this in Javascript??
jQuery -
$('video').get(0).webkitExitFullscreen();
Uncertain what iOS version this was supported. See The correct method is webkitExitFullscreen. See https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Using_full_screen_mode for full support