我正在尝试从文档目录播放视频文件,但它不能在xcode6.2中使用ios8.2播放

时间:2015-03-20 13:27:53

标签: xcode mpmovieplayercontroller nsdocumentdirectory ios8.2

您好我已经在使用MPMoviePlayerController,但现在我面临的问题是,我可能是xcode或ios的版本问题

NSString*theMoviePath=[NSString stringWithFormat:@"%@/9441426768774.mp4", [[AppDelegate appdelegate] getDocumentDirectoryPath]]; AnandLog(@"theMovieURL :--->%@", theMoviePath); NSURL*theMovieURL=[NSURL fileURLWithPath:theMoviePath]; self.moviePlayer=[[MPMoviePlayerController alloc] initWithContentURL:theMovieURL]; [self.moviePlayer.view setFrame:CGRectMake(40, 197, 240, 160)]; [self.moviePlayer prepareToPlay]; [self.moviePlayer setShouldAutoplay:NO]; // And other options you can look through the documentation. [self.view addSubview:self.moviePlayer.view];

错误

heMovieURL :--->/Users/ndot/Library/Developer/CoreSimulator/Devices/B147415A-F1F1-4576-972B-D1AE2C36993D/data/Containers/Data/Application/36777A8E-DE7D-4B7F-A74F-DF0835568C5D/Documents/9441426768774.mp4

2015-03-20 18:47:51.948 SampleConcepts [3266:86205] 18:47:51.948 ERROR:98:错误'!obj'试图获取默认输入设备的采样率 2015-03-20 18:47:51.949 SampleConcepts [3266:86205] 18:47:51.949 ERROR:100:获取音频输入设备采样率时出错:'!obj' 2015-03-20 18:47:51.949 SampleConcepts [3266:86205] 18:47:51.949警告:230:输入设备为0x0; '(空)' 2015-03-20 18:47:51.949 SampleConcepts [3266:86205] 18:47:51.949警告:234:输出设备为0x26; ' AppleHDAEngineOutput:1B,0,1,2:0' 2015-03-20 18:47:51.949 SampleConcepts [3266:86205] 18:47:51.949错误:404:错误'!obj' 2015-03-20 18:47:51.949 SampleConcepts [3266:84774] 18:47:51.949错误:404:错误-66680 2015-03-20 18:47:51.949 SampleConcepts [3266:86205] 18:47:51.949 ERROR:113:* * * NULL AQIONode对象 2015-03-20 18:47:51.950 SampleConcepts [3266:84774] 18:47:51.949错误:404:错误-66680 2015-03-20 18:47:51.950 SampleConcepts [3266:86205] 18:47:51.950错误:703:无法生成UISound渲染器 2015-03-20 18:47:51.950 SampleConcepts [3266:84774] 18:47:51.950错误:404:错误-66680 2015-03-20 18:47:51.950 SampleConcepts [3266:84774] 18:47:51.950错误:404:错误-66680

我的想法是问题问题可能在 xcode6.2和ios8.2,以前有人处理过这个场景吗?

指导我解决此问题。

1 个答案:

答案 0 :(得分:1)

是的,您的代码是正确的。您可以在MPMoviePlayerController及以上使用iOS8.1上运行XCode6.0.1,对我来说工作正常。

相关问题