renzifeng/ZFPlayer

v4.1.1,不兼容xcode13.4.1运行iOS16,无法横屏

sfandy126 opened this issue · 1 comments

1、ZFOrientationObserver.m 对象landscapeRotationManager初始化判断错误;
2、ZFLandscapeRotationManager_iOS16.m这个类中处理的逻辑不太对;
希望大佬更新下

1、ZFOrientationObserver.m 对象landscapeRotationManager初始化判断错误; 2、ZFLandscapeRotationManager_iOS16.m这个类中处理的逻辑不太对; 希望大佬更新下

兼容xcode13.4.1 运行iOS16
if (!_landscapeRotationManager) {
if (@available(iOS 16.0, *)) {
_landscapeRotationManager = [[ZFLandscapeRotationManager_iOS16 alloc] init];
} else {
_landscapeRotationManager = [[ZFLandscapeRotationManager_iOS15 alloc] init];
}
}

  • (void)setNeedsUpdateOfSupportedInterfaceOrientations {
    if (@available(iOS 16.0, *)) {
    #if __IPHONE_OS_VERSION_MAX_ALLOWED >= 160000
    [UIApplication.sharedApplication.keyWindow.rootViewController setNeedsUpdateOfSupportedInterfaceOrientations];
    [self.window.rootViewController setNeedsUpdateOfSupportedInterfaceOrientations];
    #else
    [(id)UIApplication.sharedApplication.keyWindow.rootViewController setNeedsUpdateOfSupportedInterfaceOrientations];
    [(id)self.window.rootViewController setNeedsUpdateOfSupportedInterfaceOrientations];
    #endif
    }
    }