iOS 3.2 MPMoviePlayerViewController and Three 20's TTNavigator
I tried running my working 3.1.x application on 3.2 and realized that the MPPlayerController framework had changed.
After doing some research the common method should be to add the MPMoviePla开发者_StackOverflowyerViewController's view as a subview.
Somehow this does not work for me ...
I have TTTableViewController with items such as :
[TTTableSubtitleItem itemWithText:@"Text" subtitle:@"subtitle" imageURL:@"bundle://1.jpg" defaultImage:nil URL:@"tt://videos/0" accessoryURL:nil],
This is then mapped:
[map from:@"tt://videos/(playMovieAtIndex:)" toViewController: [VideoViewController class]];
and the VideoViewController finally plays the movie:
MPMoviePlayerViewController* controller =
[[MPMoviePlayerViewController alloc] initWithContentURL:theURL];
if (controller)
{
self.mp = controller;
self.mp.moviePlayer.controlStyle = MPMovieControlStyleFullscreen;
self.mp.moviePlayer.scalingMode = MPMovieScalingModeAspectFit;
self.mp.moviePlayer.movieSourceType = MPMovieSourceTypeFile;
[controller release];
[self presentMoviePlayerViewControllerAnimated:self.mp];
[self.mp.moviePlayer play];
}
But only audio is played, and the MoviePlayer view is not actually shown. What am I doing wrong ?
I had the same problem. My quick work-around was to not use:
[self presentMoviePlayerViewControllerAnimated:self.mp];
But instead, add the subview to the parent controller manually:
[self.view addSubview:self.mp.view];
精彩评论