feat(ios): update the way to get keyWindow (#3448)

* feat(ios): update the way to get `keyWindow`

* lint
This commit is contained in:
Krzysztof Moch
2023-12-28 12:58:25 +01:00
committed by GitHub
parent 1a9ea827c0
commit f35727f30e
3 changed files with 26 additions and 5 deletions

View File

@@ -35,8 +35,13 @@ class RCTVideoPlayerViewController: AVPlayerViewController {
return .portrait
} else {
// default case
let orientation = UIApplication.shared.statusBarOrientation
return orientation
if #available(iOS 13, tvOS 13, *) {
return RCTVideoUtils.getCurrentWindow()?.windowScene?.interfaceOrientation ?? .unknown
} else {
#if !os(visionOS)
return UIApplication.shared.statusBarOrientation
#endif
}
}
}