我想在我的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