I'm developing a video gallery, I have a ScrollView with multiple views inside of it, each view has a single AVPlayer - so far it's pretty standard I guess. Note that all of the AVPlayers are pre-loaded with their video, waiting to be played.
The problem occurs when I have many items (videos) in the gallery. At any given time - only 16 of them are shown, from start to end, the rest shows a black screen. If I'm reversing the order of the items - the other 16 from the new side are shown, and the rest shows a black screen too.
Additionally, if I go to another screen and then come back to the gallery - everything becomes black and nothing shown.
If i'm replacing the players with a random color background for each view - all of the views are shown. So I assume the problem is with the players and not with the views themselves.
According to Xcode my app only use ~7-10% CPU and ~10-11 MB of RAM so it doesn't looks like a performance problem - more like a limitation of concurrent active AVPlayers but I couldn't find any information regarding that.
Does anyone have any suggestions? this is driving me crazy.
Thanks in advance!