MPMoviePlayerController - Video stops when I change contentURL
While a movie is playing, if I change my contentURL the movie stops playing and the view is removed.

I've tried the solution [here](http://stackoverflow.com/questions/5383821/set-contenturl-of-mpmovieplayercontroller-twice/5392786#5392786) but it still doesn't work.

Here's my code to play the movie:

    - (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 < 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 > 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];}

And here's my code to switch the movie: 

    - (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];}


Thanks for any help.
MPMoviePlayerController - Video stops when I change contentURL
===

While a movie is playing, if I change my contentURL the movie stops playing and the view is removed.

I've tried the solution [here](http://stackoverflow.com/questions/5383821/set-contenturl-of-mpmovieplayercontroller-twice/5392786#5392786) but it still doesn't work.

Here's my code to play the movie:

    - (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 < 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 > 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];}

And here's my code to switch the movie: 

    - (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];}


Thanks for any help.