【发布时间】:2011-07-17 07:28:18
【问题描述】:
我想在我的 iphone 应用程序中播放一段短视频。当我使用下面的代码时,我只听到音频并看到 应用程序的常规视图。我希望视频在此视图之上播放。 我该怎么办?
NSBundle *bundle = [NSBundle mainBundle];
NSString *moviePath = [bundle pathForResource:@"LEADER" ofType:@"mov"];
NSURL *movieURL = [[NSURL fileURLWithPath:moviePath] retain];
MPMoviePlayerController *theMovie = [[MPMoviePlayerController alloc] initWithContentURL:movieURL];
theMovie.scalingMode = MPMovieScalingModeAspectFill;
[theMovie play];
MPMoviePlayerViewController *moviePlayer = [[MPMoviePlayerViewController alloc] initWithContentURL:movieURL];
[self presentMoviePlayerViewControllerAnimated:moviePlayer];
【问题讨论】: