浏览代码

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).

master
paweldomas 9 年前
父节点
当前提交
2ffe178456

+ 3
- 2
modules/UI/avatar/Avatar.js 查看文件

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

+ 2
- 13
modules/UI/videolayout/LargeVideo.js 查看文件

@@ -224,20 +224,9 @@ function updateActiveSpeakerAvatarSrc() {
224 224
     var url = Avatar.getActiveSpeakerUrl(jid);
225 225
     if (avatar.src === url)
226 226
         return;
227
-    var isMuted = null;
228
-    if (!currentSmallVideo.isLocal &&
229
-       !LargeVideo.VideoLayout.isInLastN(currentSmallVideo.getResourceJid())) {
230
-        isMuted = true;
231
-    }
232
-    else
233
-    {
234
-        isMuted = APP.RTC.isVideoMuted(jid);
235
-    }
236
-
237
-    if (jid && isMuted !== null) {
227
+    if (jid) {
238 228
         avatar.src = url;
239
-        $("#largeVideo").css("visibility", isMuted ? "hidden" : "visible");
240
-        currentSmallVideo.showAvatar(isMuted);
229
+        currentSmallVideo.showAvatar();
241 230
     }
242 231
 }
243 232
 

+ 3
- 1
modules/UI/videolayout/SmallVideo.js 查看文件

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

+ 3
- 2
modules/UI/videolayout/VideoLayout.js 查看文件

@@ -864,9 +864,10 @@ var VideoLayout = (function (my) {
864 864
         if(!isVisible && focusedVideoResourceJid)
865 865
         {
866 866
             var smallVideo = VideoLayout.getSmallVideo(focusedVideoResourceJid);
867
-            if(smallVideo)
867
+            if(smallVideo) {
868 868
                 smallVideo.focus(false);
869
-            smallVideo.showAvatar();
869
+                smallVideo.showAvatar();
870
+            }
870 871
             focusedVideoResourceJid = null;
871 872
         }
872 873
     };

正在加载...
取消
保存