Merge commit 'eb7d7ce1be292e55387de6be513592ad406d1f2d'

This commit is contained in:
Ali 2021-07-27 23:17:59 +02:00
commit f7f6fc43cd
3 changed files with 7 additions and 4 deletions

View File

@ -114,7 +114,7 @@
if (widescreenWidth == 926.0f)
{
_topPanelOffset = 34.0f;
_topPanelHeight = 77.0f;
_topPanelHeight = 48.0f;
_bottomPanelOffset = 94.0f;
_bottomPanelHeight = 140.0f;
_modeControlOffset = -2.0f;

View File

@ -2596,8 +2596,9 @@ public final class PresentationGroupCallImpl: PresentationGroupCall {
}
}
func requestVideo(capturer: OngoingCallVideoCapturer) {
func requestVideo(capturer: OngoingCallVideoCapturer, useFrontCamera: Bool = true) {
self.videoCapturer = capturer
self.useFrontCamera = useFrontCamera
self.hasVideo = true
if let videoCapturer = self.videoCapturer {

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))