diff --git a/ios/Video/RCTVideo.swift b/ios/Video/RCTVideo.swift index 810d656573..486524d947 100644 --- a/ios/Video/RCTVideo.swift +++ b/ios/Video/RCTVideo.swift @@ -1383,12 +1383,14 @@ class RCTVideo: UIView, RCTVideoPlayerViewControllerDelegate, RCTPlayerObserverH var orientation = "undefined" let tracks = await RCTVideoAssetsUtils.getTracks(asset: _playerItem.asset, withMediaType: .video) - if let videoTrack = tracks?.first { - width = Float(videoTrack.naturalSize.width) - height = Float(videoTrack.naturalSize.height) - } else if _playerItem.presentationSize.height != 0.0 { - width = Float(_playerItem.presentationSize.width) - height = Float(_playerItem.presentationSize.height) + var presentationSize = _playerItem.presentationSize + if presentationSize.height != 0.0 { + width = Float(presentationSize.width) + height = Float(presentationSize.height) + } else if let videoTrack = tracks?.first { + let naturalSize = videoTrack.naturalSize + width = Float(naturalSize.width) + height = Float(naturalSize.height) } orientation = width > height ? "landscape" : width == height ? "square" : "portrait"