diff --git a/src/avadapter.cpp b/src/avadapter.cpp index acb8644bdaf289581b83b10a94447998a00c02b2..af66b1480a66714267afcfd6a885563f60dad187 100644 --- a/src/avadapter.cpp +++ b/src/avadapter.cpp @@ -293,10 +293,11 @@ AvAdapter::onVideoDeviceEvent() if (deviceEvent == DeviceEvent::Added && currentDeviceListSize == 1) { avModel.setDefaultDevice(defaultDevice); avModel.setCurrentVideoCaptureDevice(defaultDevice); - if (callId.isEmpty()) - lrcInstance_->renderer()->startPreviewing(); - else + if (callId.isEmpty()) { + Q_EMIT videoDeviceAvailable(); + } else { avModel.switchInputTo(defaultDevice, callId); + } } else { cb(); } diff --git a/src/avadapter.h b/src/avadapter.h index 79d1e0949b0a65a23e598505bbf06e82bb5bf330..aba5736f13aae45789fa763f0a8c17734257b91d 100644 --- a/src/avadapter.h +++ b/src/avadapter.h @@ -39,8 +39,8 @@ Q_SIGNALS: void audioDeviceListChanged(int inputs, int outputs); void videoDeviceListChanged(int inputs); - void screenCaptured(int screenNumber, QString source); + void videoDeviceAvailable(); protected: void safeInit() override {}; diff --git a/src/settingsview/components/AvSettingPage.qml b/src/settingsview/components/AvSettingPage.qml index cd6555019de9b126a1e1506642989e3dd64bddcf..0148a769e70b638e54a84946db36313ed02a8cc0 100644 --- a/src/settingsview/components/AvSettingPage.qml +++ b/src/settingsview/components/AvSettingPage.qml @@ -42,6 +42,15 @@ Rectangle { color: JamiTheme.secondaryBackgroundColor + Connections { + target: AvAdapter + + function onVideoDeviceAvailable() { + if (root.visible) + videoSettings.startPreviewing() + } + } + ColumnLayout { id: avSettingsColumnLayout