I got this piece of code:
theMoviPlayer = [[MPMoviePlayerController alloc] initWithContentURL:[NSURL fileURLWithPath:@"/Resources/disc.mp4"]];
theMoviPlayer.controlStyle = MPMovieControlStyleFullscreen;
theMoviPlayer.view.transform = CGAffineTransformConcat(theMoviPlayer.view.transform, CGAffineTransformMakeRotation(M_PI_2));
UIWindow *backgroundWindow = [[UIApplication sharedApplication] keyWindow];
[theMoviPlayer.view setFrame:backgroundWindow.frame];
[backgroundWindow addSubview:theMoviPlayer.view];
[theMoviPlayer play];
但我真的不知道如何将视频添加到我的项目中。我应该把视频文件放在哪个文件夹中?还是需要做其他事情才能将其添加到我的项目中?
编辑:
在xcode中是这样的,这正确吗? 因为我现在遇到了播放错误。 以前我使用url来播放这个视频,这很好用,但是本地文件却不行 :(