ov-components: Update participant name handling in Session and Toolbar components

master
Carlos Santos 2025-08-18 18:28:13 +02:00
parent e1f16a6179
commit 57e76fe69b
3 changed files with 8 additions and 4 deletions

View File

@ -290,7 +290,8 @@ export class SessionComponent implements OnInit, OnDestroy {
await this.openviduService.disconnectRoom(() => {
this.onParticipantLeft.emit({
roomName: this.openviduService.getRoomName(),
participantName: this.participantService.getLocalParticipant()?.identity || '',
participantName: this.participantService.getLocalParticipant()?.name || '',
identity: this.participantService.getLocalParticipant()?.identity || '',
reason
});
}, false);
@ -447,7 +448,7 @@ export class SessionComponent implements OnInit, OnDestroy {
this.log.d(`Data event received: ${topic}`);
switch (topic) {
case DataTopic.CHAT:
const participantName = participant?.identity || 'Unknown';
const participantName = participant?.name || 'Unknown';
this.chatService.addRemoteMessage(event.message, participantName);
break;
case DataTopic.RECORDING_STARTING:
@ -537,7 +538,8 @@ export class SessionComponent implements OnInit, OnDestroy {
this.actionService.closeConnectionDialog();
const participantLeftEvent: ParticipantLeftEvent = {
roomName: this.openviduService.getRoomName(),
participantName: this.participantService.getLocalParticipant()?.identity || '',
participantName: this.participantService.getLocalParticipant()?.name || '',
identity: this.participantService.getLocalParticipant()?.identity || '',
reason: ParticipantLeftReason.NETWORK_DISCONNECT
};
const messageErrorKey = 'ERRORS.DISCONNECT';

View File

@ -558,7 +558,8 @@ export class ToolbarComponent implements OnInit, OnDestroy, AfterViewInit {
await this.openviduService.disconnectRoom(() => {
this.onParticipantLeft.emit({
roomName: this.openviduService.getRoomName(),
participantName: this.participantService.getLocalParticipant()?.identity || '',
participantName: this.participantService.getLocalParticipant()?.name || '',
identity: this.participantService.getLocalParticipant()?.identity || '',
reason: ParticipantLeftReason.LEAVE
});
this.onRoomDisconnected.emit();

View File

@ -18,6 +18,7 @@ import {
export interface ParticipantLeftEvent {
roomName: string;
participantName: string;
identity: string;
reason: ParticipantLeftReason;
}