Commit aa027504 authored by Ronan Abhamon's avatar Ronan Abhamon

feat(ui/views/App/IncallFullscreenWindow): do not create camera view if camera...

feat(ui/views/App/IncallFullscreenWindow): do not create camera view if camera is used in incall window
parent 20eba3ab
...@@ -16,6 +16,10 @@ Rectangle { ...@@ -16,6 +16,10 @@ Rectangle {
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
readonly property bool cameraActivated:
cameraLoader.status !== Loader.Null ||
cameraPreviewLoader.status !== Loader.Null
property var call property var call
property var _contactObserver: SipAddressesModel.getContactObserver(sipAddress) property var _contactObserver: SipAddressesModel.getContactObserver(sipAddress)
...@@ -30,7 +34,8 @@ Rectangle { ...@@ -30,7 +34,8 @@ Rectangle {
_fullscreen = Utils.openWindow('IncallFullscreenWindow', incall, { _fullscreen = Utils.openWindow('IncallFullscreenWindow', incall, {
properties: { properties: {
call: incall.call call: incall.call,
callsWindow: incall
} }
}) })
} }
...@@ -253,19 +258,30 @@ Rectangle { ...@@ -253,19 +258,30 @@ Rectangle {
} }
} }
Loader {
id: cameraLoader
anchors.centerIn: parent
active: call.videoEnabled && !_fullscreen
sourceComponent: camera
Component { Component {
id: camera id: camera
Camera { Camera {
call: incall.call
height: container.height height: container.height
width: container.width width: container.width
call: incall.call }
} }
} }
Loader { Loader {
anchors.centerIn: parent anchors.centerIn: parent
sourceComponent: call.videoEnabled && !_fullscreen ? camera : avatar
active: !call.videoEnabled || _fullscreen
sourceComponent: avatar
} }
} }
...@@ -363,12 +379,17 @@ Rectangle { ...@@ -363,12 +379,17 @@ Rectangle {
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
Loader { Loader {
id: cameraPreviewLoader
anchors.centerIn: parent anchors.centerIn: parent
height: CallStyle.actionArea.userVideo.height height: CallStyle.actionArea.userVideo.height
width: CallStyle.actionArea.userVideo.width width: CallStyle.actionArea.userVideo.width
active: incall.width >= CallStyle.actionArea.lowWidth && call.videoEnabled && !_fullscreen
sourceComponent: cameraPreview
Component { Component {
id: preview id: cameraPreview
Camera { Camera {
anchors.fill: parent anchors.fill: parent
...@@ -376,10 +397,6 @@ Rectangle { ...@@ -376,10 +397,6 @@ Rectangle {
isPreview: true isPreview: true
} }
} }
sourceComponent: incall.width >= CallStyle.actionArea.lowWidth && call.videoEnabled && !_fullscreen
? preview
: null
} }
ActionBar { ActionBar {
......
...@@ -17,6 +17,8 @@ Window { ...@@ -17,6 +17,8 @@ Window {
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
property var call property var call
property var callsWindow
property bool hideButtons: false property bool hideButtons: false
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
...@@ -49,12 +51,19 @@ Window { ...@@ -49,12 +51,19 @@ Window {
Keys.onEscapePressed: incall.close() Keys.onEscapePressed: incall.close()
Camera { Component {
id: camera id: camera
anchors.fill: parent Camera {
call: incall.call call: incall.call
} }
}
Loader {
anchors.fill: parent
active: !incall.callsWindow.cameraActivated
sourceComponent: camera
}
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
// Handle mouse move / Hide buttons. // Handle mouse move / Hide buttons.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment