From 7a48b83c74fca4186403c47cf2cec61dd17e1711 Mon Sep 17 00:00:00 2001 From: Julien Wadel Date: Wed, 28 Sep 2022 18:02:40 +0200 Subject: [PATCH] Display Active Speaker as a preview when alone. Refresh previews camera on start to avoid black screens. --- .../ui/views/App/Calls/IncallActiveSpeaker.qml | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/linphone-app/ui/views/App/Calls/IncallActiveSpeaker.qml b/linphone-app/ui/views/App/Calls/IncallActiveSpeaker.qml index b67daff92..02a1c59c6 100644 --- a/linphone-app/ui/views/App/Calls/IncallActiveSpeaker.qml +++ b/linphone-app/ui/views/App/Calls/IncallActiveSpeaker.qml @@ -44,6 +44,10 @@ Item { if(device) // Get cameraView.currentDevice = device } + onMeChanged: if( cameraView.isPreview) { + cameraView.currentDevice = me + cameraView.resetCamera() + } } function clearAll(layoutMode){ @@ -57,8 +61,12 @@ Item { id: cameraView callModel: mainItem.callModel deactivateCamera: (callModel && callModel.pausedByUser) || !mainItem.cameraEnabled || (currentDevice && !currentDevice.videoEnabled) - isCameraFromDevice: false - isPreview: false + isPreview: mainItem.showMe && allDevices.count == 0 + onIsPreviewChanged: if( isPreview){ + currentDevice = allDevices.me + cameraView.resetCamera() + } + isCameraFromDevice: isPreview anchors.fill: parent anchors.leftMargin: isRightReducedLayout || isLeftReducedLayout? 30 : 140 anchors.rightMargin: isRightReducedLayout ? 10 : 140 @@ -67,7 +75,7 @@ Item { showCloseButton: false showActiveSpeakerOverlay: false // This is an active speaker. We don't need to show the indicator. showCustomButton: false - avatarStickerBackgroundColor: IncallStyle.container.avatar.stickerBackgroundColor + avatarStickerBackgroundColor: isPreview ? IncallStyle.container.avatar.stickerPreviewBackgroundColor : IncallStyle.container.avatar.stickerBackgroundColor avatarBackgroundColor: IncallStyle.container.avatar.backgroundColor } Item{// Need an item to not override Sticker internal states. States are needed for changing anchors. @@ -81,7 +89,9 @@ Item { width: 16 * height / 9 visible: mainItem.showMe && (!callModel.isConference || allDevices.count >= 1) + onVisibleChanged: if(visible) previewSticker.resetCamera() Sticker{ + id: previewSticker anchors.fill: parent anchors.margins: 3