Call improvements, use shared code

This commit is contained in:
Ali
2020-07-14 19:59:01 +04:00
parent 118422e26c
commit e22768171a
37 changed files with 216 additions and 4658 deletions

View File

@@ -210,7 +210,11 @@ final class CallControllerButtonsNode: ASDisplayNode {
}
topButtons.append(.enableCamera(isCameraActive))
topButtons.append(.mute(self.isMuted))
topButtons.append(.switchCamera)
if case .possible = videoState {
topButtons.append(.soundOutput(soundOutput))
} else {
topButtons.append(.switchCamera)
}
case .notAvailable:
topButtons.append(.mute(self.isMuted))
topButtons.append(.soundOutput(soundOutput))
@@ -302,7 +306,7 @@ final class CallControllerButtonsNode: ASDisplayNode {
topButtons.append(.enableCamera(false))
topButtons.append(.mute(self.isMuted))
topButtons.append(.switchCamera)
topButtons.append(.soundOutput(soundOutput))
let topButtonsContentWidth = CGFloat(topButtons.count) * smallButtonSize
let topButtonsAvailableSpacingWidth = width - topButtonsContentWidth - minSmallButtonSideInset * 2.0