Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

fix(avatars): optimise

Hristo Terezova7ac7790a882
diff --git a/modules/UI/videolayout/RemoteVideo.js b/modules/UI/videolayout/RemoteVideo.js
index 89d4d24d24..c6fdd2384a 100644
--- a/modules/UI/videolayout/RemoteVideo.js
+++ b/modules/UI/videolayout/RemoteVideo.js
@@ -126,6 +126,7 @@ export default class RemoteVideo extends SmallVideo {
addRemoteVideoContainer() {
this.container = createContainer(this.videoSpanId);
this.$container = $(this.container);
+ this.initializeAvatar();
this._setThumbnailSize();
this.initBrowserSpecificProperties();
this.updateRemoteVideoMenu();
diff --git a/modules/UI/videolayout/SmallVideo.js b/modules/UI/videolayout/SmallVideo.js
index ca08711ce9..6fa117656e 100644
--- a/modules/UI/videolayout/SmallVideo.js
+++ b/modules/UI/videolayout/SmallVideo.js
@@ -83,7 +83,6 @@ export default class SmallVideo {
*/
constructor(VideoLayout) {
this.isAudioMuted = false;
- this.hasAvatar = false;
this.isVideoMuted = false;
this.videoStream = null;
this.audioStream = null;
@@ -518,20 +517,9 @@ export default class SmallVideo {
}
/**
- * Hides or shows the user's avatar.
- * This update assumes that large video had been updated and we will
- * reflect it on this small video.
+ * Updates the css classes of the thumbnail based on the current state.
*/
updateView() {
- if (this.id) {
- // Init / refresh avatar
- this.initializeAvatar();
- } else {
- logger.error('Unable to init avatar - no id', this);
-
- return;
- }
-
this.$container.removeClass((index, classNames) =>
classNames.split(' ').filter(name => name.startsWith('display-')));
@@ -581,8 +569,6 @@ export default class SmallVideo {
initializeAvatar() {
const thumbnail = this.$avatar().get(0);
- this.hasAvatar = true;
-
if (thumbnail) {
// Maybe add a special case for local participant, as on init of
// LocalVideo.js the id is set to "local" but will get updated later.