소스 검색

Add custom-role to presence and special view for Recorders

j8
yanas 9 년 전
부모
커밋
e43c5ab54c

+ 60
- 54
conference.js 파일 보기

@@ -21,16 +21,6 @@ const TrackErrors = JitsiMeetJS.errors.track;
21 21
 
22 22
 let room, connection, localAudio, localVideo, roomLocker;
23 23
 
24
-/**
25
- * Known custom conference commands.
26
- */
27
-const Commands = {
28
-    CONNECTION_QUALITY: "stats",
29
-    EMAIL: "email",
30
-    ETHERPAD: "etherpad",
31
-    SHARED_VIDEO: "shared-video"
32
-};
33
-
34 24
 import {VIDEO_CONTAINER_TYPE} from "./modules/UI/videolayout/LargeVideo";
35 25
 
36 26
 /**
@@ -52,10 +42,11 @@ function connect(roomName) {
52 42
 
53 43
 /**
54 44
  * Share email with other users.
45
+ * @param emailCommand the email command
55 46
  * @param {string} email new email
56 47
  */
57
-function sendEmail (email) {
58
-    room.sendCommand(Commands.EMAIL, {
48
+function sendEmail (emailCommand, email) {
49
+    room.sendCommand(emailCommand, {
59 50
         value: email,
60 51
         attributes: {
61 52
             id: room.myUserId()
@@ -494,32 +485,6 @@ export default {
494 485
     getLogs () {
495 486
         return room.getLogs();
496 487
     },
497
-    _createRoom (localTracks) {
498
-        room = connection.initJitsiConference(APP.conference.roomName,
499
-            this._getConferenceOptions());
500
-        this.localId = room.myUserId();
501
-        localTracks.forEach((track) => {
502
-            if (track.isAudioTrack()) {
503
-                this.useAudioStream(track);
504
-            } else if (track.isVideoTrack()) {
505
-                this.useVideoStream(track);
506
-            }
507
-        });
508
-        roomLocker = createRoomLocker(room);
509
-        this._room = room; // FIXME do not use this
510
-
511
-        let email = APP.settings.getEmail();
512
-        email && sendEmail(email);
513
-
514
-        let nick = APP.settings.getDisplayName();
515
-        if (config.useNicks && !nick) {
516
-            nick = APP.UI.askForNickname();
517
-            APP.settings.setDisplayName(nick);
518
-        }
519
-        nick && room.setDisplayName(nick);
520
-
521
-        this._setupListeners();
522
-    },
523 488
 
524 489
     /**
525 490
      * Exposes a Command(s) API on this instance. It is necessitated by (1) the
@@ -531,20 +496,30 @@ export default {
531 496
      * API of this instance.
532 497
      */
533 498
     commands: {
499
+        /**
500
+         * Known custom conference commands.
501
+         */
502
+        defaults: {
503
+            CONNECTION_QUALITY: "stats",
504
+            EMAIL: "email",
505
+            ETHERPAD: "etherpad",
506
+            SHARED_VIDEO: "shared-video",
507
+            CUSTOM_ROLE: "custom-role"
508
+        },
534 509
         /**
535 510
          * Receives notifications from other participants about commands aka
536 511
          * custom events (sent by sendCommand or sendCommandOnce methods).
537 512
          * @param command {String} the name of the command
538 513
          * @param handler {Function} handler for the command
539 514
          */
540
-        addCommandListener () {
515
+            addCommandListener () {
541 516
             room.addCommandListener.apply(room, arguments);
542 517
         },
543 518
         /**
544 519
          * Removes command.
545 520
          * @param name {String} the name of the command.
546 521
          */
547
-        removeCommand () {
522
+            removeCommand () {
548 523
             room.removeCommand.apply(room, arguments);
549 524
         },
550 525
         /**
@@ -552,7 +527,7 @@ export default {
552 527
          * @param name {String} the name of the command.
553 528
          * @param values {Object} with keys and values that will be sent.
554 529
          */
555
-        sendCommand () {
530
+            sendCommand () {
556 531
             room.sendCommand.apply(room, arguments);
557 532
         },
558 533
         /**
@@ -560,9 +535,36 @@ export default {
560 535
          * @param name {String} the name of the command.
561 536
          * @param values {Object} with keys and values that will be sent.
562 537
          */
563
-        sendCommandOnce () {
538
+            sendCommandOnce () {
564 539
             room.sendCommandOnce.apply(room, arguments);
565
-        },
540
+        }
541
+    },
542
+
543
+    _createRoom (localTracks) {
544
+        room = connection.initJitsiConference(APP.conference.roomName,
545
+            this._getConferenceOptions());
546
+        this.localId = room.myUserId();
547
+        localTracks.forEach((track) => {
548
+            if (track.isAudioTrack()) {
549
+                this.useAudioStream(track);
550
+            } else if (track.isVideoTrack()) {
551
+                this.useVideoStream(track);
552
+            }
553
+        });
554
+        roomLocker = createRoomLocker(room);
555
+        this._room = room; // FIXME do not use this
556
+
557
+        let email = APP.settings.getEmail();
558
+        email && sendEmail(this.commands.defaults.EMAIL, email);
559
+
560
+        let nick = APP.settings.getDisplayName();
561
+        if (config.useNicks && !nick) {
562
+            nick = APP.UI.askForNickname();
563
+            APP.settings.setDisplayName(nick);
564
+        }
565
+        nick && room.setDisplayName(nick);
566
+
567
+        this._setupListeners();
566 568
     },
567 569
 
568 570
     _getConferenceOptions() {
@@ -721,6 +723,8 @@ export default {
721 723
      * Setup interaction between conference and UI.
722 724
      */
723 725
     _setupListeners () {
726
+        var self = this;
727
+
724 728
         // add local streams when joined to the conference
725 729
         room.on(ConferenceEvents.CONFERENCE_JOINED, () => {
726 730
             APP.UI.mucJoined();
@@ -903,7 +907,8 @@ export default {
903 907
                 APP.UI.updateLocalStats(percent, stats);
904 908
 
905 909
                 // send local stats to other users
906
-                room.sendCommandOnce(Commands.CONNECTION_QUALITY, {
910
+                room.sendCommandOnce(self.commands.defaults.CONNECTION_QUALITY,
911
+                {
907 912
                     children: ConnectionQuality.convertToMUCStats(stats),
908 913
                     attributes: {
909 914
                         xmlns: 'http://jitsi.org/jitmeet/stats'
@@ -913,8 +918,9 @@ export default {
913 918
         );
914 919
 
915 920
         // listen to remote stats
916
-        room.addCommandListener(Commands.CONNECTION_QUALITY,(values, from) => {
917
-            ConnectionQuality.updateRemoteStats(from, values);
921
+        room.addCommandListener(self.commands.defaults.CONNECTION_QUALITY,
922
+            (values, from) => {
923
+                ConnectionQuality.updateRemoteStats(from, values);
918 924
         });
919 925
 
920 926
         ConnectionQuality.addListener(CQEvents.REMOTESTATS_UPDATED,
@@ -922,7 +928,7 @@ export default {
922 928
                 APP.UI.updateRemoteStats(id, percent, stats);
923 929
             });
924 930
 
925
-        room.addCommandListener(Commands.ETHERPAD, ({value}) => {
931
+        room.addCommandListener(self.commands.defaults.ETHERPAD, ({value}) => {
926 932
             APP.UI.initEtherpad(value);
927 933
         });
928 934
 
@@ -935,9 +941,9 @@ export default {
935 941
 
936 942
             APP.settings.setEmail(email);
937 943
             APP.UI.setUserAvatar(room.myUserId(), email);
938
-            sendEmail(email);
944
+            sendEmail(self.commands.defaults.EMAIL, email);
939 945
         });
940
-        room.addCommandListener(Commands.EMAIL, (data) => {
946
+        room.addCommandListener(self.commands.defaults.EMAIL, (data) => {
941 947
             APP.UI.setUserAvatar(data.attributes.id, data.value);
942 948
         });
943 949
 
@@ -1082,8 +1088,8 @@ export default {
1082 1088
             // send start and stop commands once, and remove any updates
1083 1089
             // that had left
1084 1090
             if (state === 'stop' || state === 'start' || state === 'playing') {
1085
-                room.removeCommand(Commands.SHARED_VIDEO);
1086
-                room.sendCommandOnce(Commands.SHARED_VIDEO, {
1091
+                room.removeCommand(self.commands.defaults.SHARED_VIDEO);
1092
+                room.sendCommandOnce(self.commands.defaults.SHARED_VIDEO, {
1087 1093
                     value: url,
1088 1094
                     attributes: {
1089 1095
                         state: state,
@@ -1095,8 +1101,8 @@ export default {
1095 1101
             else {
1096 1102
                 // in case of paused, in order to allow late users to join
1097 1103
                 // paused
1098
-                room.removeCommand(Commands.SHARED_VIDEO);
1099
-                room.sendCommand(Commands.SHARED_VIDEO, {
1104
+                room.removeCommand(self.commands.defaults.SHARED_VIDEO);
1105
+                room.sendCommand(self.commands.defaults.SHARED_VIDEO, {
1100 1106
                     value: url,
1101 1107
                     attributes: {
1102 1108
                         state: state,
@@ -1107,7 +1113,7 @@ export default {
1107 1113
             }
1108 1114
         });
1109 1115
         room.addCommandListener(
1110
-            Commands.SHARED_VIDEO, ({value, attributes}, id) => {
1116
+            self.commands.defaults.SHARED_VIDEO, ({value, attributes}, id) => {
1111 1117
 
1112 1118
                 if (attributes.state === 'stop') {
1113 1119
                     APP.UI.stopSharedVideo(id, attributes);

+ 30
- 2
modules/UI/Feedback.js 파일 보기

@@ -69,6 +69,21 @@ function _toggleFeedbackIcon() {
69 69
     $('#feedbackButtonDiv').toggleClass("hidden");
70 70
 }
71 71
 
72
+/**
73
+ * Shows / hides the feedback button.
74
+ * @param {show} set to {true} to show the feedback button or to  {false}
75
+ * to hide it
76
+ * @private
77
+ */
78
+function _showFeedbackButton (show) {
79
+    var feedbackButton = $("#feedbackButtonDiv");
80
+
81
+    if (show)
82
+        feedbackButton.css("display", "block");
83
+    else
84
+        feedbackButton.css("display", "none");
85
+}
86
+
72 87
 /**
73 88
  * Defines all methods in connection to the Feedback window.
74 89
  *
@@ -85,11 +100,15 @@ var Feedback = {
85 100
      * @param emitter the EventEmitter to associate with the Feedback.
86 101
      */
87 102
     init: function (emitter) {
103
+        // Initialise to enabled.
104
+        this.enabled = true;
105
+
88 106
         // CallStats is the way we send feedback, so we don't have to initialise
89 107
         // if callstats isn't enabled.
90 108
         if (!APP.conference.isCallstatsEnabled())
91 109
             return;
92
-        $("#feedbackButtonDiv").css("display", "block");
110
+
111
+        _showFeedbackButton(true);
93 112
         $("#feedbackButton").click(function (event) {
94 113
             Feedback.openFeedbackWindow();
95 114
         });
@@ -100,13 +119,22 @@ var Feedback = {
100 119
             _toggleFeedbackIcon();
101 120
         });
102 121
     },
122
+    /**
123
+     * Enables/ disabled the feedback feature.
124
+     */
125
+    enableFeedback: function (enable) {
126
+        if (this.enabled !== enable)
127
+            _showFeedbackButton(enable);
128
+        this.enabled = enable;
129
+    },
130
+
103 131
     /**
104 132
      * Indicates if the feedback functionality is enabled.
105 133
      *
106 134
      * @return true if the feedback functionality is enabled, false otherwise.
107 135
      */
108 136
     isEnabled: function() {
109
-        return APP.conference.isCallstatsEnabled();
137
+        return this.enabled && APP.conference.isCallstatsEnabled();
110 138
     },
111 139
     /**
112 140
      * Opens the feedback window.

+ 13
- 4
modules/UI/UI.js 파일 보기

@@ -29,6 +29,8 @@ var JitsiPopover = require("./util/JitsiPopover");
29 29
 var Feedback = require("./Feedback");
30 30
 
31 31
 import FollowMe from "../FollowMe";
32
+import Recorder from "../recorder/Recorder";
33
+
32 34
 
33 35
 var eventEmitter = new EventEmitter();
34 36
 UI.eventEmitter = eventEmitter;
@@ -42,7 +44,8 @@ let followMeHandler;
42 44
  * Prompt user for nickname.
43 45
  */
44 46
 function promptDisplayName() {
45
-    let nickRequiredMsg = APP.translation.translateString("dialog.displayNameRequired");
47
+    let nickRequiredMsg
48
+        = APP.translation.translateString("dialog.displayNameRequired");
46 49
     let defaultNickMsg = APP.translation.translateString(
47 50
         "defaultNickname", {name: "Jane Pink"}
48 51
     );
@@ -110,8 +113,8 @@ function setupToolbars() {
110 113
  * @see https://developer.mozilla.org/en-US/docs/Web/API/Fullscreen_API
111 114
  */
112 115
 function toggleFullScreen () {
113
-    let isNotFullScreen = !document.fullscreenElement &&    // alternative standard method
114
-
116
+                            // alternative standard method
117
+    let isNotFullScreen = !document.fullscreenElement &&
115 118
             !document.mozFullScreenElement && // current working methods
116 119
         !document.webkitFullscreenElement &&
117 120
         !document.msFullscreenElement;
@@ -124,7 +127,8 @@ function toggleFullScreen () {
124 127
         } else if (document.documentElement.mozRequestFullScreen) {
125 128
             document.documentElement.mozRequestFullScreen();
126 129
         } else if (document.documentElement.webkitRequestFullscreen) {
127
-            document.documentElement.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT);
130
+            document.documentElement
131
+                .webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT);
128 132
         }
129 133
     } else {
130 134
         if (document.exitFullscreen) {
@@ -238,6 +242,11 @@ UI.initConference = function () {
238 242
     //if local role changes buttons state will be again updated
239 243
     UI.updateLocalRole(false);
240 244
 
245
+    // Initialise the recorder handler. We're doing this explicitly before
246
+    // calling showToolbar, because the recorder may want to disable all
247
+    // toolbars.
248
+    new Recorder(APP.conference, UI);
249
+
241 250
     // Once we've joined the muc show the toolbar
242 251
     ToolbarToggler.showToolbar();
243 252
 

+ 20
- 1
modules/UI/toolbars/BottomToolbar.js 파일 보기

@@ -12,8 +12,27 @@ const defaultBottomToolbarButtons = {
12 12
 const BottomToolbar = {
13 13
     init () {
14 14
         this.toolbar = $('#bottomToolbar');
15
-    },
16 15
 
16
+        // The bottom toolbar is enabled by default.
17
+        this.enabled = true;
18
+    },
19
+    /**
20
+     * Enables / disables the bottom toolbar.
21
+     * @param {e} set to {true} to enable the bottom toolbar or {false}
22
+     * to disable it
23
+     */
24
+    enable (e) {
25
+        this.enabled = e;
26
+        if (!e && this.isVisible())
27
+            this.hide(false);
28
+    },
29
+    /**
30
+     * Indicates if the bottom toolbar is currently enabled.
31
+     * @return {this.enabled}
32
+     */
33
+    isEnabled() {
34
+        return this.enabled;
35
+    },
17 36
     setupListeners (emitter) {
18 37
         UIUtil.hideDisabledButtons(defaultBottomToolbarButtons);
19 38
 

+ 71
- 5
modules/UI/toolbars/Toolbar.js 파일 보기

@@ -171,6 +171,9 @@ function showSipNumberInput () {
171 171
 const Toolbar = {
172 172
     init (eventEmitter) {
173 173
         emitter = eventEmitter;
174
+        // The toolbar is enabled by default.
175
+        this.enabled = true;
176
+        this.toolbarSelector = $("#header");
174 177
 
175 178
         UIUtil.hideDisabledButtons(defaultToolbarButtons);
176 179
 
@@ -178,14 +181,31 @@ const Toolbar = {
178 181
             buttonId => $(`#${buttonId}`).click(buttonHandlers[buttonId])
179 182
         );
180 183
     },
181
-
184
+    /**
185
+     * Enables / disables the toolbar.
186
+     * @param {e} set to {true} to enable the toolbar or {false}
187
+     * to disable it
188
+     */
189
+    enable (e) {
190
+        this.enabled = e;
191
+        if (!e && this.isVisible())
192
+            this.hide(false);
193
+    },
194
+    /**
195
+     * Indicates if the bottom toolbar is currently enabled.
196
+     * @return {this.enabled}
197
+     */
198
+    isEnabled() {
199
+        return this.enabled;
200
+    },
182 201
     /**
183 202
      * Updates the room invite url.
184 203
      */
185 204
     updateRoomUrl (newRoomUrl) {
186 205
         roomUrl = newRoomUrl;
187 206
 
188
-        // If the invite dialog has been already opened we update the information.
207
+        // If the invite dialog has been already opened we update the
208
+        // information.
189 209
         let inviteLink = document.getElementById('inviteLinkRef');
190 210
         if (inviteLink) {
191 211
             inviteLink.value = roomUrl;
@@ -244,14 +264,16 @@ const Toolbar = {
244 264
     // checks whether desktop sharing is enabled and whether
245 265
     // we have params to start automatically sharing
246 266
     checkAutoEnableDesktopSharing () {
247
-        if (UIUtil.isButtonEnabled('desktop') && config.autoEnableDesktopSharing) {
267
+        if (UIUtil.isButtonEnabled('desktop')
268
+            && config.autoEnableDesktopSharing) {
248 269
             emitter.emit(UIEvents.TOGGLE_SCREENSHARING);
249 270
         }
250 271
     },
251 272
 
252 273
     // Shows or hides SIP calls button
253 274
     showSipCallButton (show) {
254
-        if (APP.conference.sipGatewayEnabled() && UIUtil.isButtonEnabled('sip') && show) {
275
+        if (APP.conference.sipGatewayEnabled()
276
+            && UIUtil.isButtonEnabled('sip') && show) {
255 277
             $('#toolbar_button_sip').css({display: "inline-block"});
256 278
         } else {
257 279
             $('#toolbar_button_sip').css({display: "none"});
@@ -331,7 +353,51 @@ const Toolbar = {
331 353
      * @param {boolean} muted if icon should look like muted or not
332 354
      */
333 355
     markAudioIconAsMuted (muted) {
334
-        $('#toolbar_button_mute').toggleClass("icon-microphone", !muted).toggleClass("icon-mic-disabled", muted);
356
+        $('#toolbar_button_mute').toggleClass("icon-microphone",
357
+            !muted).toggleClass("icon-mic-disabled", muted);
358
+    },
359
+
360
+    /**
361
+     * Indicates if the toolbar is currently hovered.
362
+     * @return {true} if the toolbar is currently hovered, {false} otherwise
363
+     */
364
+    isHovered() {
365
+        this.toolbarSelector.find('*').each(function () {
366
+            let id = $(this).attr('id');
367
+            if ($(`#${id}:hover`).length > 0) {
368
+                return true;
369
+            }
370
+        });
371
+        if ($("#bottomToolbar:hover").length > 0) {
372
+            return true;
373
+        }
374
+        return false;
375
+    },
376
+
377
+    /**
378
+     * Returns true if this toolbar is currently visible, or false otherwise.
379
+     * @return <tt>true</tt> if currently visible, <tt>false</tt> - otherwise
380
+     */
381
+    isVisible() {
382
+        return this.toolbarSelector.is(":visible");
383
+    },
384
+
385
+    /**
386
+     * Hides the toolbar with animation or not depending on the animate
387
+     * parameter.
388
+     */
389
+    hide() {
390
+        this.toolbarSelector.hide(
391
+            "slide", { direction: "up", duration: 300});
392
+    },
393
+
394
+    /**
395
+     * Shows the toolbar with animation or not depending on the animate
396
+     * parameter.
397
+     */
398
+    show() {
399
+        this.toolbarSelector.show(
400
+            "slide", { direction: "up", duration: 300});
335 401
     }
336 402
 };
337 403
 

+ 19
- 29
modules/UI/toolbars/ToolbarToggler.js 파일 보기

@@ -2,6 +2,7 @@
2 2
 
3 3
 import UIUtil from '../util/UIUtil';
4 4
 import BottomToolbar from './BottomToolbar';
5
+import Toolbar from './Toolbar';
5 6
 import FilmStrip from '../videolayout/FilmStrip.js';
6 7
 
7 8
 let toolbarTimeoutObject;
@@ -16,10 +17,6 @@ function showDesktopSharingButton() {
16 17
     }
17 18
 }
18 19
 
19
-function isToolbarVisible () {
20
-    return $('#header').is(':visible');
21
-}
22
-
23 20
 /**
24 21
  * Hides the toolbar.
25 22
  */
@@ -28,25 +25,13 @@ function hideToolbar() {
28 25
         return;
29 26
     }
30 27
 
31
-    let header = $("#header");
32
-    let isToolbarHover = false;
33
-    header.find('*').each(function () {
34
-        let id = $(this).attr('id');
35
-        if ($(`#${id}:hover`).length > 0) {
36
-            isToolbarHover = true;
37
-        }
38
-    });
39
-    if ($("#bottomToolbar:hover").length > 0) {
40
-        isToolbarHover = true;
41
-    }
42
-
43 28
     clearTimeout(toolbarTimeoutObject);
44 29
     toolbarTimeoutObject = null;
45 30
 
46
-    if (isToolbarHover) {
31
+    if (Toolbar.isHovered()) {
47 32
         toolbarTimeoutObject = setTimeout(hideToolbar, toolbarTimeout);
48 33
     } else {
49
-        header.hide("slide", { direction: "up", duration: 300});
34
+        Toolbar.hide();
50 35
         $('#subject').animate({top: "-=40"}, 300);
51 36
         if (!FilmStrip.isFilmStripVisible()) {
52 37
             BottomToolbar.hide(true);
@@ -59,18 +44,23 @@ const ToolbarToggler = {
59 44
      * Shows the main toolbar.
60 45
      */
61 46
     showToolbar () {
62
-        // if we are a recorder we do not want to show the toolbar
63
-        if (interfaceConfig.filmStripOnly || config.iAmRecorder) {
47
+        if (interfaceConfig.filmStripOnly) {
64 48
             return;
65 49
         }
66
-        let header = $("#header");
67
-        if (!header.is(':visible') || !BottomToolbar.isVisible()) {
68
-            header.show("slide", { direction: "up", duration: 300});
50
+
51
+        var updateTimeout = false;
52
+        if (Toolbar.isEnabled() && !Toolbar.isVisible()) {
53
+            Toolbar.show();
69 54
             $('#subject').animate({top: "+=40"}, 300);
70
-            if (!BottomToolbar.isVisible()) {
71
-                BottomToolbar.show(true);
72
-            }
55
+            updateTimeout = true;
56
+        }
73 57
 
58
+        if (BottomToolbar.isEnabled() && !BottomToolbar.isVisible()) {
59
+            BottomToolbar.show(true);
60
+            updateTimeout = true;
61
+        }
62
+
63
+        if (updateTimeout) {
74 64
             if (toolbarTimeoutObject) {
75 65
                 clearTimeout(toolbarTimeoutObject);
76 66
                 toolbarTimeoutObject = null;
@@ -89,13 +79,13 @@ const ToolbarToggler = {
89 79
      * @param isDock indicates what operation to perform
90 80
      */
91 81
     dockToolbar (isDock) {
92
-        if (interfaceConfig.filmStripOnly) {
82
+        if (interfaceConfig.filmStripOnly || !Toolbar.isEnabled()) {
93 83
             return;
94 84
         }
95 85
 
96 86
         if (isDock) {
97 87
             // First make sure the toolbar is shown.
98
-            if (!isToolbarVisible()) {
88
+            if (!Toolbar.isVisible()) {
99 89
                 this.showToolbar();
100 90
             }
101 91
 
@@ -103,7 +93,7 @@ const ToolbarToggler = {
103 93
             clearTimeout(toolbarTimeoutObject);
104 94
             toolbarTimeoutObject = null;
105 95
         } else {
106
-            if (isToolbarVisible()) {
96
+            if (Toolbar.isVisible()) {
107 97
                 toolbarTimeoutObject = setTimeout(hideToolbar, toolbarTimeout);
108 98
             } else {
109 99
                 this.showToolbar();

+ 18
- 0
modules/UI/videolayout/SmallVideo.js 파일 보기

@@ -50,7 +50,25 @@ SmallVideo.prototype.showDisplayName = function(isShow) {
50 50
     }
51 51
 };
52 52
 
53
+/**
54
+ * Enables / disables the device availability icons for this small video.
55
+ * @param {enable} set to {true} to enable and {false} to disable
56
+ */
57
+SmallVideo.prototype.enableDeviceAvailabilityIcons = function (enable) {
58
+    if (typeof enable === "undefined")
59
+        return;
60
+
61
+    this.deviceAvailabilityIconsEnabled = enable;
62
+};
63
+
64
+/**
65
+ * Sets the device "non" availability icons.
66
+ * @param devices the devices, which will be checked for availability
67
+ */
53 68
 SmallVideo.prototype.setDeviceAvailabilityIcons = function (devices) {
69
+    if (!this.deviceAvailabilityIconsEnabled)
70
+        return;
71
+
54 72
     if(!this.container)
55 73
         return;
56 74
 

+ 19
- 0
modules/UI/videolayout/VideoLayout.js 파일 보기

@@ -196,6 +196,25 @@ var VideoLayout = {
196 196
         video.setDeviceAvailabilityIcons(devices);
197 197
     },
198 198
 
199
+    /**
200
+     * Enables/disables device availability icons for the given participant id.
201
+     * The default value is {true}.
202
+     * @param id the identifier of the participant
203
+     * @param enable {true} to enable device availability icons
204
+     */
205
+    enableDeviceAvailabilityIcons (id, enable) {
206
+        let video;
207
+        if (APP.conference.isLocalId(id)) {
208
+            video = localVideoThumbnail;
209
+        }
210
+        else if (remoteVideos[id]) {
211
+            video = remoteVideos[id];
212
+        }
213
+
214
+        if (video)
215
+            video.enableDeviceAvailabilityIcons(enable);
216
+    },
217
+
199 218
     /**
200 219
      * Checks if removed video is currently displayed and tries to display
201 220
      * another one instead.

Loading…
취소
저장