0
-(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 its orientation while loading and after loading Device again come back to landscape mode.

How to resolve this problem?

halfer
  • 19,824
  • 17
  • 99
  • 186
sagarkothari
  • 24,520
  • 50
  • 165
  • 235
  • Now you can play multiple movie or video files together in iphone check this link for nice tutorial http://cocoabugs.blogspot.com/2010/12/playing-movies-or-videos-in-queue-using.html –  Dec 16 '10 at 09:17

2 Answers2

1

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
  • 39,196
  • 16
  • 97
  • 124
  • Now you can play multiple movie or video files together in iphone check this link for nice tutorial http://cocoabugs.blogspot.com/2010/12/playing-movies-or-videos-in-queue-using.html –  Dec 16 '10 at 09:18
1

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 Morrison
  • 1,323
  • 1
  • 18
  • 30