mirror of
https://git.jami.net/savoirfairelinux/jami-client-qt.git
synced 2025-08-04 14:55:43 +02:00
conference: show avatar for videoMuted peer
GitLab: #379 Change-Id: I885ad338d7a5c06fca7c765680e644c44f33228d
This commit is contained in:
parent
9e40648b8e
commit
ce88a30712
4 changed files with 62 additions and 54 deletions
|
@ -29,8 +29,8 @@ class AvatarImageProvider : public QuickImageProviderBase
|
||||||
public:
|
public:
|
||||||
AvatarImageProvider(LRCInstance* instance = nullptr)
|
AvatarImageProvider(LRCInstance* instance = nullptr)
|
||||||
: QuickImageProviderBase(QQuickImageProvider::Image,
|
: QuickImageProviderBase(QQuickImageProvider::Image,
|
||||||
QQmlImageProviderBase::ForceAsynchronousImageLoading,
|
QQmlImageProviderBase::ForceAsynchronousImageLoading,
|
||||||
instance)
|
instance)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -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)
|
||||||
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)
|
||||||
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 {
|
||||||
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 {
|
||||||
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 {
|
||||||
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 {
|
||||||
} else {
|
if (avatar) {
|
||||||
contactImage.source = JamiQmlUtils.base64StringTitle + 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 {
|
||||||
|
contactImage.mode = AvatarImage.Mode.FromTemporaryName
|
||||||
|
contactImage.updateImage(uri)
|
||||||
|
}
|
||||||
|
contactImage.visible = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -173,6 +184,35 @@ Rectangle {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
AvatarImage {
|
||||||
|
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
|
||||||
|
imageId: ""
|
||||||
|
visible: false
|
||||||
|
mode: AvatarImage.Mode.Default
|
||||||
|
showPresenceIndicator: false
|
||||||
|
|
||||||
|
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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
layer.mipmap: false
|
||||||
|
layer.smooth: true
|
||||||
|
}
|
||||||
|
|
||||||
// Participant background, mousearea, hover and buttons for moderation
|
// Participant background, mousearea, hover and buttons for moderation
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: participantRect
|
id: participantRect
|
||||||
|
@ -190,42 +230,13 @@ 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
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
layer.mipmap: false
|
|
||||||
layer.smooth: true
|
|
||||||
}
|
|
||||||
|
|
||||||
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"
|
||||||
|
@ -235,17 +246,13 @@ 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: {
|
||||||
|
|
Loading…
Add table
Reference in a new issue