mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-07-14 23:39:26 +00:00
Merge commit '816ef02fb637d8b074dcda1fa4e7ce1072db927f'
This commit is contained in:
commit
f09a09014f
@ -1948,7 +1948,7 @@ public final class VoiceChatController: ViewController {
|
|||||||
self.actionButtonColorDisposable = (self.actionButton.outerColor
|
self.actionButtonColorDisposable = (self.actionButton.outerColor
|
||||||
|> deliverOnMainQueue).start(next: { [weak self] normalColor, activeColor in
|
|> deliverOnMainQueue).start(next: { [weak self] normalColor, activeColor in
|
||||||
if let strongSelf = self {
|
if let strongSelf = self {
|
||||||
let animated = strongSelf.currentNormalButtonColor != nil
|
let animated = strongSelf.currentNormalButtonColor != nil || strongSelf.currentActiveButtonColor == nil
|
||||||
strongSelf.currentNormalButtonColor = normalColor
|
strongSelf.currentNormalButtonColor = normalColor
|
||||||
strongSelf.currentActiveButtonColor = activeColor
|
strongSelf.currentActiveButtonColor = activeColor
|
||||||
strongSelf.updateButtons(transition: animated ? .animated(duration: 0.3, curve: .linear) : .immediate)
|
strongSelf.updateButtons(transition: animated ? .animated(duration: 0.3, curve: .linear) : .immediate)
|
||||||
@ -2211,19 +2211,21 @@ public final class VoiceChatController: ViewController {
|
|||||||
})))
|
})))
|
||||||
}
|
}
|
||||||
|
|
||||||
if #available(iOS 12.0, *) {
|
if let callState = strongSelf.callState, callState.isVideoEnabled && (callState.muteState?.canUnmute ?? true) {
|
||||||
if strongSelf.call.hasScreencast {
|
if #available(iOS 12.0, *) {
|
||||||
items.append(.action(ContextMenuActionItem(text: strongSelf.presentationData.strings.VoiceChat_StopScreenSharing, icon: { theme in
|
if strongSelf.call.hasScreencast {
|
||||||
return generateTintedImage(image: UIImage(bundleImageName: "Call/Context Menu/ShareScreen"), color: theme.actionSheet.primaryTextColor)
|
items.append(.action(ContextMenuActionItem(text: strongSelf.presentationData.strings.VoiceChat_StopScreenSharing, icon: { theme in
|
||||||
}, action: { _, f in
|
return generateTintedImage(image: UIImage(bundleImageName: "Call/Context Menu/ShareScreen"), color: theme.actionSheet.primaryTextColor)
|
||||||
f(.default)
|
}, action: { _, f in
|
||||||
|
f(.default)
|
||||||
|
|
||||||
self?.call.disableScreencast()
|
self?.call.disableScreencast()
|
||||||
})))
|
})))
|
||||||
} else {
|
} else {
|
||||||
items.append(.custom(VoiceChatShareScreenContextItem(context: strongSelf.context, text: strongSelf.presentationData.strings.VoiceChat_ShareScreen, icon: { theme in
|
items.append(.custom(VoiceChatShareScreenContextItem(context: strongSelf.context, text: strongSelf.presentationData.strings.VoiceChat_ShareScreen, icon: { theme in
|
||||||
return generateTintedImage(image: UIImage(bundleImageName: "Call/Context Menu/ShareScreen"), color: theme.actionSheet.primaryTextColor)
|
return generateTintedImage(image: UIImage(bundleImageName: "Call/Context Menu/ShareScreen"), color: theme.actionSheet.primaryTextColor)
|
||||||
}, action: { _, _ in }), false))
|
}, action: { _, _ in }), false))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3646,6 +3648,10 @@ public final class VoiceChatController: ViewController {
|
|||||||
|
|
||||||
transition.updateAlpha(node: self.cameraButton.textNode, alpha: hasCameraButton ? buttonsTitleAlpha : 0.0)
|
transition.updateAlpha(node: self.cameraButton.textNode, alpha: hasCameraButton ? buttonsTitleAlpha : 0.0)
|
||||||
transition.updateAlpha(node: self.switchCameraButton.textNode, alpha: buttonsTitleAlpha)
|
transition.updateAlpha(node: self.switchCameraButton.textNode, alpha: buttonsTitleAlpha)
|
||||||
|
var audioButtonTransition = transition
|
||||||
|
if hasCameraButton, transition.isAnimated {
|
||||||
|
audioButtonTransition = .animated(duration: 0.15, curve: .easeInOut)
|
||||||
|
}
|
||||||
transition.updateAlpha(node: self.audioButton.textNode, alpha: hasCameraButton ? 0.0 : buttonsTitleAlpha)
|
transition.updateAlpha(node: self.audioButton.textNode, alpha: hasCameraButton ? 0.0 : buttonsTitleAlpha)
|
||||||
transition.updateAlpha(node: self.leaveButton.textNode, alpha: buttonsTitleAlpha)
|
transition.updateAlpha(node: self.leaveButton.textNode, alpha: buttonsTitleAlpha)
|
||||||
}
|
}
|
||||||
@ -4480,7 +4486,7 @@ public final class VoiceChatController: ViewController {
|
|||||||
|
|
||||||
self.requestedVideoChannels = requestedVideoChannels
|
self.requestedVideoChannels = requestedVideoChannels
|
||||||
|
|
||||||
guard self.didSetDataReady || !self.isPanning else {
|
guard self.didSetDataReady && !self.isPanning else {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4596,8 +4602,7 @@ public final class VoiceChatController: ViewController {
|
|||||||
self.requestedVideoSources.insert(channel.endpointId)
|
self.requestedVideoSources.insert(channel.endpointId)
|
||||||
self.call.makeIncomingVideoView(endpointId: channel.endpointId, requestClone: true, completion: { [weak self] videoView, backdropVideoView in
|
self.call.makeIncomingVideoView(endpointId: channel.endpointId, requestClone: true, completion: { [weak self] videoView, backdropVideoView in
|
||||||
Queue.mainQueue().async {
|
Queue.mainQueue().async {
|
||||||
print("create main video \(channel.endpointId)")
|
print("create video \(channel.endpointId)")
|
||||||
print("create blur video \(channel.endpointId)")
|
|
||||||
guard let strongSelf = self, let videoView = videoView else {
|
guard let strongSelf = self, let videoView = videoView else {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -5480,15 +5485,23 @@ public final class VoiceChatController: ViewController {
|
|||||||
let completion = {
|
let completion = {
|
||||||
let effectiveSpeakerPeerId = self.effectiveSpeaker?.0
|
let effectiveSpeakerPeerId = self.effectiveSpeaker?.0
|
||||||
if let effectiveSpeakerPeerId = effectiveSpeakerPeerId, let otherItemNode = verticalItemNodes[String(effectiveSpeakerPeerId.toInt64()) + "_" + (self.effectiveSpeaker?.1 ?? "")] {
|
if let effectiveSpeakerPeerId = effectiveSpeakerPeerId, let otherItemNode = verticalItemNodes[String(effectiveSpeakerPeerId.toInt64()) + "_" + (self.effectiveSpeaker?.1 ?? "")] {
|
||||||
self.mainStageNode.animateTransitionIn(from: otherItemNode, transition: transition)
|
|
||||||
|
|
||||||
self.mainStageBackgroundNode.alpha = 1.0
|
self.mainStageNode.alpha = 0.0
|
||||||
self.mainStageBackgroundNode.layer.animateAlpha(from: 0.0, to: 1.0, duration: 0.2)
|
|
||||||
|
Queue.mainQueue().after(0.05) {
|
||||||
|
self.mainStageNode.animateTransitionIn(from: otherItemNode, transition: transition)
|
||||||
|
self.mainStageNode.alpha = 1.0
|
||||||
|
|
||||||
|
self.mainStageBackgroundNode.alpha = 1.0
|
||||||
|
self.mainStageBackgroundNode.layer.animateAlpha(from: 0.0, to: 1.0, duration: 0.2)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
self.fullscreenListNode.forEachItemNode { itemNode in
|
Queue.mainQueue().after(0.1) {
|
||||||
if let itemNode = itemNode as? VoiceChatFullscreenParticipantItemNode, let item = itemNode.item {
|
self.fullscreenListNode.forEachItemNode { itemNode in
|
||||||
itemNode.animateTransitionIn(from: verticalItemNodes[String(item.peer.id.toInt64()) + "_" + (item.videoEndpointId ?? "")], containerNode: self.transitionContainerNode, transition: transition, animate: item.peer.id != effectiveSpeakerPeerId)
|
if let itemNode = itemNode as? VoiceChatFullscreenParticipantItemNode, let item = itemNode.item {
|
||||||
|
itemNode.animateTransitionIn(from: verticalItemNodes[String(item.peer.id.toInt64()) + "_" + (item.videoEndpointId ?? "")], containerNode: self.transitionContainerNode, transition: transition, animate: item.peer.id != effectiveSpeakerPeerId)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -469,7 +469,7 @@ final class VoiceChatMainStageNode: ASDisplayNode {
|
|||||||
avatarScale = 1.0
|
avatarScale = 1.0
|
||||||
}
|
}
|
||||||
|
|
||||||
let transition: ContainedViewLayoutTransition = .animated(duration: 0.15, curve: .easeInOut)
|
let transition: ContainedViewLayoutTransition = .animated(duration: 0.25, curve: .easeInOut)
|
||||||
transition.updateTransformScale(node: strongSelf.speakingAvatarNode, scale: avatarScale, beginWithCurrentState: true)
|
transition.updateTransformScale(node: strongSelf.speakingAvatarNode, scale: avatarScale, beginWithCurrentState: true)
|
||||||
}
|
}
|
||||||
}))
|
}))
|
||||||
@ -676,13 +676,13 @@ final class VoiceChatMainStageNode: ASDisplayNode {
|
|||||||
|> take(1)
|
|> take(1)
|
||||||
|> deliverOnMainQueue).start(next: { [weak self] _ in
|
|> deliverOnMainQueue).start(next: { [weak self] _ in
|
||||||
Queue.mainQueue().after(0.07) {
|
Queue.mainQueue().after(0.07) {
|
||||||
completion?()
|
|
||||||
|
|
||||||
if let strongSelf = self {
|
if let strongSelf = self {
|
||||||
if let (size, sideInset, bottomInset, isLandscape) = strongSelf.validLayout {
|
if let (size, sideInset, bottomInset, isLandscape) = strongSelf.validLayout {
|
||||||
strongSelf.update(size: size, sideInset: sideInset, bottomInset: bottomInset, isLandscape: isLandscape, transition: .immediate)
|
strongSelf.update(size: size, sideInset: sideInset, bottomInset: bottomInset, isLandscape: isLandscape, transition: .immediate)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
completion?()
|
||||||
|
|
||||||
if delayTransition {
|
if delayTransition {
|
||||||
if let videoNode = strongSelf.currentVideoNode {
|
if let videoNode = strongSelf.currentVideoNode {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user