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

Commit 5843530

Browse files
Merge pull request #748 from SuperViz/fix/update-participant-when-video-starts
fix: when participant enters into meeting room, update the participant avatar
2 parents 6d7c7a5 + d846a29 commit 5843530

File tree

1 file changed

+27
-12
lines changed

1 file changed

+27
-12
lines changed

src/components/video/index.ts

+27-12
Original file line numberDiff line numberDiff line change
@@ -534,6 +534,32 @@ export class VideoConference extends BaseComponent {
534534

535535
const newParticipantName = participant.name.trim();
536536

537+
if (this.videoConfig.canUseDefaultAvatars) {
538+
this.roomState.updateMyProperties({
539+
avatar: participant.avatar,
540+
name: participant.name,
541+
type: participant.type,
542+
joinedMeeting: true,
543+
});
544+
545+
localParticipant.publish({
546+
...localParticipant.value,
547+
avatar: participant.avatar,
548+
name: participant.name,
549+
});
550+
551+
participants.publish({
552+
...participants.value,
553+
[participant.id]: {
554+
...participants.value[participant.id],
555+
avatar: participant.avatar,
556+
name: participant.name,
557+
},
558+
});
559+
560+
return;
561+
}
562+
537563
localParticipant.publish({
538564
...localParticipant.value,
539565
name: newParticipantName,
@@ -542,22 +568,11 @@ export class VideoConference extends BaseComponent {
542568
participants.publish({
543569
...participants.value,
544570
[participant.id]: {
545-
...localParticipant.value,
571+
...participants.value[participant.id],
546572
name: newParticipantName,
547573
},
548574
});
549575

550-
if (this.videoConfig.canUseDefaultAvatars) {
551-
this.roomState.updateMyProperties({
552-
avatar: participant.avatar,
553-
name: participant.name,
554-
type: participant.type,
555-
joinedMeeting: true,
556-
});
557-
558-
return;
559-
}
560-
561576
this.roomState.updateMyProperties({
562577
name: participant.name,
563578
type: participant.type,

0 commit comments

Comments
 (0)