|
@@ -16,7 +16,12 @@ import {
|
16
|
16
|
ConnectionIndicator
|
17
|
17
|
} from '../../../react/features/connection-indicator';
|
18
|
18
|
import { DisplayName } from '../../../react/features/display-name';
|
19
|
|
-/* eslint-disable no-unused-vars */
|
|
19
|
+import {
|
|
20
|
+ AudioMutedIndicator,
|
|
21
|
+ ModeratorIndicator,
|
|
22
|
+ VideoMutedIndicator
|
|
23
|
+} from '../../../react/features/filmstrip';
|
|
24
|
+/* eslint-enable no-unused-vars */
|
20
|
25
|
|
21
|
26
|
const logger = require("jitsi-meet-logger").getLogger(__filename);
|
22
|
27
|
|
|
@@ -64,6 +69,7 @@ const DISPLAY_VIDEO_WITH_NAME = 3;
|
64
|
69
|
const DISPLAY_AVATAR_WITH_NAME = 4;
|
65
|
70
|
|
66
|
71
|
function SmallVideo(VideoLayout) {
|
|
72
|
+ this._isModerator = false;
|
67
|
73
|
this.isAudioMuted = false;
|
68
|
74
|
this.hasAvatar = false;
|
69
|
75
|
this.isVideoMuted = false;
|
|
@@ -270,43 +276,8 @@ SmallVideo.prototype.updateConnectionStatus = function (connectionStatus) {
|
270
|
276
|
* or hidden
|
271
|
277
|
*/
|
272
|
278
|
SmallVideo.prototype.showAudioIndicator = function (isMuted) {
|
273
|
|
- let mutedIndicator = this.getAudioMutedIndicator();
|
274
|
|
-
|
275
|
|
- UIUtil.setVisible(mutedIndicator, isMuted);
|
276
|
|
-
|
277
|
279
|
this.isAudioMuted = isMuted;
|
278
|
|
-};
|
279
|
|
-
|
280
|
|
-/**
|
281
|
|
- * Returns the audio muted indicator jquery object. If it doesn't exists -
|
282
|
|
- * creates it.
|
283
|
|
- *
|
284
|
|
- * @returns {HTMLElement} the audio muted indicator
|
285
|
|
- */
|
286
|
|
-SmallVideo.prototype.getAudioMutedIndicator = function () {
|
287
|
|
- let selector = '#' + this.videoSpanId + ' .audioMuted';
|
288
|
|
- let audioMutedSpan = document.querySelector(selector);
|
289
|
|
-
|
290
|
|
- if (audioMutedSpan) {
|
291
|
|
- return audioMutedSpan;
|
292
|
|
- }
|
293
|
|
-
|
294
|
|
- audioMutedSpan = document.createElement('span');
|
295
|
|
- audioMutedSpan.className = 'audioMuted toolbar-icon';
|
296
|
|
-
|
297
|
|
- UIUtil.setTooltip(audioMutedSpan,
|
298
|
|
- "videothumbnail.mute",
|
299
|
|
- "top");
|
300
|
|
-
|
301
|
|
- let mutedIndicator = document.createElement('i');
|
302
|
|
- mutedIndicator.className = 'icon-mic-disabled';
|
303
|
|
- audioMutedSpan.appendChild(mutedIndicator);
|
304
|
|
-
|
305
|
|
- this.container
|
306
|
|
- .querySelector('.videocontainer__toolbar')
|
307
|
|
- .appendChild(audioMutedSpan);
|
308
|
|
-
|
309
|
|
- return audioMutedSpan;
|
|
280
|
+ this.updateStatusBar();
|
310
|
281
|
};
|
311
|
282
|
|
312
|
283
|
/**
|
|
@@ -320,75 +291,38 @@ SmallVideo.prototype.setVideoMutedView = function(isMuted) {
|
320
|
291
|
this.isVideoMuted = isMuted;
|
321
|
292
|
this.updateView();
|
322
|
293
|
|
323
|
|
- let element = this.getVideoMutedIndicator();
|
324
|
|
-
|
325
|
|
- UIUtil.setVisible(element, isMuted);
|
|
294
|
+ this.updateStatusBar();
|
326
|
295
|
};
|
327
|
296
|
|
328
|
297
|
/**
|
329
|
|
- * Returns the video muted indicator jquery object. If it doesn't exists -
|
330
|
|
- * creates it.
|
|
298
|
+ * Create or updates the ReactElement for displaying status indicators about
|
|
299
|
+ * audio mute, video mute, and moderator status.
|
331
|
300
|
*
|
332
|
|
- * @returns {jQuery|HTMLElement} the video muted indicator
|
|
301
|
+ * @returns {void}
|
333
|
302
|
*/
|
334
|
|
-SmallVideo.prototype.getVideoMutedIndicator = function () {
|
335
|
|
- var selector = '#' + this.videoSpanId + ' .videoMuted';
|
336
|
|
- var videoMutedSpan = document.querySelector(selector);
|
337
|
|
-
|
338
|
|
- if (videoMutedSpan) {
|
339
|
|
- return videoMutedSpan;
|
340
|
|
- }
|
341
|
|
-
|
342
|
|
- videoMutedSpan = document.createElement('span');
|
343
|
|
- videoMutedSpan.className = 'videoMuted toolbar-icon';
|
344
|
|
-
|
345
|
|
- this.container
|
346
|
|
- .querySelector('.videocontainer__toolbar')
|
347
|
|
- .appendChild(videoMutedSpan);
|
348
|
|
-
|
349
|
|
- var mutedIndicator = document.createElement('i');
|
350
|
|
- mutedIndicator.className = 'icon-camera-disabled';
|
351
|
|
-
|
352
|
|
- UIUtil.setTooltip(mutedIndicator,
|
353
|
|
- "videothumbnail.videomute",
|
354
|
|
- "top");
|
|
303
|
+SmallVideo.prototype.updateStatusBar = function () {
|
|
304
|
+ const statusBarContainer
|
|
305
|
+ = this.container.querySelector('.videocontainer__toolbar');
|
355
|
306
|
|
356
|
|
- videoMutedSpan.appendChild(mutedIndicator);
|
357
|
|
-
|
358
|
|
- return videoMutedSpan;
|
|
307
|
+ /* jshint ignore:start */
|
|
308
|
+ ReactDOM.render(
|
|
309
|
+ <div>
|
|
310
|
+ { this.isAudioMuted ? <AudioMutedIndicator /> : null }
|
|
311
|
+ { this.isVideoMuted ? <VideoMutedIndicator /> : null }
|
|
312
|
+ { this._isModerator
|
|
313
|
+ && !interfaceConfig.DISABLE_FOCUS_INDICATOR
|
|
314
|
+ ? <ModeratorIndicator /> : null }
|
|
315
|
+ </div>,
|
|
316
|
+ statusBarContainer);
|
|
317
|
+ /* jshint ignore:end */
|
359
|
318
|
};
|
360
|
319
|
|
361
|
320
|
/**
|
362
|
321
|
* Adds the element indicating the moderator(owner) of the conference.
|
363
|
322
|
*/
|
364
|
323
|
SmallVideo.prototype.addModeratorIndicator = function () {
|
365
|
|
-
|
366
|
|
- // Don't create moderator indicator if DISABLE_FOCUS_INDICATOR is true
|
367
|
|
- if (interfaceConfig.DISABLE_FOCUS_INDICATOR)
|
368
|
|
- return false;
|
369
|
|
-
|
370
|
|
- // Show moderator indicator
|
371
|
|
- var indicatorSpan = $('#' + this.videoSpanId + ' .focusindicator');
|
372
|
|
-
|
373
|
|
- if (indicatorSpan.length) {
|
374
|
|
- return;
|
375
|
|
- }
|
376
|
|
-
|
377
|
|
- indicatorSpan = document.createElement('span');
|
378
|
|
- indicatorSpan.className = 'focusindicator toolbar-icon right';
|
379
|
|
-
|
380
|
|
- this.container
|
381
|
|
- .querySelector('.videocontainer__toolbar')
|
382
|
|
- .appendChild(indicatorSpan);
|
383
|
|
-
|
384
|
|
- var moderatorIndicator = document.createElement('i');
|
385
|
|
- moderatorIndicator.className = 'icon-star';
|
386
|
|
-
|
387
|
|
- UIUtil.setTooltip(moderatorIndicator,
|
388
|
|
- "videothumbnail.moderator",
|
389
|
|
- "top-left");
|
390
|
|
-
|
391
|
|
- indicatorSpan.appendChild(moderatorIndicator);
|
|
324
|
+ this._isModerator = true;
|
|
325
|
+ this.updateStatusBar();
|
392
|
326
|
};
|
393
|
327
|
|
394
|
328
|
/**
|
|
@@ -456,7 +390,8 @@ SmallVideo.prototype._getAudioLevelContainer = function () {
|
456
|
390
|
* Removes the element indicating the moderator(owner) of the conference.
|
457
|
391
|
*/
|
458
|
392
|
SmallVideo.prototype.removeModeratorIndicator = function () {
|
459
|
|
- $('#' + this.videoSpanId + ' .focusindicator').remove();
|
|
393
|
+ this._isModerator = false;
|
|
394
|
+ this.updateStatusBar();
|
460
|
395
|
};
|
461
|
396
|
|
462
|
397
|
/**
|