I have an AVPlayer located in a collectionView cell, that's in a collectionView, that is located in a collectionView cell.
So to recap, each one of my cells has a collection view in them. Inside that collection view are three cells. One of which contains the AVPlayer.
I want it so that when the user taps on the player, the video within the cell animates to envelope the entire screen.
I initially tried to access keywindow from within the cell, however, because of where the player is located in the view hierarchy. It cannot exceeded the bounds of the collectionView that it's located in.
What was initially recommended to me was to, when tapped, delete the AVPlayer and pass the PlayerLayer's reference to the root view controller. However, I am having trouble in doing so. This is the first time I've had to send a reference "up" in a hierarchy.
So I guess the main question is:
How exactly do I send the playerLayers reference up in the view hierarchy.
also is it possible to reference the playerLayers initial location before tapped so that I may animate the transition seamlessly.
Any suggestions?