AVPlayerViewController troubles

I’ve removed the standard UIImagePickerController to let users pick photos and videos from their camera roll, and while it functions pretty well at that, it had the annoying habit of automatically displaying videos and images on the external display, for my application, this is undesirable, as we’re already using the secondary display for our own purposes.

So I decided to build my own copy of the picker controller, fairly simple to do using the photos framework, a table view, a collection view and some views for displaying videos and images. But then I ran into trouble again with the AVPLayerViewController I was going to use so the user can check the video before importing. While it presents properly at first, there’s a full screen icon that can be selected and again, the video takes over the external display. It’s possible for the AVPlayer object you associate with the controller to disable external playback, but the view controller ignores this setting, very frustrating.

So I’m going to have to build my own player, really not that difficult, but will involve creating some icons, more code, time and testing, when all I really want is a facility to disable the automatic takeover of the external display.

I submitted a bug to Apple about it, but I don’t expect them to move quick. Obviously the AVPlayerViewController was designed to be easy to plug into your app, but the over simplification of the use case is annoying, if you have an external display connected, then you must want the video displayed on it. I guess with the recent addition of Picture in Picture, Apple simply only see special cases where more than one video could be played at once.

Anyway, couple of days delay, but the next update is coming along….

Leave a Reply