diff --git a/submodules/TelegramCallsUI/Sources/VideoChatMicButtonComponent.swift b/submodules/TelegramCallsUI/Sources/VideoChatMicButtonComponent.swift index 136a630482..c7eaa862bf 100644 --- a/submodules/TelegramCallsUI/Sources/VideoChatMicButtonComponent.swift +++ b/submodules/TelegramCallsUI/Sources/VideoChatMicButtonComponent.swift @@ -73,6 +73,18 @@ final class VideoChatMicButtonComponent: Component { } override func endTracking(_ touch: UITouch?, with event: UIEvent?) { + performEndOrCancelTracking() + + return super.endTracking(touch, with: event) + } + + override func cancelTracking(with event: UIEvent?) { + performEndOrCancelTracking() + + return super.cancelTracking(with: event) + } + + private func performEndOrCancelTracking() { if let component = self.component { let timestamp = CFAbsoluteTimeGetCurrent() @@ -93,12 +105,6 @@ final class VideoChatMicButtonComponent: Component { } } } - - return super.endTracking(touch, with: event) - } - - override func cancelTracking(with event: UIEvent?) { - return super.cancelTracking(with: event) } required init?(coder: NSCoder) { @@ -117,10 +123,12 @@ final class VideoChatMicButtonComponent: Component { let titleText: String let backgroundColor: UIColor + var isEnabled = true switch component.content { case .connecting: titleText = "Connecting..." backgroundColor = UIColor(white: 1.0, alpha: 0.1) + isEnabled = false case .muted: titleText = "Unmute" backgroundColor = UIColor(rgb: 0x0086FF) @@ -128,6 +136,7 @@ final class VideoChatMicButtonComponent: Component { titleText = "Mute" backgroundColor = UIColor(rgb: 0x34C659) } + self.isEnabled = isEnabled let titleSize = self.title.update( transition: .immediate, diff --git a/submodules/TelegramCallsUI/Sources/VideoChatParticipantVideoComponent.swift b/submodules/TelegramCallsUI/Sources/VideoChatParticipantVideoComponent.swift index 05a3398d6f..14c89b4280 100644 --- a/submodules/TelegramCallsUI/Sources/VideoChatParticipantVideoComponent.swift +++ b/submodules/TelegramCallsUI/Sources/VideoChatParticipantVideoComponent.swift @@ -244,7 +244,11 @@ final class VideoChatParticipantVideoComponent: Component { videoBackgroundLayer = SimpleLayer() videoBackgroundLayer.backgroundColor = UIColor(white: 0.1, alpha: 1.0).cgColor self.videoBackgroundLayer = videoBackgroundLayer - self.layer.insertSublayer(videoBackgroundLayer, at: 0) + if let blurredAvatarView = self.blurredAvatarView { + self.layer.insertSublayer(videoBackgroundLayer, above: blurredAvatarView.layer) + } else { + self.layer.insertSublayer(videoBackgroundLayer, at: 0) + } videoBackgroundLayer.isHidden = true }