title: How can I use MPMoviePlayerController within my application?
body: <p>I'm having trouble implementing MPMoviePlayerController. I've downloaded and run the MoviePlayer app, and it works fine, but I'm unable to reproduce this functionality in my own app. I have added the MediaPlayer Framework and imported  to my app.</p>
  
  <p>Here are the relevant parts of my code:</p>
  
  <p><strong>UITableViewController class:</strong></p>
  
  <pre><code>- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
      if (indexPath.section==1) {
          MyAppDelegate *appDelegate = 
  (MyAppDelegate *)[[UIApplication sharedApplication] delegate];
          [appDelegate initAndPlayMovie:[self localMovieURL]];
      }
  }
  </code></pre>
  
  <p><strong>MyAppDelegate:</strong></p>
  
  <pre><code>-(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];
      }
  }
  </code></pre>
  
  <p>I did some debugging in</p>
  
  <pre><code>- (void) moviePreloadDidFinish:(NSNotification*)notification {
     NSLog(@"moviePreloadDidFinish");
  }
  </code></pre>
  
  <p>and in </p>
  
  <pre><code>- (void) moviePlayBackDidFinish:(NSNotification*)notification {
     NSLog(@"moviePlayBackDidFinish");
  }
  </code></pre>
  
  <p>I noticed that the movie loads correctly and plays, I guess somewhere in the background, for the appropriate amount of time, but I just can't see the Movie Player. The view never changes from my TableViewController!</p>
  
  <p>Any Ideas? Please help!!!</p>