From 6707c5fcd573ec7ed6030f2b0fae3e7490b925fe Mon Sep 17 00:00:00 2001 From: Wescoeur Date: Wed, 14 Jun 2017 01:33:39 +0200 Subject: [PATCH] feat(ui/views/App/Calls/Incall): resize window if necessary on video call --- linphone-desktop/ui/views/App/Calls/Incall.js | 15 +++++++++++++++ linphone-desktop/ui/views/App/Calls/Incall.qml | 1 + 2 files changed, 16 insertions(+) diff --git a/linphone-desktop/ui/views/App/Calls/Incall.js b/linphone-desktop/ui/views/App/Calls/Incall.js index 78e4df526..e33ba2214 100644 --- a/linphone-desktop/ui/views/App/Calls/Incall.js +++ b/linphone-desktop/ui/views/App/Calls/Incall.js @@ -23,6 +23,21 @@ function handleCallStatisticsClosed () { }) } +function handleCameraFirstFrameReceived (width, height) { + // Cell phone??? + if (height > width) { + return + } + + var ratio = container.width / (width / (height / container.height)) + var diff = container.height * ratio - container.height + if (diff < 0) { + return + } + + window.height += diff +} + function handleStatusChanged (status) { if (status === Linphone.CallModel.CallStatusEnded) { var fullscreen = incall._fullscreen diff --git a/linphone-desktop/ui/views/App/Calls/Incall.qml b/linphone-desktop/ui/views/App/Calls/Incall.qml index 454d945ea..8d5af8c9f 100644 --- a/linphone-desktop/ui/views/App/Calls/Incall.qml +++ b/linphone-desktop/ui/views/App/Calls/Incall.qml @@ -38,6 +38,7 @@ Rectangle { Connections { target: call + onCameraFirstFrameReceived: Logic.handleCameraFirstFrameReceived(width, height) onStatusChanged: Logic.handleStatusChanged (status) onVideoRequested: Logic.handleVideoRequested() }