Edit: if you come across this and want to know how I eventually solved it I gave up on that code below eventually and did this:
-(void)playMovieAtURL:(NSURL*)theURL{
mediaPlayer = [[MPMoviePlayerViewController alloc] initWithContentURL:theURL];
[self presentMoviePlayerViewControllerAnimated:mediaPlayer];
mediaPlayer.view.backgroundColor = [UIColor blackColor];
}
Original post:
This is my code - I took it off the apple site so shouldn't be a problem.
It runs in a UITableViewController on the didSelectRowAtIndexPath method.
When you select the row the video starts playing - the sound outputs at least - but there's no picture. Any idea why this is? I have included the framework.
The video is one off the apple website (a facetime video) that I used for testing.
-(void)playMovieAtURL:(NSURL*)theURL{
MPMoviePlayerController* theMovie =
[[MPMoviePlayerController alloc] initWithContentURL: theURL];
theMovie.scalingMode = MPMovieScalingModeAspectFill;
theMovie.controlStyle = MPMovieControlStyleNone;
// Register for the playback finished notification
[[NSNotificationCenter defaultCenter]
addObserver: self
selector: @selector(myMovieFinishedCallback:)
name: MPMoviePlayerPlaybackDidFinishNotification
object: theMovie];
// Movie playback is asynchronous, so this method returns immediately.
[theMovie play];
}