|
@@ -91,9 +91,6 @@ function SmallVideo(VideoLayout) {
|
91
|
91
|
this.VideoLayout = VideoLayout;
|
92
|
92
|
this.videoIsHovered = false;
|
93
|
93
|
|
94
|
|
- // we can stop updating the thumbnail
|
95
|
|
- this.disableUpdateView = false;
|
96
|
|
-
|
97
|
94
|
/**
|
98
|
95
|
* The current state of the user's bridge connection. The value should be
|
99
|
96
|
* a string as enumerated in the library's participantConnectionStatus
|
|
@@ -513,8 +510,7 @@ SmallVideo.prototype.isCurrentlyOnLargeVideo = function() {
|
513
|
510
|
* or <tt>false</tt> otherwise.
|
514
|
511
|
*/
|
515
|
512
|
SmallVideo.prototype.isVideoPlayable = function() {
|
516
|
|
- return this.videoStream // Is there anything to display ?
|
517
|
|
- && !this.isVideoMuted && !this.videoStream.isMuted(); // Muted ?
|
|
513
|
+ return this.videoStream && !this.isVideoMuted && !this.videoStream.isMuted();
|
518
|
514
|
};
|
519
|
515
|
|
520
|
516
|
/**
|
|
@@ -524,23 +520,48 @@ SmallVideo.prototype.isVideoPlayable = function() {
|
524
|
520
|
* or <tt>DISPLAY_BLACKNESS_WITH_NAME</tt>.
|
525
|
521
|
*/
|
526
|
522
|
SmallVideo.prototype.selectDisplayMode = function() {
|
|
523
|
+ const isAudioOnly = APP.conference.isAudioOnly();
|
|
524
|
+ const tileViewEnabled = shouldDisplayTileView(APP.store.getState());
|
|
525
|
+ const isVideoPlayable = this.isVideoPlayable();
|
|
526
|
+ const hasVideo = Boolean(this.selectVideoElement().length);
|
|
527
|
+
|
527
|
528
|
// Display name is always and only displayed when user is on the stage
|
528
|
|
- if (this.isCurrentlyOnLargeVideo()
|
529
|
|
- && !shouldDisplayTileView(APP.store.getState())) {
|
530
|
|
- return this.isVideoPlayable() && !APP.conference.isAudioOnly()
|
531
|
|
- ? DISPLAY_BLACKNESS_WITH_NAME : DISPLAY_AVATAR_WITH_NAME;
|
532
|
|
- } else if (this.isVideoPlayable()
|
533
|
|
- && this.selectVideoElement().length
|
534
|
|
- && !APP.conference.isAudioOnly()) {
|
|
529
|
+ if (this.isCurrentlyOnLargeVideo() && !tileViewEnabled) {
|
|
530
|
+ return isVideoPlayable && !isAudioOnly ? DISPLAY_BLACKNESS_WITH_NAME : DISPLAY_AVATAR_WITH_NAME;
|
|
531
|
+ } else if (isVideoPlayable && hasVideo && !isAudioOnly) {
|
535
|
532
|
// check hovering and change state to video with name
|
536
|
|
- return this._isHovered()
|
537
|
|
- ? DISPLAY_VIDEO_WITH_NAME : DISPLAY_VIDEO;
|
|
533
|
+ return this._isHovered() ? DISPLAY_VIDEO_WITH_NAME : DISPLAY_VIDEO;
|
538
|
534
|
}
|
539
|
535
|
|
540
|
536
|
// check hovering and change state to avatar with name
|
541
|
|
- return this._isHovered()
|
542
|
|
- ? DISPLAY_AVATAR_WITH_NAME : DISPLAY_AVATAR;
|
|
537
|
+ return this._isHovered() ? DISPLAY_AVATAR_WITH_NAME : DISPLAY_AVATAR;
|
|
538
|
+};
|
543
|
539
|
|
|
540
|
+/**
|
|
541
|
+ * Prints information about the current display mode.
|
|
542
|
+ *
|
|
543
|
+ * @param {string} mode - The current mode.
|
|
544
|
+ * @returns {void}
|
|
545
|
+ */
|
|
546
|
+SmallVideo.prototype._printDisplayModeInfo = function(mode) {
|
|
547
|
+ const isAudioOnly = APP.conference.isAudioOnly();
|
|
548
|
+ const tileViewEnabled = shouldDisplayTileView(APP.store.getState());
|
|
549
|
+ const isVideoPlayable = this.isVideoPlayable();
|
|
550
|
+ const hasVideo = Boolean(this.selectVideoElement().length);
|
|
551
|
+ const displayModeInfo = {
|
|
552
|
+ isAudioOnly,
|
|
553
|
+ tileViewEnabled,
|
|
554
|
+ isVideoPlayable,
|
|
555
|
+ hasVideo,
|
|
556
|
+ connectionStatus: APP.conference.getParticipantConnectionStatus(this.id),
|
|
557
|
+ mutedWhileDisconnected: this.mutedWhileDisconnected,
|
|
558
|
+ wasVideoPlayed: this.wasVideoPlayed,
|
|
559
|
+ videoStream: Boolean(this.videoStream),
|
|
560
|
+ isVideoMuted: this.isVideoMuted,
|
|
561
|
+ videoStreamMuted: this.videoStream ? this.videoStream.isMuted() : 'no stream'
|
|
562
|
+ };
|
|
563
|
+
|
|
564
|
+ logger.debug(`Displaying ${mode} for ${this.id}, reason: [${JSON.stringify(displayModeInfo)}]`);
|
544
|
565
|
};
|
545
|
566
|
|
546
|
567
|
/**
|
|
@@ -559,10 +580,6 @@ SmallVideo.prototype._isHovered = function() {
|
559
|
580
|
* reflect it on this small video.
|
560
|
581
|
*/
|
561
|
582
|
SmallVideo.prototype.updateView = function() {
|
562
|
|
- if (this.disableUpdateView) {
|
563
|
|
- return;
|
564
|
|
- }
|
565
|
|
-
|
566
|
583
|
if (this.id) {
|
567
|
584
|
// Init / refresh avatar
|
568
|
585
|
this.initializeAvatar();
|
|
@@ -575,27 +592,39 @@ SmallVideo.prototype.updateView = function() {
|
575
|
592
|
this.$container.removeClass((index, classNames) =>
|
576
|
593
|
classNames.split(' ').filter(name => name.startsWith('display-')));
|
577
|
594
|
|
|
595
|
+ const oldDisplayMode = this.displayMode;
|
|
596
|
+ let displayModeString = '';
|
|
597
|
+
|
578
|
598
|
// Determine whether video, avatar or blackness should be displayed
|
579
|
|
- const displayMode = this.selectDisplayMode();
|
|
599
|
+ this.displayMode = this.selectDisplayMode();
|
580
|
600
|
|
581
|
|
- switch (displayMode) {
|
|
601
|
+ switch (this.displayMode) {
|
582
|
602
|
case DISPLAY_AVATAR_WITH_NAME:
|
|
603
|
+ displayModeString = 'avatar-with-name';
|
583
|
604
|
this.$container.addClass('display-avatar-with-name');
|
584
|
605
|
break;
|
585
|
606
|
case DISPLAY_BLACKNESS_WITH_NAME:
|
|
607
|
+ displayModeString = 'blackness-with-name';
|
586
|
608
|
this.$container.addClass('display-name-on-black');
|
587
|
609
|
break;
|
588
|
610
|
case DISPLAY_VIDEO:
|
|
611
|
+ displayModeString = 'video';
|
589
|
612
|
this.$container.addClass('display-video');
|
590
|
613
|
break;
|
591
|
614
|
case DISPLAY_VIDEO_WITH_NAME:
|
|
615
|
+ displayModeString = 'video-with-name';
|
592
|
616
|
this.$container.addClass('display-name-on-video');
|
593
|
617
|
break;
|
594
|
618
|
case DISPLAY_AVATAR:
|
595
|
619
|
default:
|
|
620
|
+ displayModeString = 'avatar';
|
596
|
621
|
this.$container.addClass('display-avatar-only');
|
597
|
622
|
break;
|
598
|
623
|
}
|
|
624
|
+
|
|
625
|
+ if (this.displayMode !== oldDisplayMode) {
|
|
626
|
+ this._printDisplayModeInfo(displayModeString);
|
|
627
|
+ }
|
599
|
628
|
};
|
600
|
629
|
|
601
|
630
|
/**
|