我正在使用以下代码:
然而,当代码被执行时,电影播放器出现了,但电影从未加载。
为了保持自己的理智,我添加了以下行:
NSString *filepath = [[NSBundle mainBundle] pathForResource:@"MovieName" ofType:@"mov"];
NSURL *fileURL = [NSURL fileURLWithPath:filepath isDirectory:NO];
MPMoviePlayerController *moviePlayerController = [[MPMoviePlayerController alloc] initWithContentURL:fileURL];
[self.view addSubview:moviePlayerController.view];
moviePlayerController.movieSourceType = MPMovieSourceTypeFile;
moviePlayerController.contentURL = fileURL;
moviePlayerController.fullscreen = YES;
[moviePlayerController prepareToPlay];
[moviePlayerController play];
然而,当代码被执行时,电影播放器出现了,但电影从未加载。
为了保持自己的理智,我添加了以下行:
NSData *thedata = [[NSData alloc]initWithContentsOfFile:filepath];
我可以证实电影确实存在,因为它已经加载到NSData对象中。
我将要去哪里工作?