1

I am trying to play a large file (around 500 mb) from my server. The video will play as streaming video. But I am getting following error:

**2012-06-11 23:40:28.073 defenceCourses[18184:11f03] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'An AVPlayerItem cannot be associated with more than one instance of AVPlayer'
*** First throw call stack:
(0x113022 0x1607cd6 0x29fadb3 0x29f024e 0x29f1194 0x188d330 0x188f509 0x4a803 0x49d84 0x49c9b 0x1b6d7d8 0x1b6d88a 0x4ee626 0x27c2 0x2735 0x1)
terminate called throwing an exception**

Following is my code:

NSURL *fileURL = [NSURL URLWithString:@"http://www.defencecourse.com/digital-reproductions/yellow-belt.mp4"];
moviePlayerController = [[MPMoviePlayerController alloc] initWithContentURL:fileURL]; 
[moviePlayerController prepareToPlay];
[moviePlayerController.view setFrame:CGRectMake(0, 70, 320, 270)]; 
[self.view addSubview:moviePlayerController.view];  
moviePlayerController.fullscreen = YES;  
[moviePlayerController play];

How can I resolve this?

4

0 回答 0