AVPlayer not ready for display

In my IOS app I have a screen that show short video using AVPlayer. I leave and re-enter this screen few times successfully but after seven times and more i get blank and AVPlayerLayer's IsReadyForDisplay property is 'NO'.

I pause AVPlayer and remove AVPlayerLayer from from view's layer. It seem to me that it not memory use issue(17Mb usage).

I think the problem is AVPlayer buffer which use to read video file, but I didn't find any way to clean/or clear this buffer.


Did anyone have this kind of problem whne he use AVPlayer?

I have a same issue..

I export Video to location and play it with AVPlayer sometimes its playing fine. but some times it not showing/rendering video on layer only i hear voice, when i let app go to background and let it in forground again in a sec its showing the video.. Strange.. Please help me if you have an solution.

I have the same problem. Did you find any solution to this problem?

In my case I have to open a video, that I download from the server and save it in the documents folder. After 17 times opening the viedeo the AVPlayerLayer property IsReadyForDisplay is NO. Every time after that the IsReadyForDisplay is always NO.

Any help is apreciated!

Funny I also tested and see that after the 16 times the 17th try does not show the video.

Only after closing the app and starting again it works again for 16 times.

did you find a solution?

I managed to solve the problem, in my code that cleans the video before playing another video I added ([self.playerLayer removeFromSuperlayer];)


[player setAllowsExternalPlayback:NO];
[self stop];
[player removeObserver:self forKeyPath:@"rate"];
[self.playerLayer removeFromSuperlayer];
[self setPlayer:nil];
[self setPlayerLayer:nil];
[self removeFromSuperview];


Now always works!!! even after 16 times.

AVPlayer not ready for display
 
 
Q