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

conference: handle participants without video

Change-Id: I266ab31e31d85b6cd94356b63368540c02e16c6f
parent 74bbebab
No related branches found
No related tags found
No related merge requests found
...@@ -308,19 +308,24 @@ CallAdapter::connectCallModel(const QString& accountId) ...@@ -308,19 +308,24 @@ CallAdapter::connectCallModel(const QString& accountId)
data["h"] = participant["h"].toInt(); data["h"] = participant["h"].toInt();
data["uri"] = participant["uri"]; data["uri"] = participant["uri"];
data["active"] = participant["active"] == "true"; data["active"] = participant["active"] == "true";
data["videoMuted"] = participant["videoMuted"] == "true";
data["audioMuted"] = participant["audioMuted"] == "true";
auto bestName = participant["uri"]; auto bestName = participant["uri"];
data["isLocal"] = false; data["isLocal"] = false;
auto& accInfo = LRCInstance::accountModel().getAccountInfo(accountId_); auto& accInfo = LRCInstance::accountModel().getAccountInfo(accountId_);
if (bestName == accInfo.profileInfo.uri) { if (bestName == accInfo.profileInfo.uri) {
bestName = tr("me"); bestName = tr("me");
data["isLocal"] = true; data["isLocal"] = true;
if (participant["videoMuted"] == "true")
data["avatar"] = accInfo.profileInfo.avatar;
} else { } else {
try { try {
auto& contact = LRCInstance::getCurrentAccountInfo() auto& contact = LRCInstance::getCurrentAccountInfo()
.contactModel->getContact(participant["uri"]); .contactModel->getContact(participant["uri"]);
bestName = Utils::bestNameForContact(contact); bestName = Utils::bestNameForContact(contact);
} catch (...) { if (participant["videoMuted"] == "true")
} data["avatar"] = contact.profileInfo.avatar;
} catch (...) {}
} }
data["bestName"] = bestName; data["bestName"] = bestName;
map.push_back(QVariant(data)); map.push_back(QVariant(data));
......
...@@ -97,11 +97,16 @@ Rectangle { ...@@ -97,11 +97,16 @@ Rectangle {
console.log("Error when creating the hover") console.log("Error when creating the hover")
return return
} }
hover.setParticipantName(infos[infoVariant].bestName) hover.setParticipantName(infos[infoVariant].bestName)
hover.active = infos[infoVariant].active; hover.active = infos[infoVariant].active;
hover.isLocal = infos[infoVariant].isLocal; hover.isLocal = infos[infoVariant].isLocal;
hover.setMenuVisible(isMaster) hover.setMenuVisible(isMaster)
hover.uri = infos[infoVariant].uri hover.uri = infos[infoVariant].uri
if (infos[infoVariant].videoMuted)
hover.setAvatar(infos[infoVariant].avatar)
else
hover.setAvatar("")
hover.injectedContextMenu = participantContextMenu hover.injectedContextMenu = participantContextMenu
participantOverlays.push(hover) participantOverlays.push(hover)
} }
......
...@@ -37,6 +37,16 @@ Rectangle { ...@@ -37,6 +37,16 @@ Rectangle {
participantName.text = name participantName.text = name
} }
function setAvatar(avatar) {
if (avatar === "") {
opacity = 0
contactImage.source = ""
} else {
opacity = 1
contactImage.source = "data:image/png;base64," + avatar
}
}
function setMenuVisible(isVisible) { function setMenuVisible(isVisible) {
optionsButton.visible = isVisible optionsButton.visible = isVisible
} }
...@@ -53,6 +63,31 @@ Rectangle { ...@@ -53,6 +63,31 @@ Rectangle {
propagateComposedEvents: true propagateComposedEvents: true
acceptedButtons: Qt.LeftButton acceptedButtons: Qt.LeftButton
Image {
id: contactImage
anchors.centerIn: parent
height: Math.min(parent.width / 2, parent.height / 2)
width: Math.min(parent.width / 2, parent.height / 2)
fillMode: Image.PreserveAspectFit
source: ""
asynchronous: true
layer.enabled: true
layer.effect: OpacityMask {
maskSource: Rectangle{
width: contactImage.width
height: contactImage.height
radius: {
var size = ((contactImage.width <= contactImage.height)? contactImage.width:contactImage.height)
return size /2
}
}
}
}
RowLayout { RowLayout {
id: bottomLabel id: bottomLabel
...@@ -130,10 +165,12 @@ Rectangle { ...@@ -130,10 +165,12 @@ Rectangle {
} }
onEntered: { onEntered: {
if (contactImage.status === Image.Null)
root.state = "entered" root.state = "entered"
} }
onExited: { onExited: {
if (contactImage.status === Image.Null)
root.state = "exited" root.state = "exited"
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment