i am using this code to playback a video on ios 6 (in Xcode and device simulator)
- (void) playMovie {
NSString *filepath = [[NSBundle mainBundle] pathForResource:@"flying" ofType:@"m4v"];
NSURL *fileURL = [NSURL fileURLWithPath:filepath];
MPMoviePlayerController *moviePlayerController = [[MPMoviePlayerController alloc] initWithContentURL:fileURL];
[moviePlayerController prepareToPlay];
[moviePlayerController.view setFrame: self.view.bounds];
[self.view addSubview:moviePlayerController.view];
moviePlayerController.scalingMode = MPMovieScalingModeAspectFit;
moviePlayerController.movieSourceType = MPMovieSourceTypeFile;
[moviePlayerController play];
}
playback starts, but the video aborts after 5 seconds. It simply disappears and i see a black window and no error messages in Xcode.
any clues? Thanks