_itemFailedToPlayToEnd: {kind = 1; new = 2; old = 0; }

my video does not play

// _itemFailedToPlayToEnd: { kind = 1; new = 2; old = 0; } 

my url

 http://leuipe.fr.feedportal.com/c/3265/f/43169/s/2f1abb6/sc/35/l/0Lvideo0Blequipe0Bfr0Cvideo0Cd3b6e1d4cccs0Bhtml/story.htm 

my code

  movieURL=[NSURL URLWithString:[_dic valueForKey:kRssLink]]; NSLog(@"%@",movieURL); player = [[MPMoviePlayerController alloc] init]; [player setContentURL:movieURL]; [player.view setFrame:CGRectMake (0, 100, 320, 476)]; [self.view addSubview:player.view]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(moviePlayBackDidFinish:) name:MPMoviePlayerPlaybackDidFinishNotification object:player]; [player play]; 
+8
objective-c ios7
source share
8 answers

I also had the same problem

  _itemFailedToPlayToEnd: { kind = 1; new = 2; old = 0; } 

But I realized that there was no file on the specified URL. Therefore, make sure that there is a file at the specified URL.

+5
source share

I had this problem when using the following to generate the url of my MPMoviePlayerController

  NSURL *url = [NSURL URLWithString:self.videoURL]; 

I fixed it using:

  NSURL *url = [NSURL fileURLWithPath:self.videoURL]; 
+2
source share

I had the same problem, examined many topics and did not find a working solution. My application stores movie files in cloud storage (Parse, Amazon S3) and plays them using MPMoviePlayerController.

The reason for this behavior is as follows: MPMoviePlayerController does not want to play files without the extension. Therefore, the addition of the .mov extension to file names has been fixed.

+1
source share

Similar problem with file.mp4
None of these answers resolved my issue.
I resolved it by exporting the file in quicktime:

  • Open mp4 in Quicktime :)
  • Go to the menu: File → Export → iPad, iphone, ipod, ...
  • Choose the appropriate format for your needs.

I ended up with the m4v file.

+1
source share

Try setting these properties, I am solving the problem with the same error message by adding these two properties.

 [player setScalingMode:MPMovieScalingModeAspectFit]; player.view.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight; 
0
source share

Please check this out . I found that I resized the video to a smaller size (from 2048 x 1536 to 1024 x 768). It can be played on iPad 2.

0
source share

This may be a problem in the video format. Please verify that the video format is H.264 or AVC encoding. If your video format is H.264, then there are certain limitations. Check out this link https://developer.apple.com/library/ios/documentation/MediaPlayer/Reference/MPMoviePlayerController_Class/

0
source share

Had a similar problem and found out that the aspect ratio of the video is causing an error. In principle, a video with a certain aspect ratio will work on some devices and will not be the rest:

Device - video aspect ratio

  • iPad - 4: 3
  • iPhone 4-inch - 16: 9
  • iPhone 3.5-inch - 3: 2

Hope this helps.

-one
source share

All Articles