Detect when AVPictureInPictureController shows black screen

Hi all,

I'm using AVPictureInPictureController to show CMSampleBuffers. No problems with that. When the Picture in Picture view/window is active and the phone is locked for long enough (~30 seconds), the Picture in Picture view/window will show black. I've noticed the same happens with Netflix, so I assume there is no way around that.

So when that happens (i.e. Picture in Picture view/window will showing black), I would like to just stop Picture-in-Picture mode. For this, I would need to be able to detect when Picture in Picture view/window will starts showing black pixels.

I've tried listening for UIApplication lifetime events (such as didResignActive. and didMoveToBackground), but as my app is a location-based app that received Location updates in the background, those are not at all an indicator of the black PiP window.

Any suggestions for me on how to handle the PiP window showing a black window upon unlocking the phone?

Post not yet marked as solved Up vote post of Joride Down vote post of Joride
400 views

Replies

Did you find any solution? I had to have another buffer enqueued every second to circumvent this symptom.