我想在我的iPhone应用中播放短片。当我使用下面的代码时,我只听到音频,并看到应用程序的常规视图 。我希望视频能够在此视图之上播放。 我能做些什么呢?在iOS应用中播放视频:音频但无图片
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];
谢谢您的回答。尝试用您的建议替换MPMoviePlayerController部件,但不断收到错误... – user664142 2011-03-17 11:26:37
以下是我所做的: – user664142 2011-03-17 11:30:35