瀏覽代碼

fix(filmstrip_only): Remove unrelated UI elements

j8
hristoterezov 8 年之前
父節點
當前提交
61f4b52a15
共有 4 個檔案被更改,包括 85 行新增81 行删除
  1. 51
    51
      conference.js
  2. 16
    11
      modules/UI/videolayout/FilmStrip.js
  3. 4
    2
      modules/UI/videolayout/LargeVideoManager.js
  4. 14
    17
      modules/UI/videolayout/RemoteVideo.js

+ 51
- 51
conference.js 查看文件

@@ -1260,6 +1260,57 @@ export default {
1260 1260
                 APP.API.notifyReceivedChatMessage(id, nick, text, ts);
1261 1261
                 APP.UI.addMessage(id, nick, text, ts);
1262 1262
             });
1263
+            APP.UI.addListener(UIEvents.MESSAGE_CREATED, (message) => {
1264
+                APP.API.notifySendingChatMessage(message);
1265
+                room.sendTextMessage(message);
1266
+            });
1267
+
1268
+            APP.UI.addListener(UIEvents.SELECTED_ENDPOINT, (id) => {
1269
+                try {
1270
+                    // do not try to select participant if there is none (we
1271
+                    // are alone in the room), otherwise an error will be
1272
+                    // thrown cause reporting mechanism is not available
1273
+                    // (datachannels currently)
1274
+                    if (room.getParticipants().length === 0)
1275
+                        return;
1276
+
1277
+                    room.selectParticipant(id);
1278
+                } catch (e) {
1279
+                    JitsiMeetJS.analytics.sendEvent(
1280
+                        'selectParticipant.failed');
1281
+                    reportError(e);
1282
+                }
1283
+            });
1284
+
1285
+            APP.UI.addListener(UIEvents.PINNED_ENDPOINT,
1286
+            (smallVideo, isPinned) => {
1287
+                let smallVideoId = smallVideo.getId();
1288
+                let isLocal = APP.conference.isLocalId(smallVideoId);
1289
+
1290
+                let eventName
1291
+                    = (isPinned ? "pinned" : "unpinned") + "." +
1292
+                            (isLocal ? "local" : "remote");
1293
+                let participantCount = room.getParticipantCount();
1294
+                JitsiMeetJS.analytics.sendEvent(
1295
+                        eventName,
1296
+                        { value: participantCount });
1297
+
1298
+                // FIXME why VIDEO_CONTAINER_TYPE instead of checking if
1299
+                // the participant is on the large video ?
1300
+                if (smallVideo.getVideoType() === VIDEO_CONTAINER_TYPE
1301
+                    && !isLocal) {
1302
+
1303
+                    // When the library starts supporting multiple pins we
1304
+                    // would pass the isPinned parameter together with the
1305
+                    // identifier, but currently we send null to indicate that
1306
+                    // we unpin the last pinned.
1307
+                    try {
1308
+                        room.pinParticipant(isPinned ? smallVideoId : null);
1309
+                    } catch (e) {
1310
+                        reportError(e);
1311
+                    }
1312
+                }
1313
+            });
1263 1314
         }
1264 1315
 
1265 1316
         room.on(ConferenceEvents.CONNECTION_INTERRUPTED, () => {
@@ -1337,13 +1388,6 @@ export default {
1337 1388
         APP.UI.addListener(UIEvents.AUDIO_MUTED, muteLocalAudio);
1338 1389
         APP.UI.addListener(UIEvents.VIDEO_MUTED, muteLocalVideo);
1339 1390
 
1340
-        if (!interfaceConfig.filmStripOnly) {
1341
-            APP.UI.addListener(UIEvents.MESSAGE_CREATED, (message) => {
1342
-                APP.API.notifySendingChatMessage(message);
1343
-                room.sendTextMessage(message);
1344
-            });
1345
-        }
1346
-
1347 1391
         room.on(ConnectionQualityEvents.LOCAL_STATS_UPDATED,
1348 1392
             (stats) => {
1349 1393
                 APP.UI.updateLocalStats(stats.connectionQuality, stats);
@@ -1466,50 +1510,6 @@ export default {
1466 1510
             AuthHandler.authenticate(room);
1467 1511
         });
1468 1512
 
1469
-        APP.UI.addListener(UIEvents.SELECTED_ENDPOINT, (id) => {
1470
-            try {
1471
-                // do not try to select participant if there is none (we are
1472
-                // alone in the room), otherwise an error will be thrown cause
1473
-                // reporting mechanism is not available (datachannels currently)
1474
-                if (room.getParticipants().length === 0)
1475
-                    return;
1476
-
1477
-                room.selectParticipant(id);
1478
-            } catch (e) {
1479
-                JitsiMeetJS.analytics.sendEvent('selectParticipant.failed');
1480
-                reportError(e);
1481
-            }
1482
-        });
1483
-
1484
-        APP.UI.addListener(UIEvents.PINNED_ENDPOINT, (smallVideo, isPinned) => {
1485
-            let smallVideoId = smallVideo.getId();
1486
-            let isLocal = APP.conference.isLocalId(smallVideoId);
1487
-
1488
-            let eventName
1489
-                = (isPinned ? "pinned" : "unpinned") + "." +
1490
-                        (isLocal ? "local" : "remote");
1491
-            let participantCount = room.getParticipantCount();
1492
-            JitsiMeetJS.analytics.sendEvent(
1493
-                    eventName,
1494
-                    { value: participantCount });
1495
-
1496
-            // FIXME why VIDEO_CONTAINER_TYPE instead of checking if
1497
-            // the participant is on the large video ?
1498
-            if (smallVideo.getVideoType() === VIDEO_CONTAINER_TYPE
1499
-                && !isLocal) {
1500
-
1501
-                // When the library starts supporting multiple pins we would
1502
-                // pass the isPinned parameter together with the identifier,
1503
-                // but currently we send null to indicate that we unpin the
1504
-                // last pinned.
1505
-                try {
1506
-                    room.pinParticipant(isPinned ? smallVideoId : null);
1507
-                } catch (e) {
1508
-                    reportError(e);
1509
-                }
1510
-            }
1511
-        });
1512
-
1513 1513
         APP.UI.addListener(
1514 1514
             UIEvents.VIDEO_DEVICE_CHANGED,
1515 1515
             (cameraDeviceId) => {

+ 16
- 11
modules/UI/videolayout/FilmStrip.js 查看文件

@@ -42,13 +42,14 @@ const FilmStrip = {
42 42
         let container = document.createElement('div');
43 43
         let isVisible = this.isFilmStripVisible();
44 44
         container.className = 'filmstrip__toolbar';
45
-
46
-        container.innerHTML = `
47
-            <button id="hideVideoToolbar">
48
-                <i class="icon-menu-${isVisible ? 'down' : 'up'}">
49
-                </i>
50
-            </button>
51
-        `;
45
+        if(!interfaceConfig.filmStripOnly) {
46
+            container.innerHTML = `
47
+                <button id="hideVideoToolbar">
48
+                    <i class="icon-menu-${isVisible ? 'down' : 'up'}">
49
+                    </i>
50
+                </button>
51
+            `;
52
+        }
52 53
 
53 54
         return container;
54 55
     },
@@ -94,8 +95,10 @@ const FilmStrip = {
94 95
      */
95 96
     showMenuDownIcon() {
96 97
         let icon = this.toggleFilmStripIcon;
97
-        icon.classList.add(this.iconMenuDownClassName);
98
-        icon.classList.remove(this.iconMenuUpClassName);
98
+        if(icon) {
99
+            icon.classList.add(this.iconMenuDownClassName);
100
+            icon.classList.remove(this.iconMenuUpClassName);
101
+        }
99 102
     },
100 103
 
101 104
     /**
@@ -103,8 +106,10 @@ const FilmStrip = {
103 106
      */
104 107
     showMenuUpIcon() {
105 108
         let icon = this.toggleFilmStripIcon;
106
-        icon.classList.add(this.iconMenuUpClassName);
107
-        icon.classList.remove(this.iconMenuDownClassName);
109
+        if(icon) {
110
+            icon.classList.add(this.iconMenuUpClassName);
111
+            icon.classList.remove(this.iconMenuDownClassName);
112
+        }
108 113
     },
109 114
 
110 115
     /**

+ 4
- 2
modules/UI/videolayout/LargeVideoManager.js 查看文件

@@ -37,7 +37,8 @@ export default class LargeVideoManager {
37 37
             display: 'inline-block'
38 38
         });
39 39
 
40
-        if (interfaceConfig.SHOW_JITSI_WATERMARK) {
40
+        if (interfaceConfig.SHOW_JITSI_WATERMARK
41
+            && !interfaceConfig.filmStripOnly) {
41 42
             let leftWatermarkDiv
42 43
                 = this.$container.find("div.watermark.leftwatermark");
43 44
 
@@ -48,7 +49,8 @@ export default class LargeVideoManager {
48 49
                 interfaceConfig.JITSI_WATERMARK_LINK);
49 50
         }
50 51
 
51
-        if (interfaceConfig.SHOW_BRAND_WATERMARK) {
52
+        if (interfaceConfig.SHOW_BRAND_WATERMARK
53
+            && !interfaceConfig.filmStripOnly) {
52 54
             let rightWatermarkDiv
53 55
                 = this.$container.find("div.watermark.rightwatermark");
54 56
 

+ 14
- 17
modules/UI/videolayout/RemoteVideo.js 查看文件

@@ -302,26 +302,23 @@ RemoteVideo.prototype._figureOutMutedWhileDisconnected
302 302
  * @param id the id indicating the video for which we're adding a menu.
303 303
  * @param parentElement the parent element where this menu will be added
304 304
  */
305
-if (!interfaceConfig.filmStripOnly) {
306
-    RemoteVideo.prototype.addRemoteVideoMenu = function () {
307
-
308
-        var spanElement = document.createElement('span');
309
-        spanElement.className = 'remotevideomenu';
305
+RemoteVideo.prototype.addRemoteVideoMenu = function () {
306
+    if (interfaceConfig.filmStripOnly) {
307
+        return;
308
+    }
309
+    var spanElement = document.createElement('span');
310
+    spanElement.className = 'remotevideomenu';
310 311
 
311
-        this.container.appendChild(spanElement);
312
+    this.container.appendChild(spanElement);
312 313
 
313
-        var menuElement = document.createElement('i');
314
-        menuElement.className = 'icon-menu-up';
315
-        menuElement.title = 'Remote user controls';
316
-        spanElement.appendChild(menuElement);
314
+    var menuElement = document.createElement('i');
315
+    menuElement.className = 'icon-menu-up';
316
+    menuElement.title = 'Remote user controls';
317
+    spanElement.appendChild(menuElement);
317 318
 
318
-        this._initPopupMenu(this._generatePopupContent());
319
-        this.hasRemoteVideoMenu = true;
320
-    };
321
-
322
-} else {
323
-    RemoteVideo.prototype.addRemoteVideoMenu = function() {};
324
-}
319
+    this._initPopupMenu(this._generatePopupContent());
320
+    this.hasRemoteVideoMenu = true;
321
+};
325 322
 
326 323
 /**
327 324
  * Removes the remote stream element corresponding to the given stream and

Loading…
取消
儲存