iosswiftavplayeravplayerviewcontroller

AVPlayerViewController simply won't play in the fullscreen mode, once you tap the expand icon, what setting could cause this?


I have a simple AVPlayerViewController which sits in a box on the screen in the usual way, it plays / does everything perfectly.

enter image description here

If you tap the expander,

enter image description here

the phone perfectly brings up the usual normal fullscreen player,

enter image description here

However it simply does not play - it just remains black.

In detail,

I DO have this set,

enter image description here

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?


Solution

  • Possible solution - Apple issue

    It seems there might be a bug or unusual behavior in recent (2023) AVKit.

    In short - it seems that

    BUT

    (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.)

    Demo ...

    Not furthest view controller?

    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.