AVPlayerViewController pops all UIViewControllers from UINavigationController when exits from fullscreen (iOS 13)

白昼怎懂夜的黑 提交于 2019-12-11 17:00:54

问题


Note that this problem occurs specifically in iOS 13. The same code and structure works perfectly on iOS 10~12. The app plays video on a UIViewController that is pushed into the UINavigationViewController. The video plays fine and goes to full screen as usual but when I press the done button to exit the fullscreen, the entire stack of UIViewControllers gets popped and it lands in the home view.

I'm using xib, swift 5, Xcode 11

Here's the code where I create the player and play the video:

let playerController = AVPlayerViewController()
playerController.player = player
addChild(playerController)
playerView.addSubview(playerController.view)
playerController.view.frame = playerView.frame //playerView is a UIView in my UIViewController
player.play()

I want just want to exit full screen while staying on the same UIViewController. Here's a Screenshot. I hope this helps.

来源:https://stackoverflow.com/questions/58116399/avplayerviewcontroller-pops-all-uiviewcontrollers-from-uinavigationcontroller-wh

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!