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

conference: show avatar for videoMuted peer

GitLab: #379
Change-Id: I885ad338d7a5c06fca7c765680e644c44f33228d
parent 9e40648b
No related branches found
No related tags found
No related merge requests found
...@@ -65,7 +65,7 @@ public: ...@@ -65,7 +65,7 @@ public:
} else if (idType == "contact") { } else if (idType == "contact") {
return Utils::contactPhoto(lrcInstance_, idContent, requestedSize); return Utils::contactPhoto(lrcInstance_, idContent, requestedSize);
} else if (idType == "fallback") { } else if (idType == "fallback") {
return Utils::fallbackAvatar(QString(), idContent, requestedSize); return Utils::fallbackAvatar(idContent, QString(), requestedSize);
} else if (idType == "default") { } else if (idType == "default") {
return Utils::fallbackAvatar(QString(), QString(), requestedSize); return Utils::fallbackAvatar(QString(), QString(), requestedSize);
} else if (idType == "base64") { } else if (idType == "base64") {
......
...@@ -339,6 +339,7 @@ CallAdapter::fillParticipantData(QMap<QString, QString> participant) ...@@ -339,6 +339,7 @@ CallAdapter::fillParticipantData(QMap<QString, QString> participant)
data["videoMuted"] = participant["videoMuted"] == "true"; data["videoMuted"] = participant["videoMuted"] == "true";
data["audioLocalMuted"] = participant["audioLocalMuted"] == "true"; data["audioLocalMuted"] = participant["audioLocalMuted"] == "true";
data["audioModeratorMuted"] = participant["audioModeratorMuted"] == "true"; data["audioModeratorMuted"] = participant["audioModeratorMuted"] == "true";
data["isContact"] = false;
auto bestName = participant["uri"]; auto bestName = participant["uri"];
auto& accInfo = lrcInstance_->accountModel().getAccountInfo(accountId_); auto& accInfo = lrcInstance_->accountModel().getAccountInfo(accountId_);
...@@ -356,7 +357,7 @@ CallAdapter::fillParticipantData(QMap<QString, QString> participant) ...@@ -356,7 +357,7 @@ CallAdapter::fillParticipantData(QMap<QString, QString> participant)
participant["uri"]); participant["uri"]);
if (participant["videoMuted"] == "true") if (participant["videoMuted"] == "true")
data["avatar"] = contact.profileInfo.avatar; data["avatar"] = contact.profileInfo.avatar;
data["isContact"] = true;
} catch (...) { } catch (...) {
} }
} }
......
...@@ -130,9 +130,9 @@ Rectangle { ...@@ -130,9 +130,9 @@ Rectangle {
participantOverlays[p].setMenu(participant.uri, participant.bestName, participantOverlays[p].setMenu(participant.uri, participant.bestName,
participant.isLocal, participant.active, showMax) participant.isLocal, participant.active, showMax)
if (participant.videoMuted) if (participant.videoMuted)
participantOverlays[p].setAvatar(participant.avatar) participantOverlays[p].setAvatar(true, participant.avatar, participant.uri, participant.isLocal, participant.isContact)
else else
participantOverlays[p].setAvatar("") participantOverlays[p].setAvatar(false)
currentUris.push(participantOverlays[p].uri) currentUris.push(participantOverlays[p].uri)
} else { } else {
// Participant is no longer in conference // Participant is no longer in conference
...@@ -173,9 +173,9 @@ Rectangle { ...@@ -173,9 +173,9 @@ Rectangle {
hover.setMenu(infos[infoVariant].uri, infos[infoVariant].bestName, hover.setMenu(infos[infoVariant].uri, infos[infoVariant].bestName,
infos[infoVariant].isLocal, infos[infoVariant].active, showMax) infos[infoVariant].isLocal, infos[infoVariant].active, showMax)
if (infos[infoVariant].videoMuted) if (infos[infoVariant].videoMuted)
hover.setAvatar(infos[infoVariant].avatar) hover.setAvatar(true, infos[infoVariant].avatar, infos[infoVariant].uri, infos[infoVariant].isLocal, infos[infoVariant].isContact)
else else
hover.setAvatar("") hover.setAvatar(false)
participantOverlays.push(hover) participantOverlays.push(hover)
} }
} }
......
...@@ -47,15 +47,26 @@ Rectangle { ...@@ -47,15 +47,26 @@ Rectangle {
property bool participantIsModerator: false property bool participantIsModerator: false
property bool participantIsMuted: false property bool participantIsMuted: false
property bool participantIsModeratorMuted: false property bool participantIsModeratorMuted: false
property bool participantMenuActive: false property bool participantMenuActive: false
// TODO: try to use AvatarImage as well function setAvatar(show, avatar, uri, local, isContact) {
function setAvatar(avatar) { if (!show)
if (avatar === "") { contactImage.visible = false
contactImage.source = "" else {
if (avatar) {
contactImage.mode = AvatarImage.Mode.FromBase64
contactImage.updateImage(avatar)
} else if (local) {
contactImage.mode = AvatarImage.Mode.FromAccount
contactImage.updateImage(AccountAdapter.currentAccountId)
} else if (isContact) {
contactImage.mode = AvatarImage.Mode.FromContactUri
contactImage.updateImage(uri)
} else { } else {
contactImage.source = JamiQmlUtils.base64StringTitle + avatar contactImage.mode = AvatarImage.Mode.FromTemporaryName
contactImage.updateImage(uri)
}
contactImage.visible = true
} }
} }
...@@ -173,24 +184,7 @@ Rectangle { ...@@ -173,24 +184,7 @@ Rectangle {
} }
} }
// Participant background, mousearea, hover and buttons for moderation AvatarImage {
Rectangle {
id: participantRect
anchors.fill: parent
opacity: 0
color: "transparent"
z: 1
MouseArea {
id: mouseAreaHover
anchors.fill: parent
hoverEnabled: true
propagateComposedEvents: true
acceptedButtons: Qt.LeftButton
Image {
id: contactImage id: contactImage
anchors.centerIn: parent anchors.centerIn: parent
...@@ -198,8 +192,10 @@ Rectangle { ...@@ -198,8 +192,10 @@ Rectangle {
width: Math.min(parent.width / 2, parent.height / 2) width: Math.min(parent.width / 2, parent.height / 2)
fillMode: Image.PreserveAspectFit fillMode: Image.PreserveAspectFit
source: "" imageId: ""
asynchronous: true visible: false
mode: AvatarImage.Mode.Default
showPresenceIndicator: false
layer.enabled: true layer.enabled: true
layer.effect: OpacityMask { layer.effect: OpacityMask {
...@@ -217,16 +213,31 @@ Rectangle { ...@@ -217,16 +213,31 @@ Rectangle {
layer.smooth: true layer.smooth: true
} }
// Participant background, mousearea, hover and buttons for moderation
Rectangle {
id: participantRect
anchors.fill: parent
opacity: 0
color: "transparent"
z: 1
MouseArea {
id: mouseAreaHover
anchors.fill: parent
hoverEnabled: true
propagateComposedEvents: true
acceptedButtons: Qt.LeftButton
ParticipantOverlayMenu { ParticipantOverlayMenu {
id: overlayMenu id: overlayMenu
visible: participantRect.opacity !== 0 visible: participantRect.opacity !== 0
onMouseAreaExited: { onMouseAreaExited: {
if (contactImage.status === Image.Null) {
root.z = 1 root.z = 1
participantRect.state = "exited" participantRect.state = "exited"
} }
}
onMouseChanged: { onMouseChanged: {
participantRect.state = "entered" participantRect.state = "entered"
fadeOutTimer.restart() fadeOutTimer.restart()
...@@ -235,18 +246,14 @@ Rectangle { ...@@ -235,18 +246,14 @@ Rectangle {
} }
onEntered: { onEntered: {
if (contactImage.status === Image.Null) {
root.z = 2 root.z = 2
participantRect.state = "entered" participantRect.state = "entered"
} }
}
onExited: { onExited: {
if (contactImage.status === Image.Null) {
root.z = 1 root.z = 1
participantRect.state = "exited" participantRect.state = "exited"
} }
}
onMouseXChanged: { onMouseXChanged: {
// Hack: avoid listening mouseXChanged emitted when // Hack: avoid listening mouseXChanged emitted when
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment