I am using this code to play a video on iOS 6:
-(void)GrommeVideo4
{
NSURL *url5 = [NSURL fileURLWithPath:[[NSBundle mainBundle]
pathForResource:@"Flickers" ofType:@"mp4"]];
grommePlayer4 = [[MPMoviePlayerController alloc]
initWithContentURL:url5];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(moviePlayBackDidFinish:)
name:MPMoviePlayerPlaybackDidFinishNotification
object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(moviePlayerWillExitFullscreen:)
name:MPMoviePlayerWillExitFullscreenNotification
object:nil];
grommePlayer4.controlStyle = MPMovieControlStyleDefault;
grommePlayer4.shouldAutoplay = YES;
[self.view addSubview:grommePlayer4.view];
[grommePlayer4 setFullscreen:YES animated:YES];
}
-(void) moviePlayBackDidFinish:(NSNotification *)aNotification{
[grommePlayer4.view removeFromSuperview];
grommePlayer4 = nil;
}
- (void)moviePlayerWillExitFullscreen:(NSNotification*) aNotification {
[grommePlayer4 stop];
[grommePlayer4.view removeFromSuperview];
grommePlayer4 = nil;
}
And I can press "Done" to exit the video at any time, and it works fine, but when I watch the video through to the end, it just displays a black screen. Any ideas as to why this could occur?