iPhone is there a way to get the MPMoviePlayerController to exit before the video finishes?
<p>Right now when a user starts a video on my app, he must wait until the video is fished.  I noticed the video player has a blur button that says done.  When I press it the video just stops.</p>

<p>Is there some way I could use this button or add my own button to allow the user to stop the video?</p>

<p>code</p>

<p>// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad {
        // save it in a fix file name for testing documets\ted.mp4
    NSURL *url  = [[NSBundle mainBundle]
                   URLForResource:@"FredCouplesDriv"
                   withExtension:@"mov"];</p>

<pre><code>mp=[[MPMoviePlayerController alloc] initWithContentURL: url];
[mp.view setFrame: self.view.bounds];
[self.view addSubview: mp.view];

// Set movie player layout
[mp setControlStyle:MPMovieControlStyleEmbedded];
[mp setFullscreen:YES];
//    mp.MPMovieControlStyle;


//MPMovieControlStyleEmbedded;

// May help to reduce latency
[mp prepareToPlay];

[mp play];

[[NSNotificationCenter defaultCenter] addObserver:self 
                                         selector:@selector(moviePlayBackDidFinish:) 
                                             name:MPMoviePlayerPlaybackDidFinishNotification 
                                           object:nil];
</code></pre>

<p>}</p>

<ul>
<li>(void) moviePlayBackDidFinish:(NSNotification*)notification;{
[ mp stop]; 
//  [ mp release];
[self dismissModalViewControllerAnimated: true];
}</li>
</ul>

<p>// 1 Override to allow orientations other than the default portrait orientation.
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    // Return YES for supported orientations.
    return true;
  //  return (interfaceOrientation == UIInterfaceOrientationPortrait);
}</p>

<ul>
<li><p>(void)didReceiveMemoryWarning {
// Releases the view if it doesn't have a superview.
[super didReceiveMemoryWarning];</p>

<p>// Release any cached data, images, etc. that aren't in use.
}</p></li>
<li><p>(void)viewDidUnload {
[super viewDidUnload];
// Release any retained subviews of the main view.
// e.g. self.myOutlet = nil;
}</p></li>
</ul>

<p>-(void) NewVideo : (NSString *) strName;{       </p>

<pre><code>NSURL *url  = [[NSBundle mainBundle]
               URLForResource:strName
               withExtension:@"mov"];

mp.contentURL=url;
[mp play];  
</code></pre>

<p>}</p>

<p>@end</p>
