5

I have 2 view controllers, the first one contains a table of video information list, then one item is selected from list, detail view controller opened via navigation. I used AVPlayer at this detail controller. Sometimes AVPlayer fails with AVPlayerItemStatusFailed and after that failure occurred, avplayer continues to failed with AVPlayerItemStatusFailed. Although i tried to clear the avplayer instance and create new one, i cannot achieve AVPlayerItemStatusFailed failure to solve. Also popping detail view controller from navigation and initializing new item via selecting new item from list does not solve the problem.

So I figured that out AVPlayer cloudn't been cleared completely although the owner view controller is removed from the navigation stack. Is there anybody suggest anything to try for clearing the AVPlayer completely and make it works after failure?

Thanks in advance...

crazywood
  • 1,455
  • 1
  • 10
  • 17
  • The problem in AVPlayerLayer, see my topic: http://stackoverflow.com/questions/23850366/avplayer-fails-with-avplayeritemstatusfailed-osstatus-error-12983 – instback May 25 '14 at 12:43

1 Answers1

0

What do you mean by clearing the AVPlayer?

Have you tried to recreate the AVPlayerItem? If your AVPlayer continues to fail after recreating the AVPlayerItem, you may need to recreate the AVPlayer as well. There are certain AVFoundation errors that will cause the AVPlayer to become unusable.

dzl
  • 908
  • 11
  • 32
  • I mean resetting the player in order to get rid of the failure (AVPlayerItemStatusFailed). Yes, i tried to recreate both AVPlayer and AVPlayerItem. I also searched for the error but not find a solution. The error that received: Error Domain=AVFoundationErrorDomain Code=-11800 "The operation could not be completed" UserInfo=0x1a689360 {NSLocalizedDescription=The operation could not be completed, NSUnderlyingError=0x1a688e70 "The operation couldn’t be completed. (OSStatus error -12983.)", NSLocalizedFailureReason=An unknown error occurred (-12983)} – crazywood Apr 02 '14 at 12:05
  • Can you elaborate on the kind of media you're trying to play? That error is commonly seen when the AVPlayer can't play the file. – dzl Apr 02 '14 at 12:08
  • I'm playing .mp4 files. But i've faced with the same problem with different video files. I've also checked the video file whether it is corrupted or not when the problem occurred. So the video files should not be the problem ;( – crazywood Apr 02 '14 at 12:20
  • I am facing the same issue. Did you get any solution for AVFoundationErrorDomain Code=-11800 & An unknown error occurred (-12983) ? I checked my video files. They can be played correctly in MAC. – Nitin May 19 '14 at 10:19
  • 1
    Also make sure that you are not retaining any object of either AVPlayer, AVPlayerLayer or AVPlayerItem. In my case I was using [player addPeriodicTimeObserverForInterval:] to get periodic intervals. it was retaining AVPlayer. Instead i used an NSTimer and Invalidated it when required – Qamar Suleiman Jan 08 '15 at 19:05