From 03c20a4205278f39f1ae4febe7b98c1b213f1f9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrien=20B=C3=A9raud?= Date: Wed, 29 Nov 2023 22:16:03 -0500 Subject: [PATCH] AvAdapter: allow audio-only sharing Change-Id: I88e1fcc9726253366224aae81aabf5797f582939 --- src/app/avadapter.cpp | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/app/avadapter.cpp b/src/app/avadapter.cpp index 85d56ac7..1b8f7253 100644 --- a/src/app/avadapter.cpp +++ b/src/app/avadapter.cpp @@ -204,16 +204,10 @@ AvAdapter::shareFile(const QString& filePath) &lrc::api::AVModel::fileOpened, this, [this, callId, filePath, resource](bool hasAudio, bool hasVideo) { - // TODO: allow audio only sharing - if (hasVideo) { // only start sharing if video is available - lrcInstance_->avModel().pausePlayer(resource, false); - lrcInstance_->avModel().setAutoRestart(resource, true); - lrcInstance_->getCurrentCallModel() - ->addMedia(callId, filePath, lrc::api::CallModel::MediaRequestType::FILESHARING, false, hasAudio); - } else { - // Close media player because we are not going to start sharing - lrcInstance_->avModel().closeMediaPlayer(resource); - } + lrcInstance_->avModel().setAutoRestart(resource, true); + lrcInstance_->getCurrentCallModel() + ->addMedia(callId, filePath, lrc::api::CallModel::MediaRequestType::FILESHARING, false, hasAudio); + lrcInstance_->avModel().pausePlayer(resource, false); }); lrcInstance_->avModel().createMediaPlayer(resource);