How to remove / free AVPlayer / AVPlayerItem correctly?

I am implementing a video application that displays video and can broadcast or watch local videos. If I try to watch a video with my player that inherits from AVPlayer, a lot of streams initiated 15-20 times, the system does not allocate AVPlayer and even if I do not get any errors, viewing the player is empty and nothing happens ... I need kill the recovery application.

How to deal with this?

Thanks in advance

+7
ios objective-c avfoundation avplayer avplayerlayer
source share
1 answer

I had the same problem, in my case AVPlayerLayer did not get DE, because somehow the user shortcut captured a strong link to the controller and the controller did not get the DE allocation. Implement

deinit { } 

in your controller and check it or not. If not, you have a solution. Hope this helps.

+1
source share

All Articles