fix(ui/views/App/Calls/Incall): display correctly preview

This commit is contained in:
Ronan Abhamon 2017-02-07 15:30:46 +01:00
parent 68529e335b
commit 50d9baf96d
2 changed files with 20 additions and 6 deletions

View file

@ -136,6 +136,11 @@ Camera::Camera (QQuickItem *parent) : QQuickFramebufferObject(parent) {
}
Camera::~Camera () {
if (m_is_preview)
CoreManager::getInstance()->getCore()->setNativePreviewWindowId(nullptr);
else
m_call->getLinphoneCall()->setNativeVideoWindowId(nullptr);
delete m_context_info;
}

View file

@ -312,19 +312,28 @@ Rectangle {
}
}
// -----------------------------------------------------------------------
// Preview.
// -----------------------------------------------------------------------
Loader {
anchors.centerIn: parent
height: CallStyle.actionArea.userVideo.height
width: CallStyle.actionArea.userVideo.width
visible: incall.width >= CallStyle.actionArea.lowWidth && call.videoEnabled && !_fullscreen
Component {
id: preview
Camera {
anchors.fill: parent
isPreview: true
Component.onCompleted: call = incall.call
Camera {
anchors.fill: parent
call: incall.call
isPreview: true
}
}
sourceComponent: incall.width >= CallStyle.actionArea.lowWidth && call.videoEnabled && !_fullscreen
? preview
: null
}
ActionBar {