views:

843

answers:

2
-(void)initAndPlayMovie:(NSURL *)movieURL
{
    // Initialize a movie player object with the specified URL
    MPMoviePlayerController *mp = [[MPMoviePlayerController alloc] initWithContentURL:movieURL];
    if (mp)
    {
     self.moviePlayer = mp;
     [mp release];
     [self.moviePlayer play];
    }
}

Here, In above code, We can pass just one movie URL. Isn't it possible to pass multiple urls to it.

So, Movie Player will load second url after playing first one.

Is it Possible?

How can we do that?

Right Now, When I try to Pass other url, After finishing first one.

- (void) moviePlayBackDidFinish:(NSNotification*)notification
{
    [self initAndPlayMovie:secondURL];
}

The Device First change it's orientation while loading & after loading Device again come back to landscape mode.

How to resolve this problem?

Thanks in advance for sharing your knowledge to me.

Sagar

+1  A: 

You might want to change the orientation by changing the statusBar orientation before you start playing videos and change it back after you are done with all.

[[UIApplication sharedApplication] setStatusBarOrientation: UIInterfaceOrientationLandscapeRight animated:YES];
mahboudz
A: 

You should be able to call setContentURL just as the first movie is about to close to change to another movie. Check endPlaybackTime and fire off your method to invoke setContentURL one second prior to the movie ending.

Michael