mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Fix video display
This commit is contained in:
parent
2fab1d113e
commit
0afe444a8f
@ -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,
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user