Procházet zdrojové kódy

Adds speaker indicator and no longer use the display name for that purpose.

j8
damencho před 9 roky
rodič
revize
6b621654ab

+ 21
- 0
css/videolayout_default.css Zobrazit soubor

@@ -319,6 +319,27 @@
319 319
     z-index: 3;
320 320
 }
321 321
 
322
+.videocontainer>span.dominantspeakerindicator {
323
+    bottom: 0px;
324
+    left: 0px;
325
+    width: 25px;
326
+    height: 25px;
327
+    z-index: 3;
328
+    text-align: center;
329
+    border-radius: 50%;
330
+    background: #0cf;
331
+    margin: 5px;
332
+    display: inline-block;
333
+    position: absolute;
334
+    color: #FFFFFF;
335
+    font-size: 11pt;
336
+    border: 0px;
337
+}
338
+
339
+#speakerindicatoricon {
340
+    padding-top: 5px;
341
+}
342
+
322 343
 #reloadPresentation {
323 344
     display: none;
324 345
     position: absolute;

+ 0
- 1
interface_config.js Zobrazit soubor

@@ -5,7 +5,6 @@ var interfaceConfig = {
5 5
     INITIAL_TOOLBAR_TIMEOUT: 20000,
6 6
     TOOLBAR_TIMEOUT: 4000,
7 7
     DEFAULT_REMOTE_DISPLAY_NAME: "Fellow Jitster",
8
-    DEFAULT_DOMINANT_SPEAKER_DISPLAY_NAME: "speaker",
9 8
     DEFAULT_LOCAL_DISPLAY_NAME: "me",
10 9
     SHOW_JITSI_WATERMARK: true,
11 10
     JITSI_WATERMARK_LINK: "https://jitsi.org",

+ 35
- 0
modules/UI/videolayout/RemoteVideo.js Zobrazit soubor

@@ -334,6 +334,41 @@ RemoteVideo.prototype.updateRemoteVideoMenu = function (isMuted) {
334 334
     }
335 335
 };
336 336
 
337
+/**
338
+ * Updates the Indicator for dominant speaker.
339
+ *
340
+ * @param isSpeaker indicates the current indicator state
341
+ */
342
+RemoteVideo.prototype.updateDominantSpeakerIndicator = function (isSpeaker) {
343
+
344
+    if (!this.container) {
345
+        console.warn( "Unable to set dominant speaker indicator - "
346
+            + this.videoSpanId + " does not exist");
347
+        return;
348
+    }
349
+
350
+    var indicatorSpan
351
+        = $('#' + this.videoSpanId + '>span.dominantspeakerindicator');
352
+
353
+    // If we do not have an indicator for this video.
354
+    if (indicatorSpan.length <= 0) {
355
+        indicatorSpan = document.createElement('span');
356
+
357
+        indicatorSpan.innerHTML
358
+            = "<i id='speakerindicatoricon' class='fa fa-bullhorn'></i>";
359
+        indicatorSpan.className = 'dominantspeakerindicator';
360
+
361
+        $('#' + this.videoSpanId)[0].appendChild(indicatorSpan);
362
+
363
+        // adds a tooltip
364
+        UIUtils.setTooltip(indicatorSpan, "speaker", "left");
365
+        APP.translation.translateElement($(indicatorSpan));
366
+    }
367
+
368
+    $(indicatorSpan).css("visibility", isSpeaker ? "visible" : "hidden");
369
+};
370
+
371
+
337 372
 /**
338 373
  * Sets the display name for the given video span id.
339 374
  */

+ 8
- 10
modules/UI/videolayout/VideoLayout.js Zobrazit soubor

@@ -614,16 +614,14 @@ var VideoLayout = (function (my) {
614 614
         var members = APP.xmpp.getMembers();
615 615
         // Update the current dominant speaker.
616 616
         if (resourceJid !== currentDominantSpeaker) {
617
-            var currentJID = APP.xmpp.findJidFromResource(currentDominantSpeaker);
618
-            var newJID = APP.xmpp.findJidFromResource(resourceJid);
619
-            if (currentDominantSpeaker && (!members || !members[currentJID] ||
620
-                !members[currentJID].displayName) && remoteVideo) {
621
-                remoteVideo.setDisplayName(null);
622
-            }
623
-            if (resourceJid && (!members || !members[newJID] ||
624
-                !members[newJID].displayName) && remoteVideo) {
625
-                remoteVideo.setDisplayName(null,
626
-                    interfaceConfig.DEFAULT_DOMINANT_SPEAKER_DISPLAY_NAME);
617
+            if (remoteVideo) {
618
+                remoteVideo.updateDominantSpeakerIndicator(true);
619
+                // let's remove the indications from the remote video if any
620
+                var oldSpeakerRemoteVideo
621
+                    = remoteVideos[currentDominantSpeaker];
622
+                if (oldSpeakerRemoteVideo) {
623
+                    oldSpeakerRemoteVideo.updateDominantSpeakerIndicator(false);
624
+                }
627 625
             }
628 626
             currentDominantSpeaker = resourceJid;
629 627
         } else {

Načítá se…
Zrušit
Uložit