iPhone media player framework : play multiple movie files seamlessly - iphone

I am using the media player framework's MPMoviePlayerController to play local (on device) m4v files. Depending on user's selection, I want to be able to play multiple movies one after the other seamlessly.
To do this, I queue up the movies in an array and in my observer method that is called on the MPMoviePlayerPlaybackDidFinishNotification event which is triggered after one movie finishes, I play the next movie in the queue.
However, this is far from seamless. After each movie finishes, the iphone view transitions back to the base view from which the movieplayer was called and then picks up the movie called in the observer method (moviePlayBackDidFinish).
Is there a way to make the movies play one after the other seamlessly without breaking to transition back to the base view?
Just to be very clear, all the movies are local and bundled with the app as resources, not being streamed from anywhere.

You can use AVMutableComposition. It combines media data from multiple file-based sources in a custom temporal arrangement, in order to present or process media data from multiple sources together.

Related

add more than 1 video player in iphone

Is there any way to add more than 1 video player in a single View? I am getting the .m4v list from server adn have to display that much videos in single page.
It doesnot matter if I play 1 video at a time but which ever video I want must play there itself.
So the videos are placed one below other.
I have tried using mpmoviecontroller but it's drawback is it can have only one instance in the whole applicaiton So if i try to alloc 2 players in a view then the first one does not work and only one player works..
Is there any legal alternate way for the same?
MPMoviePlayerController will allow multiple instances, but only one of them can be playing their movie at any given time.
Please check the link : http://developer.apple.com/library/ios/#documentation/mediaplayer/reference/MPMoviePlayerController_Class/MPMoviePlayerController/MPMoviePlayerController.html
I used AVPlayer class (which also MPMoviePlayerController uses under the hood) to successfully play multiple videos from multiple source.
The process of using it is more involved than MPMoviePlayerController, but I would say it is definitely worth to look at if you want some customized behavior in your player. The official programming guide is a good start.

How to play more than one video in cocoa touch?

I'm trying to play more than one video at the same time in Cocoa Touch.
I can play one video with MPMoviePlayerController, but it does not allow to play more than one: "Note: Although you can create multiple MPMoviePlayerController objects and present their views in your interface, only one movie player at a time can play its movie."
Basically I'm trying to display complex, high resolution animation in a loop with autostart, but using PNGs makes the app size way too big (+500 MB)
I converted one object of the animation to a movie which is about 50x smaller now.
I think its not possible to play two video at the same time. But you can play video in queue refer this article....

Multy Video Player using monotouch

Here is the question:
Can a View in iPad to handle two different MpMoviePlayerView in the same Time
I have read that the moviePlayer is a singleton and I have to fix the observer with hard Code.
I am triying to do multiple Movie player in the same View??
Is it possible???
Any one have an idea???
MPMoviePlayerControllers won't let you play back two videos simultaneously. Sorry! Whilst you can create two MPMoviePlayer objects if you try and play two streams back at the same time it will just break. This is mentioned in the documentation for that class, buried away somewhere.

Why does my MPMoviePlayerController suddenly change load state to unknown?

My app is a digital magazine consisting of many pages. Some pages have video embedded in them.
I am using MPMoviePlayerViewController for the video playback.
The problem is that once I get to any page where the next page also contains a video then the video appears briefly then blanks out.
I've switched out video files, so I know it isn't the files themselves.
When the page loads offscreen ready to be scrolled into view the load state changes to 3 = MPMovieLoadStatePlayable + MPMovieLoadStatePlaythroughOK (all good). Then when a second MPMoviePlayerController is loaded, the load state of the original suddenly changes to 0 (MPMovieLoadStateUnknown).
In the docs for MPMoviePlayerController it says
Note: Although you can create multiple
MPMoviePlayerController objects and
present their views in your interface,
only one movie player at a time can
play its movie.
I read this to mean I can't play more than one at a time but does this it also mean I can't even load up more than one movie at a time?
It turns out you can't even load more than one MPMoviePlayerController at a time. You can create the object but if you supply a URL to more than one then one will get unloaded.

How to play next video in MPMoviePlayer?

I have implement an application.In which there is list of videos.when user touch on the video then video play in MPMoviePlayer.But when video is finished then i want to play another video automatically.Is it possible?
Yes. Do you want it to play another one randomly? You could do that. Or do you have an NSArray that contains all the different MPMoviePlayer URLs to play in order? If you do, then loop through the array objects and play each. You will have to have a MPMoviePlayerPlaybackDidFinishNotification to know when each videos finish so you can start the next one.