feat(ios): update the way to get keyWindow (#3448)
* feat(ios): update the way to get `keyWindow` * lint
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user