OGeek|极客世界-中国程序员成长平台

标题: ios - 当 AVPlayerViewController 全屏时处理 [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-13 12:07
标题: ios - 当 AVPlayerViewController 全屏时处理

我的应用程序仅用于纵向模式。使用 MPMoviePlayerController 播放器时,会有诸如 MPMoviePlayerWillEnterFullscreenNotification 和 MPMoviePlayerWillExitFullscreenNotification 之类的通知。然后我可以在应用程序委托(delegate)中调整supportedInterfaceOrientationsForWindow。它运作良好。

是否可以使用 KVO 处理新播放器/项目的任何属性更改,以便我可以检测到它在没有私有(private) api 的情况下进入全屏的时刻?我试图观察界限,呈现模式。但是当按下全屏按钮时没有任何改变。为什么不能处理 AVPlayerViewController 的按钮?



Best Answer-推荐答案


答案就在这里suggesting to observe the videoBounds我最初观察到但对我不起作用的 AVPlayerViewController。

此解决方案并不总是有效。与 AVPlayerViewController Controller 的 videoBounds 属性相关的通知并不总是发出。

关于ios - 当 AVPlayerViewController 全屏时处理,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34000768/






欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://sqlite.in/) Powered by Discuz! X3.4