Steps to replicate: 1. Call playMovieAtURL. Use this url: (http://nov8rixstorage.blob.core.windows.net/searchpad/tutorial_portrait.mov) 2. Let the movie start then press Done. 3. Call playMovieAtURL again using the same URL.
Result: MPMoviePlayerViewController animates in; flashes a few times; and closes with error in notification object. ("Server is not correctly configured.")
This is very strange. Making things stranger; the movie player will not play anything again until the app is deleted from the device (simulator or iphone). Upon re-deployment it will play the movie perfectly once again; but alas on the second play it will repeat the above behavior.
What am I doing wrong? Can anyone reproduce this?
- (void) playMovieAtURL: (NSURL*) theURL {
[theURL retain];
MPMoviePlayerViewController *mp = [[MPMoviePlayerViewController alloc] initWithContentURL:theURL];
if (mp)
{
[self presentMoviePlayerViewControllerAnimated:mp];
[[NSNotificationCenter defaultCenter] addObserver:self
selector: @selector(playbackDidFinish:)
name:MPMoviePlayerPlaybackDidFinishNotification
object:mp.moviePlayer];
[mp release];
}
[theURL release];
}
-(void) playbackDidFinish:(NSNotification*)aNotification
{
MPMoviePlayerController *player = [aNotification object];
[[NSNotificationCenter defaultCenter] removeObserver:self
name:MPMoviePlayerPlaybackDidFinishNotification
object:player];
[player stop];
[self dismissMoviePlayerViewControllerAnimated];
}
Edit: Can anyone replicate this? Anyone?