Skip to content

Commit

Permalink
fix(avatars): optimise
Browse files Browse the repository at this point in the history
  • Loading branch information
hristoterezov committed Feb 26, 2020
1 parent 94c48ec commit a7ac779
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 15 deletions.
1 change: 1 addition & 0 deletions modules/UI/videolayout/RemoteVideo.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
16 changes: 1 addition & 15 deletions modules/UI/videolayout/SmallVideo.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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-')));

Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit a7ac779

Please sign in to comment.