How do I intercept tapping of the done button in AVPlayerViewController?

前端 未结 10 740
渐次进展
渐次进展 2021-01-03 22:45

I created an AVPlayerViewController and an attached AVPlayer in the viewDidAppear method of a custom UIViewController. Ho

10条回答
  •  太阳男子
    2021-01-03 23:10

    I am not sure if this helps your usecase, but if you can target iOS 12+, AVPlayerViewController does provide a delegate property/protocol (AVPlayerViewControllerDelegate) with a few related delegate methods that might help (see below): Particularly on iOS 12+:

        func playerViewController(_ playerViewController: AVPlayerViewController, willEndFullScreenPresentationWithAnimationCoordinator coordinator: UIViewControllerTransitionCoordinator) 
    

    On tvOS 11+:

        func playerViewControllerShouldDismiss(_ playerViewController: AVPlayerViewController) -> Bool 
        func playerViewControllerWillBeginDismissalTransition(_ playerViewController: AVPlayerViewController) 
        func playerViewControllerDidEndDismissalTransition(_ playerViewController: AVPlayerViewController)
    

提交回复
热议问题