How to properly delete/release AVPlayer/AVPlayerItem?
Asked Answered
G

1

10

I am implementing a video app, that lists video and able to stream or watch local videos. If I try to watch videos with my player that inherits from AVPlayer, a lot of threads initated, after 15-20 times, the system does not alloc the AVPlayer well and, even if I do not get any error, the player view is blank and nothing happening...I need to kill app to restore.

How to deal with it?

Thanks in advance

Graiggrail answered 7/10, 2015 at 17:41 Comment(4)
Can you share some code?Locate
This has been bugging me so much lately, I'm looking into it now, and will post something as soon as I find a solution.Expose
did you find any solution with this @Expose ?Bacteriostasis
I have similar trouble. When setup video, and its play well, there creating "com.apple.coremedia.player.async" thread. And if these thread count become 15+ the video don't appear. Its seems to be a limitation for AVPlayer or AVPlayerLayer. I'm also trying to figure out how correct dealloc those players. Did you find some solution?Encephalon
B
2

I had the same issue, in my case the AVPlayerLayer didn’t get DE allocated successfully because somehow a custom label grabbed the strong reference of controller and the controller did not get DE allocated. 

Implement


deinit {

}



in your controller and check this called or not. If not you have the solution. 
I hope this helps.

Boorman answered 7/3, 2018 at 22:2 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.