Browse Source

fix(avatars): optimise

j8
Hristo Terezov 5 years ago
parent
commit
a7ac7790a8
2 changed files with 2 additions and 15 deletions
  1. 1
    0
      modules/UI/videolayout/RemoteVideo.js
  2. 1
    15
      modules/UI/videolayout/SmallVideo.js

+ 1
- 0
modules/UI/videolayout/RemoteVideo.js View File

126
     addRemoteVideoContainer() {
126
     addRemoteVideoContainer() {
127
         this.container = createContainer(this.videoSpanId);
127
         this.container = createContainer(this.videoSpanId);
128
         this.$container = $(this.container);
128
         this.$container = $(this.container);
129
+        this.initializeAvatar();
129
         this._setThumbnailSize();
130
         this._setThumbnailSize();
130
         this.initBrowserSpecificProperties();
131
         this.initBrowserSpecificProperties();
131
         this.updateRemoteVideoMenu();
132
         this.updateRemoteVideoMenu();

+ 1
- 15
modules/UI/videolayout/SmallVideo.js View File

83
      */
83
      */
84
     constructor(VideoLayout) {
84
     constructor(VideoLayout) {
85
         this.isAudioMuted = false;
85
         this.isAudioMuted = false;
86
-        this.hasAvatar = false;
87
         this.isVideoMuted = false;
86
         this.isVideoMuted = false;
88
         this.videoStream = null;
87
         this.videoStream = null;
89
         this.audioStream = null;
88
         this.audioStream = null;
518
     }
517
     }
519
 
518
 
520
     /**
519
     /**
521
-     * Hides or shows the user's avatar.
522
-     * This update assumes that large video had been updated and we will
523
-     * reflect it on this small video.
520
+     * Updates the css classes of the thumbnail based on the current state.
524
      */
521
      */
525
     updateView() {
522
     updateView() {
526
-        if (this.id) {
527
-            // Init / refresh avatar
528
-            this.initializeAvatar();
529
-        } else {
530
-            logger.error('Unable to init avatar - no id', this);
531
-
532
-            return;
533
-        }
534
-
535
         this.$container.removeClass((index, classNames) =>
523
         this.$container.removeClass((index, classNames) =>
536
             classNames.split(' ').filter(name => name.startsWith('display-')));
524
             classNames.split(' ').filter(name => name.startsWith('display-')));
537
 
525
 
581
     initializeAvatar() {
569
     initializeAvatar() {
582
         const thumbnail = this.$avatar().get(0);
570
         const thumbnail = this.$avatar().get(0);
583
 
571
 
584
-        this.hasAvatar = true;
585
-
586
         if (thumbnail) {
572
         if (thumbnail) {
587
             // Maybe add a special case for local participant, as on init of
573
             // Maybe add a special case for local participant, as on init of
588
             // LocalVideo.js the id is set to "local" but will get updated later.
574
             // LocalVideo.js the id is set to "local" but will get updated later.

Loading…
Cancel
Save