我想要使用下面的代碼來播放一個基本的.mov視頻文件,但是當按下我指定的按鈕時,唯一顯示的是黑框,但沒有播放視頻。任何幫助表示讚賞。謝謝。爲什麼我的MPMoviePlayerController不能播放?
@implementation SRViewController
-(IBAction)playMovie{
NSString *url = [[NSBundle mainBundle]
pathForResource:@"OntheTitle" ofType:@"mov"];
MPMoviePlayerController *player = [[MPMoviePlayerController alloc]
initWithContentURL: [NSURL fileURLWithPath:url]];
// Play Partial Screen
player.view.frame = CGRectMake(10, 10, 720, 480);
[self.view addSubview:player.view];
// Play Movie
[player play];
}
@end
它顯示黑屏? – 2013-02-25 05:04:28