Is it possible to check if an AVPlayerLayer
which is added as a sublayer to a ViewController's subview's layer is visible or not? Basically if at any point of time, another view be laid over the said subview, I require to pause the AVPlayer
, even if it is obscured partially. Note that I set the zPosition
of the AVPlayerLayer
to -1 when adding it as a sublayer. The implementation is in a framework that I'm working on so I have no control if the end developer puts another subview over the subview or inside the subview that contains the AVPlayerLayer
.
Some things to consider are that someone(end developer using my framework) could:
- Add multiple subviews over the the subview or inside the subview with my player
- Add a sublayer to the subview with my player, thus obscuring the player
Any help is appreciated.