I am using the mediaplayer framework included in iOS 6 to try and play a movie from within an app. I import and then:
-(IBAction)playMovie:(id)sender
{
NSString *filepath = [[NSBundle mainBundle] pathForResource:@"buyTutorial" ofType:@"mov"];
NSURL *fileURL = [NSURL fileURLWithPath:filepath];
MPMoviePlayerController *moviePlayerController = [[MPMoviePlayerController alloc] initWithContentURL:fileURL];
[self.view addSubview:moviePlayerController.view];
moviePlayerController.fullscreen = YES;
[moviePlayerController play];
}
The view goes to blank screen and infinite loading when this function is called. I have tried many other versions of this implementation and the results vary and all fail. The log in the is particular case is:
2012-11-05 21:19:27.900 [MPAVController] Autoplay: Disabling autoplay for pause
2012-11-05 21:19:27.902 [MPAVController] Autoplay: Disabling autoplay
2012-11-05 21:19:27.977 [MPAVController] Autoplay: Disabling autoplay for pause
2012-11-05 21:19:27.978 [MPAVController] Autoplay: Disabling autoplay
2012-11-05 21:19:27.984 [MPAVController] Autoplay: Skipping autoplay, disabled (for current item: 1, on player: 0)
2012-11-05 21:19:28.156 [MPAVController] Autoplay: Enabling autoplay
Got ideas on the cause? This is my first venture into playing video and it has turned out to be a nightmare at this point.