我正在尝试使用下面的代码播放基本的 .mov 视频文件,但是当按下我分配了动作的按钮时,唯一显示的是黑框,但没有播放视频。任何帮助表示赞赏。谢谢。
@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