Skip to content
Snippets Groups Projects
Commit 010930fe authored by Aline Gondim Santos's avatar Aline Gondim Santos
Browse files

misc: fix close file sharing

Change-Id: I9450db0658741059620c052e8ddf602976fc2983
GitLab: #968
parent 48695d46
No related branches found
No related tags found
No related merge requests found
...@@ -290,14 +290,23 @@ AvAdapter::getListWindows() ...@@ -290,14 +290,23 @@ AvAdapter::getListWindows()
} }
void void
AvAdapter::stopSharing() AvAdapter::stopSharing(const QString& source)
{ {
auto callId = lrcInstance_->getCurrentCallId(); auto callId = lrcInstance_->getCurrentCallId();
if (!callId.isEmpty()) { if (!source.isEmpty() && !callId.isEmpty()) {
if (source.startsWith(libjami::Media::VideoProtocolPrefix::DISPLAY)) {
qDebug() << "Stopping display: " << source;
lrcInstance_->getCurrentCallModel()->removeMedia(callId, lrcInstance_->getCurrentCallModel()->removeMedia(callId,
libjami::Media::Details::MEDIA_TYPE_VIDEO, libjami::Media::Details::MEDIA_TYPE_VIDEO,
libjami::Media::VideoProtocolPrefix::DISPLAY, libjami::Media::VideoProtocolPrefix::DISPLAY,
muteCamera_); muteCamera_);
} else {
qDebug() << "Stopping file: " << source;
lrcInstance_->getCurrentCallModel()->removeMedia(callId,
libjami::Media::Details::MEDIA_TYPE_VIDEO,
libjami::Media::VideoProtocolPrefix::FILE,
muteCamera_);
}
} }
} }
......
...@@ -94,7 +94,7 @@ protected: ...@@ -94,7 +94,7 @@ protected:
Q_INVOKABLE void getListWindows(); Q_INVOKABLE void getListWindows();
// Stop sharing the screen or file // Stop sharing the screen or file
Q_INVOKABLE void stopSharing(); Q_INVOKABLE void stopSharing(const QString& source = {});
Q_INVOKABLE void startAudioMeter(); Q_INVOKABLE void startAudioMeter();
Q_INVOKABLE void stopAudioMeter(); Q_INVOKABLE void stopAudioMeter();
......
...@@ -108,6 +108,7 @@ CurrentCall::updateCallInfo() ...@@ -108,6 +108,7 @@ CurrentCall::updateCallInfo()
bool isAudioMuted {}; bool isAudioMuted {};
bool isVideoMuted {}; bool isVideoMuted {};
bool isSharing {}; bool isSharing {};
QString sharingSource {};
bool isCapturing {}; bool isCapturing {};
QString previewId {}; QString previewId {};
using namespace libjami::Media; using namespace libjami::Media;
...@@ -117,6 +118,7 @@ CurrentCall::updateCallInfo() ...@@ -117,6 +118,7 @@ CurrentCall::updateCallInfo()
if (media[MediaAttributeKey::SOURCE].startsWith(VideoProtocolPrefix::DISPLAY) if (media[MediaAttributeKey::SOURCE].startsWith(VideoProtocolPrefix::DISPLAY)
|| media[MediaAttributeKey::SOURCE].startsWith(VideoProtocolPrefix::FILE)) { || media[MediaAttributeKey::SOURCE].startsWith(VideoProtocolPrefix::FILE)) {
isSharing = true; isSharing = true;
sharingSource = media[MediaAttributeKey::SOURCE];
} }
if (media[MediaAttributeKey::ENABLED] == TRUE_STR if (media[MediaAttributeKey::ENABLED] == TRUE_STR
&& media[MediaAttributeKey::MUTED] == FALSE_STR && previewId.isEmpty()) { && media[MediaAttributeKey::MUTED] == FALSE_STR && previewId.isEmpty()) {
...@@ -138,6 +140,7 @@ CurrentCall::updateCallInfo() ...@@ -138,6 +140,7 @@ CurrentCall::updateCallInfo()
set_isAudioMuted(isAudioMuted); set_isAudioMuted(isAudioMuted);
set_isVideoMuted(isVideoMuted); set_isVideoMuted(isVideoMuted);
set_isSharing(isSharing); set_isSharing(isSharing);
set_sharingSource(sharingSource);
set_isCapturing(isCapturing); set_isCapturing(isCapturing);
set_isHandRaised(callModel->isHandRaised(id_)); set_isHandRaised(callModel->isHandRaised(id_));
set_isModerator(callModel->isModerator(id_)); set_isModerator(callModel->isModerator(id_));
......
...@@ -43,6 +43,7 @@ class CurrentCall final : public QObject ...@@ -43,6 +43,7 @@ class CurrentCall final : public QObject
QML_RO_PROPERTY(bool, isRecordingRemotely) QML_RO_PROPERTY(bool, isRecordingRemotely)
QML_RO_PROPERTY(QStringList, remoteRecorderNameList) QML_RO_PROPERTY(QStringList, remoteRecorderNameList)
QML_RO_PROPERTY(bool, isSharing) QML_RO_PROPERTY(bool, isSharing)
QML_RO_PROPERTY(QString, sharingSource)
QML_RO_PROPERTY(bool, isHandRaised) QML_RO_PROPERTY(bool, isHandRaised)
QML_RO_PROPERTY(bool, isConference) QML_RO_PROPERTY(bool, isConference)
QML_RO_PROPERTY(bool, isModerator) QML_RO_PROPERTY(bool, isModerator)
......
...@@ -165,7 +165,7 @@ Item { ...@@ -165,7 +165,7 @@ Item {
function onShowInputPanelClicked() { sipInputPanel.open() } function onShowInputPanelClicked() { sipInputPanel.open() }
function onShareScreenClicked() { openShareScreen() } function onShareScreenClicked() { openShareScreen() }
function onShareWindowClicked() { openShareWindow() } function onShareWindowClicked() { openShareWindow() }
function onStopSharingClicked() { AvAdapter.stopSharing() } function onStopSharingClicked() { AvAdapter.stopSharing(CurrentCall.sharingSource) }
function onShareScreenAreaClicked() { openShareScreenArea() } function onShareScreenAreaClicked() { openShareScreenArea() }
function onRecordCallClicked() { CallAdapter.recordThisCallToggle() } function onRecordCallClicked() { CallAdapter.recordThisCallToggle() }
function onShareFileClicked() { jamiFileDialog.open() } function onShareFileClicked() { jamiFileDialog.open() }
......
...@@ -114,7 +114,7 @@ ContextMenuAutoLoader { ...@@ -114,7 +114,7 @@ ContextMenuAutoLoader {
itemName: JamiStrings.stopSharing itemName: JamiStrings.stopSharing
iconSource: JamiResources.share_stop_black_24dp_svg iconSource: JamiResources.share_stop_black_24dp_svg
iconColor: JamiTheme.redColor iconColor: JamiTheme.redColor
onClicked: AvAdapter.stopSharing() onClicked: AvAdapter.stopSharing(CurrentCall.sharingSource)
}, },
GeneralMenuItem { GeneralMenuItem {
id: shareScreen id: shareScreen
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment