xcodempmovieplayercontrollernsdocumentdirectoryios8.2

I am trying to play video file from document directory but its not playing in xcode6.2 with ios8.2


Hi i already working on MPMoviePlayerController but now i am facing issue in that, i thing that may be a version issue of xcode or 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];

error

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: Error '!obj' trying to fetch default input device's sample rate 2015-03-20 18:47:51.949 SampleConcepts[3266:86205] 18:47:51.949 ERROR: 100: Error getting audio input device sample rate: '!obj' 2015-03-20 18:47:51.949 SampleConcepts[3266:86205] 18:47:51.949 WARNING: 230: The input device is 0x0; '(null)' 2015-03-20 18:47:51.949 SampleConcepts[3266:86205] 18:47:51.949 WARNING: 234: The output device is 0x26; 'AppleHDAEngineOutput:1B,0,1,2:0' 2015-03-20 18:47:51.949 SampleConcepts[3266:86205] 18:47:51.949 ERROR: 404: error '!obj' 2015-03-20 18:47:51.949 SampleConcepts[3266:84774] 18:47:51.949 ERROR: 404: error -66680 2015-03-20 18:47:51.949 SampleConcepts[3266:86205] 18:47:51.949 ERROR: 113: * * * NULL AQIONode object 2015-03-20 18:47:51.950 SampleConcepts[3266:84774] 18:47:51.949 ERROR: 404: error -66680 2015-03-20 18:47:51.950 SampleConcepts[3266:86205] 18:47:51.950 ERROR: 703: Can't make UISound Renderer 2015-03-20 18:47:51.950 SampleConcepts[3266:84774] 18:47:51.950 ERROR: 404: error -66680 2015-03-20 18:47:51.950 SampleConcepts[3266:84774] 18:47:51.950 ERROR: 404: error -66680

My thought is problem problem may be in xcode6.2 and ios8.2, is anyone handle the scenario previously?

Guide me to fix this issue.


Solution

  • Yes, your code is correct. You can run a MPMoviePlayerController on iOS8.1 and above use XCode6.0.1 its working fine for me.