I have a simple AVPlayerViewController
which sits in a box on the screen in the usual way, it plays / does everything perfectly.
If you tap the expander,
the phone perfectly brings up the usual normal fullscreen player,
However it simply does not play - it just remains black.
In detail,
I DO have this set,
I tried both current Xcode and also would back to 14.3.
I tried numerous physical phones, iOS versions, etc.
The AVPlayerViewController is in fact in the view controller stack, ie "addChild" is set for it.
I did not subclass AVPlayerViewController.
I tried the many settings such as entersFullScreenWhenPlaybackBegins
,
canStartPictureInPictureAutomaticallyFromInline
, they're not relevant.
What the heck could the issue be?
It seems there might be a bug or unusual behavior in recent (2023) AVKit.
In short - it seems that
AVPlayer
works perfectly, when AVPlayerViewController goes to full screen.AVQueuePlayer
simply does not work when AVPlayerViewController goes to full screen.(Unfortunately of course, one almost always uses AVQueuePlayer since AVPlayer as such is a bit useless! I only discovered the issue because I very fortunately happen to use AVPlayer while experimenting on the issue.)
AVPlayer
and AVQueuePlayer
and you'll see it fails spectacularly when you use AVQueuePlayer
This issue seems to arise if the view controller you're working with doesn't happen to be the rearmost one in the nav stack. Situation is unclear though.