3
我使用下面的代碼:的MPMoviePlayerController不加載電影
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對象。
我要去哪裏工作
什麼是錯的米克·沃克代碼? –