Search code examples
swiftvideoios11avplayerviewcontroller

iOS 11 SDK: AVPlayerViewController no equivalent to willEndFullScreenPresentationWithAnimationCoordinator gets called


Strange issue that is only apparent on iOS 11 SDK.

The problem doesn't present on iOS 12 or iOS 13.

When playing a fullscreen AVPlayerViewController and the user touches the 'X' close button top left, the player dismisses itself but the delegate method:

willEndFullScreenPresentationWithAnimationCoordinator

never gets called.

If I don't have a call back when the player is closed, I can't return control back to my app.

I know from the documentation that this callback was introduced on iOS 12 SDK, so how do I know in iOS 11 SDK when the user has closed the window before the video is ended (even when the video is paused first).

Any advice? This sole issue is preventing me from putting the app on the App Store to support iOS 11.0


Solution

  • Update - on iOS 11 there was this delegate: AVFullScreenViewControllerDelegate

    which had: -(void)fullScreenViewControllerDidEndFullScreenPresentation:(id)arg1 wasInteractive:(BOOL)arg

    but there doesn't seem any way to hook into it from iOS 12 / 13...

    So I guess I have to not support iOS 11?