I'm using the first answer from http://stackoverflow.com/questions/3130363/ios-4-mpmovieplayercontroller
to try and get MPMoviePlayerController to play. In the simulator (iPhone device with iOS4), I hear sound but no video. On the device (iPhone 3GS and iOS4), I don't get anything. Here's my code:
MPMoviePlayerController *moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:[NSURL fileURLWithPath:moviePath]];
moviePlayer.movieControlMode = MPMovieControlModeDefault;
if ([moviePlayer respondsToSelector:@selector(view)]) {
moviePlayer.controlStyle = MPMovieControlStyleFullscreen; [moviePlayer.view setFrame:self.view.bounds]; [self.view addSubview:moviePlayer.view]; }
[moviePlayer play];
Any ideas what I'm doing wrong?