Various Fixes

This commit is contained in:
Ilya Laktyushin
2021-07-27 23:47:53 +03:00
parent 36ea9c8691
commit 0172b53721
3 changed files with 7 additions and 4 deletions

View File

@@ -3501,6 +3501,7 @@ public final class VoiceChatController: ViewController {
guard let strongSelf = self, ready else {
return
}
var isFrontCamera = true
let videoCapturer = OngoingCallVideoCapturer()
let input = videoCapturer.video()
if let videoView = strongSelf.videoRenderingContext.makeView(input: input, blur: false) {
@@ -3510,7 +3511,7 @@ public final class VoiceChatController: ViewController {
let controller = VoiceChatCameraPreviewController(sharedContext: strongSelf.context.sharedContext, cameraNode: cameraNode, shareCamera: { [weak self] _, unmuted in
if let strongSelf = self {
strongSelf.call.setIsMuted(action: unmuted ? .unmuted : .muted(isPushToTalkActive: false))
(strongSelf.call as! PresentationGroupCallImpl).requestVideo(capturer: videoCapturer)
(strongSelf.call as! PresentationGroupCallImpl).requestVideo(capturer: videoCapturer, useFrontCamera: isFrontCamera)
if let (layout, navigationHeight) = strongSelf.validLayout {
strongSelf.animatingButtonsSwap = true
@@ -3519,7 +3520,8 @@ public final class VoiceChatController: ViewController {
}
}, switchCamera: { [weak self] in
Queue.mainQueue().after(0.1) {
self?.call.switchVideoCamera()
isFrontCamera = !isFrontCamera
videoCapturer.switchVideoInput(isFront: isFrontCamera)
}
})
strongSelf.controller?.present(controller, in: .window(.root))