Fixes issue with missing avatar for Jigasi user. Fixes issue with avatar not being displayed when user has no video. Removed duplicated logic for checking video muted status(removed from LargeVideo which exists in SmallVideo).

This commit is contained in:
paweldomas 2015-07-30 10:31:02 +02:00
parent 349f196664
commit 2ffe178456
4 changed files with 11 additions and 18 deletions

View File

@ -52,8 +52,9 @@ var Avatar = {
}
var id = users[jid];
if (!id) {
console.warn("No avatar stored yet for " + jid);
return null;
console.warn(
"No avatar stored yet for " + jid + " - using JID as ID");
id = jid;
}
return 'https://www.gravatar.com/avatar/' +
MD5.hexdigest(id.trim().toLowerCase()) +

View File

@ -224,20 +224,9 @@ function updateActiveSpeakerAvatarSrc() {
var url = Avatar.getActiveSpeakerUrl(jid);
if (avatar.src === url)
return;
var isMuted = null;
if (!currentSmallVideo.isLocal &&
!LargeVideo.VideoLayout.isInLastN(currentSmallVideo.getResourceJid())) {
isMuted = true;
}
else
{
isMuted = APP.RTC.isVideoMuted(jid);
}
if (jid && isMuted !== null) {
if (jid) {
avatar.src = url;
$("#largeVideo").css("visibility", isMuted ? "hidden" : "visible");
currentSmallVideo.showAvatar(isMuted);
currentSmallVideo.showAvatar();
}
}

View File

@ -325,7 +325,9 @@ SmallVideo.prototype.showAvatar = function (show) {
}
else
{
show = APP.RTC.isVideoMuted(this.peerJid);
// We want to show the avatar when the video is muted or not exists
// that is when 'true' or 'null' is returned
show = APP.RTC.isVideoMuted(this.peerJid) !== false;
}
}

View File

@ -864,9 +864,10 @@ var VideoLayout = (function (my) {
if(!isVisible && focusedVideoResourceJid)
{
var smallVideo = VideoLayout.getSmallVideo(focusedVideoResourceJid);
if(smallVideo)
if(smallVideo) {
smallVideo.focus(false);
smallVideo.showAvatar();
smallVideo.showAvatar();
}
focusedVideoResourceJid = null;
}
};