title: MPMoviePlayerController - Video stops when I change contentURL
body: <p>While a movie is playing, if I change my contentURL the movie stops playing and the view is removed.</p>
  
  <p>I've tried the solution <a href="https://stackoverflow.com/questions/5383821/set-contenturl-of-mpmovieplayercontroller-twice/5392786#5392786">here</a> but it still doesn't work.</p>
  
  <p>Here's my code to play the movie:</p>
  
  <pre><code>- (void) playMovie:(NSURL *)moviePath{
  theMovie = [[MPMoviePlayerController alloc] initWithContentURL: moviePath];
  
  UIView * movieView = [theMovie view];
  
  [movieView setFrame: CGRectMake(0, 0, 480, 320)];
  [[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationNone];
  [[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationLandscapeRight animated:NO];
  CGAffineTransform landscapeTransform;
  landscapeTransform = CGAffineTransformMakeRotation(degreesToRadian(90));
  landscapeTransform = CGAffineTransformTranslate(landscapeTransform, 80, 80);
  [movieView setTransform: landscapeTransform];
  
  self.theMovie.scalingMode = MPMovieScalingModeAspectFit;
  self.theMovie.fullscreen = TRUE;
  self.theMovie.controlStyle = MPMovieControlStyleNone;
  [self performSelector:@selector(showCtrlsOnTouch) withObject:NULL afterDelay:0.1];
  [self.theMovie prepareToPlay];
  
  int a = currentMovie;
  int b = [self.tableDataSource count] - 1;
  
  if(a &lt; b)
  {
      UIButton *nextButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
      nextButton.frame = CGRectMake(360.0, 138.0, 100.0, 44.0);
      [nextButton setTitle:@"Next" forState:UIControlStateNormal];
      [self.theMovie.view addSubview:nextButton];
      [nextButton addTarget:self action:@selector(playNextMovie:) forControlEvents:UIControlEventTouchUpInside];
  }
  if(currentMovie &gt; 0)
  {
      UIButton *previousButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
      previousButton.frame = CGRectMake(40.0, 138.0, 100.0, 44.0);
      [previousButton setTitle:@"Prev" forState:UIControlStateNormal];
      [self.theMovie.view addSubview:previousButton];
      [previousButton addTarget:self action:@selector(playPreviousMovie:) forControlEvents:UIControlEventTouchUpInside];
  }
  
  [[[UIApplication sharedApplication] keyWindow] addSubview: movieView];
  
  [[NSNotificationCenter defaultCenter] addObserver: self
                                           selector: @selector(movieFinishedCallback:)
                                               name: MPMoviePlayerPlaybackDidFinishNotification
                                             object: self.theMovie];}
  </code></pre>
  
  <p>And here's my code to switch the movie: </p>
  
  <pre><code>- (void) playNextMovie:(id) sender{
  currentMovie++;
  
  NSDictionary *dictionary = [self.tableDataSource objectAtIndex:currentMovie];
  
  NSString *videoString = [NSString stringWithFormat:@"%@", [dictionary objectForKey:@"videoFile"]];
  NSString *videoPath = [[NSBundle mainBundle] pathForResource:videoString ofType:@"m4v"];
  NSLog(@"Video Path: %@", videoPath);
  NSURL *moviePath = [NSURL fileURLWithPath: videoPath];
  
  self.theMovie.contentURL = moviePath;
  [self.theMovie prepareToPlay];}
  </code></pre>
  
  <p>Thanks for any help.</p>