Skip to content
This repository has been archived by the owner on Oct 18, 2024. It is now read-only.

fix: when participant enters into meeting room, update the participant avatar #748

Merged
merged 1 commit into from
Aug 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 27 additions & 12 deletions src/components/video/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -534,6 +534,32 @@ export class VideoConference extends BaseComponent {

const newParticipantName = participant.name.trim();

if (this.videoConfig.canUseDefaultAvatars) {
this.roomState.updateMyProperties({
avatar: participant.avatar,
name: participant.name,
type: participant.type,
joinedMeeting: true,
});

localParticipant.publish({
...localParticipant.value,
avatar: participant.avatar,
name: participant.name,
});

participants.publish({
...participants.value,
[participant.id]: {
...participants.value[participant.id],
avatar: participant.avatar,
name: participant.name,
},
});

return;
}

localParticipant.publish({
...localParticipant.value,
name: newParticipantName,
Expand All @@ -542,22 +568,11 @@ export class VideoConference extends BaseComponent {
participants.publish({
...participants.value,
[participant.id]: {
...localParticipant.value,
...participants.value[participant.id],
name: newParticipantName,
},
});

if (this.videoConfig.canUseDefaultAvatars) {
this.roomState.updateMyProperties({
avatar: participant.avatar,
name: participant.name,
type: participant.type,
joinedMeeting: true,
});

return;
}

this.roomState.updateMyProperties({
name: participant.name,
type: participant.type,
Expand Down
Loading