How to detect fullscreen mode using AVPlayerViewController in Swift?

前端 未结 5 576
花落未央
花落未央 2020-12-10 18:12

I am trying to detect when the AVPlayerViewController is in full-screen mode, but I\'m having a difficult time achieving this. I\'d like to know when the user s

5条回答
  •  半阙折子戏
    2020-12-10 18:41

    Starting from iOS 12 we can use these AVPlayerViewControllerDelegate delegate methods :

    func playerViewController(AVPlayerViewController, willBeginFullScreenPresentationWithAnimationCoordinator: UIViewControllerTransitionCoordinator)
    func playerViewController(AVPlayerViewController, willEndFullScreenPresentationWithAnimationCoordinator: UIViewControllerTransitionCoordinator)
    

提交回复
热议问题