Fixing opening stream in landscape

This commit is contained in:
Ilya Yelagov 2022-12-08 00:35:36 +04:00
parent 17ef4ae35b
commit 43ce52a26c

View File

@ -548,7 +548,7 @@ final class _MediaStreamVideoComponent: Component {
} }
} }
} }
fullScreenBackgroundPlaceholder.removeFromSuperview() // fullScreenBackgroundPlaceholder.removeFromSuperview()
} else if component.isFullscreen { } else if component.isFullscreen {
if fullScreenBackgroundPlaceholder.superview == nil { if fullScreenBackgroundPlaceholder.superview == nil {
insertSubview(fullScreenBackgroundPlaceholder, at: 0) insertSubview(fullScreenBackgroundPlaceholder, at: 0)
@ -583,8 +583,8 @@ final class _MediaStreamVideoComponent: Component {
} }
// } // }
var aspect = videoView.getAspect() var aspect = videoView.getAspect()
// saveAspect(aspect) // aspect == 1 the first run
if component.isFullscreen { if component.isFullscreen && self.hadVideo {
if aspect <= 0.01 { if aspect <= 0.01 {
aspect = 16.0 / 9 // 3.0 / 4.0 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)) 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) 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 loadingBlurView.layer.cornerRadius = videoCornerRadius
placeholderView.frame = loadingBlurView.frame placeholderView.frame = loadingBlurView.frame