title: Hide MPMoviePlayerController while new video loads
body: <p>I have an iPad app that has 4 buttons on the left side that corresponds to 4 different video clips. When a user taps the video they want to see, it appears on the right side. I am wanting it to appear to be loading (as if it were streaming over the internet). I added the UIActivityIndicator to the center of the black video frame and have a thread that pauses for 3 seconds. However, the player containing the previous video does not disappear. It just freezes on the last frame of the previous video for 3 seconds (hiding the activity indicator) and then the new video appears.</p>
  
  <p>Any ideas on how to make the player temporarily be hidden? Thanks for any help. Here is my code:</p>
  
  <pre><code>-(IBAction) videoButton1{
     [player stop];
     [player release];
  
     [self.activityIndicator startAnimating];
  
     NSString *url = [[NSBundle mainBundle] pathForResource:@"video1" ofType:@"mov"];
     [self setupVideoPlayer:url];
  }
  
  -(void) setupVideoPlayer: (NSString *) url{
     player = [[MPMoviePlayerController alloc] initWithContentURL:[NSURL fileURLWithPath:url)];
     player.view.frame = CGRectMake(487, 205, 478, 320);
  
     [self.view addSubview:player.view];
  
     [NSThread sleepForTimeInterval:3.0];
     self.activityIndicator stopAnimating];
  
     [player play];
  }
  </code></pre>