Skip to content
Snippets Groups Projects
Commit 05f38852 authored by Sébastien Blin's avatar Sébastien Blin
Browse files

video-split: fix maximize/minimize

Change-Id: I7e6093e26546d8207261689069505f1afea2bfbf
GitLab: #476
parent 8d88d189
No related branches found
No related tags found
No related merge requests found
......@@ -739,16 +739,18 @@ CallAdapter::maximizeParticipant(const QString& uri)
if (confId.isEmpty())
confId = convInfo.callId;
try {
const auto call = callModel->getCall(confId);
auto participants = getConferencesInfos();
for (auto part : participants) {
auto participant = part.toJsonObject();
if (participant["uri"].toString() == uri) {
participant["active"] = !participant["active"].toBool();
if (participant["active"].toBool()) {
auto active = participant["active"].toBool();
// Else, continue.
if (!active) {
callModel->setActiveParticipant(confId, uri);
callModel->setConferenceLayout(confId, lrc::api::call::Layout::ONE_WITH_SMALL);
} else {
callModel->setConferenceLayout(confId, lrc::api::call::Layout::GRID);
} else if (call.layout == lrc::api::call::Layout::ONE_WITH_SMALL) {
callModel->setConferenceLayout(confId, lrc::api::call::Layout::ONE);
}
return;
}
......@@ -768,13 +770,19 @@ CallAdapter::minimizeParticipant(const QString& uri)
if (confId.isEmpty())
confId = convInfo.callId;
try {
const auto call = callModel->getCall(confId);
auto participants = getConferencesInfos();
for (auto& part : participants) {
auto participant = part.toJsonObject();
if (participant["uri"].toString() == uri) {
if (participant["active"].toBool()) {
participant["active"] = !participant["active"].toBool();
callModel->setConferenceLayout(confId, lrc::api::call::Layout::GRID);
auto active = participant["active"].toBool();
if (active) {
if (call.layout == lrc::api::call::Layout::ONE) {
callModel->setConferenceLayout(confId,
lrc::api::call::Layout::ONE_WITH_SMALL);
} else {
callModel->setConferenceLayout(confId, lrc::api::call::Layout::GRID);
}
}
return;
}
......
......@@ -46,6 +46,9 @@ Item {
property string bestName: ""
property string sinkId: ""
property bool participantIsActive: false
property bool canMaximize: root.meModerator &&
(!root.participantIsActive
|| CallParticipantsModel.conferenceLayout === CallParticipantsModel.ONE_WITH_SMALL)
property bool participantIsHost: CallAdapter.participantIsHost(uri)
property bool participantIsModerator: false
property bool participantIsMuted: isLocalMuted || participantIsModeratorMuted
......@@ -166,7 +169,7 @@ Item {
showUnsetModerator: root.meHost && !root.isMe && root.participantIsModerator
showModeratorMute: root.meModerator && !root.participantIsModeratorMuted
showModeratorUnmute: (root.meModerator || root.isMe) && root.participantIsModeratorMuted
showMaximize: root.meModerator && !root.participantIsActive
showMaximize: root.canMaximize
showMinimize: root.meModerator && root.participantIsActive
showHangup: root.meModerator && !root.isMe && !root.participantIsHost
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment