diff --git a/submodules/TelegramCallsUI/Sources/VoiceChatController.swift b/submodules/TelegramCallsUI/Sources/VoiceChatController.swift index 712c6cabe6..43c14fa890 100644 --- a/submodules/TelegramCallsUI/Sources/VoiceChatController.swift +++ b/submodules/TelegramCallsUI/Sources/VoiceChatController.swift @@ -1057,7 +1057,7 @@ public final class VoiceChatController: ViewController { if peerId != strongSelf.currentDominantSpeaker?.0 { strongSelf.currentDominantSpeaker = (peerId, CACurrentMediaTime()) } - strongSelf.updateMainVideo(waitForFullSize: false, updateMembers: true, force: true) + strongSelf.updateMainVideo(waitForFullSize: true, updateMembers: true, force: true) } } }, openInvite: { [weak self] in diff --git a/submodules/TelegramCallsUI/Sources/VoiceChatMainStageNode.swift b/submodules/TelegramCallsUI/Sources/VoiceChatMainStageNode.swift index 2ebd27d0c1..83ffeaaa34 100644 --- a/submodules/TelegramCallsUI/Sources/VoiceChatMainStageNode.swift +++ b/submodules/TelegramCallsUI/Sources/VoiceChatMainStageNode.swift @@ -607,28 +607,32 @@ final class VoiceChatMainStageNode: ASDisplayNode { let previousVideoNode = strongSelf.currentVideoNode strongSelf.currentVideoNode = videoNode strongSelf.insertSubnode(videoNode, aboveSubnode: strongSelf.backgroundNode) - if let previousVideoNode = previousVideoNode { - Queue.mainQueue().after(0.03) { - previousVideoNode.removeFromSupernode() - } -// currentVideoNode.layer.animateAlpha(from: 1.0, to: 0.0, duration: 0.2, removeOnCompletion: false, completion: { [weak currentVideoNode] _ in -// currentVideoNode?.removeFromSupernode() -// }) - } - if let (size, sideInset, bottomInset, isLandscape) = strongSelf.validLayout { - strongSelf.update(size: size, sideInset: sideInset, bottomInset: bottomInset, isLandscape: isLandscape, transition: .immediate) - } if waitForFullSize { strongSelf.videoReadyDisposable.set((videoNode.ready |> filter { $0 } |> take(1) - |> deliverOnMainQueue).start(next: { _ in + |> deliverOnMainQueue).start(next: { [weak self] _ in Queue.mainQueue().after(0.07) { completion?() + + if let strongSelf = self { + if let (size, sideInset, bottomInset, isLandscape) = strongSelf.validLayout { + strongSelf.update(size: size, sideInset: sideInset, bottomInset: bottomInset, isLandscape: isLandscape, transition: .immediate) + } + } + if let previousVideoNode = previousVideoNode { + previousVideoNode.removeFromSupernode() + } } })) } else { + if let (size, sideInset, bottomInset, isLandscape) = strongSelf.validLayout { + strongSelf.update(size: size, sideInset: sideInset, bottomInset: bottomInset, isLandscape: isLandscape, transition: .immediate) + } + if let previousVideoNode = previousVideoNode { + previousVideoNode.removeFromSupernode() + } strongSelf.videoReadyDisposable.set(nil) completion?() } diff --git a/submodules/TgVoipWebrtc/tgcalls b/submodules/TgVoipWebrtc/tgcalls index 75eec7a938..3842c7b657 160000 --- a/submodules/TgVoipWebrtc/tgcalls +++ b/submodules/TgVoipWebrtc/tgcalls @@ -1 +1 @@ -Subproject commit 75eec7a93832688e87d9134e4a314393009ad38f +Subproject commit 3842c7b657ee972b893e249ee3366c00e48e4ef8