我正在尝试使用以下代码播放基本的.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