Procházet zdrojové kódy

fix(avatars): optimise

j8
Hristo Terezov před 5 roky
rodič
revize
a7ac7790a8

+ 1
- 0
modules/UI/videolayout/RemoteVideo.js Zobrazit soubor

@@ -126,6 +126,7 @@ export default class RemoteVideo extends SmallVideo {
126 126
     addRemoteVideoContainer() {
127 127
         this.container = createContainer(this.videoSpanId);
128 128
         this.$container = $(this.container);
129
+        this.initializeAvatar();
129 130
         this._setThumbnailSize();
130 131
         this.initBrowserSpecificProperties();
131 132
         this.updateRemoteVideoMenu();

+ 1
- 15
modules/UI/videolayout/SmallVideo.js Zobrazit soubor

@@ -83,7 +83,6 @@ export default class SmallVideo {
83 83
      */
84 84
     constructor(VideoLayout) {
85 85
         this.isAudioMuted = false;
86
-        this.hasAvatar = false;
87 86
         this.isVideoMuted = false;
88 87
         this.videoStream = null;
89 88
         this.audioStream = null;
@@ -518,20 +517,9 @@ export default class SmallVideo {
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 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 523
         this.$container.removeClass((index, classNames) =>
536 524
             classNames.split(' ').filter(name => name.startsWith('display-')));
537 525
 
@@ -581,8 +569,6 @@ export default class SmallVideo {
581 569
     initializeAvatar() {
582 570
         const thumbnail = this.$avatar().get(0);
583 571
 
584
-        this.hasAvatar = true;
585
-
586 572
         if (thumbnail) {
587 573
             // Maybe add a special case for local participant, as on init of
588 574
             // LocalVideo.js the id is set to "local" but will get updated later.

Načítá se…
Zrušit
Uložit