From 43ce52a26c8b8c640f7357232aa7c6a35b516a53 Mon Sep 17 00:00:00 2001 From: Ilya Yelagov Date: Thu, 8 Dec 2022 00:35:36 +0400 Subject: [PATCH] Fixing opening stream in landscape --- .../Sources/Components/MediaStreamVideoComponent.swift | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/submodules/TelegramCallsUI/Sources/Components/MediaStreamVideoComponent.swift b/submodules/TelegramCallsUI/Sources/Components/MediaStreamVideoComponent.swift index e60772bed3..b5ed94f15a 100644 --- a/submodules/TelegramCallsUI/Sources/Components/MediaStreamVideoComponent.swift +++ b/submodules/TelegramCallsUI/Sources/Components/MediaStreamVideoComponent.swift @@ -548,7 +548,7 @@ final class _MediaStreamVideoComponent: Component { } } } - fullScreenBackgroundPlaceholder.removeFromSuperview() +// fullScreenBackgroundPlaceholder.removeFromSuperview() } else if component.isFullscreen { if fullScreenBackgroundPlaceholder.superview == nil { insertSubview(fullScreenBackgroundPlaceholder, at: 0) @@ -583,8 +583,8 @@ final class _MediaStreamVideoComponent: Component { } // } var aspect = videoView.getAspect() - // saveAspect(aspect) - if component.isFullscreen { + // aspect == 1 the first run + if component.isFullscreen && self.hadVideo { if aspect <= 0.01 { aspect = 16.0 / 9 // 3.0 / 4.0 } @@ -650,6 +650,7 @@ final class _MediaStreamVideoComponent: Component { videoSize = CGSize(width: 16 / 9 * 100.0, height: 100.0).aspectFitted(.init(width: availableSize.width - videoInset * 2, height: availableSize.height)) } loadingBlurView.frame = CGRect(origin: CGPoint(x: floor((availableSize.width - videoSize.width) / 2.0), y: floor((availableSize.height - videoSize.height) / 2.0)), size: videoSize) + print("[LBVFrame] \(loadingBlurView.frame)") loadingBlurView.layer.cornerRadius = videoCornerRadius placeholderView.frame = loadingBlurView.frame