mirror of https://github.com/OpenVidu/openvidu.git
ov-components: Update participant name handling in Session and Toolbar components
parent
e1f16a6179
commit
57e76fe69b
|
@ -290,7 +290,8 @@ export class SessionComponent implements OnInit, OnDestroy {
|
||||||
await this.openviduService.disconnectRoom(() => {
|
await this.openviduService.disconnectRoom(() => {
|
||||||
this.onParticipantLeft.emit({
|
this.onParticipantLeft.emit({
|
||||||
roomName: this.openviduService.getRoomName(),
|
roomName: this.openviduService.getRoomName(),
|
||||||
participantName: this.participantService.getLocalParticipant()?.identity || '',
|
participantName: this.participantService.getLocalParticipant()?.name || '',
|
||||||
|
identity: this.participantService.getLocalParticipant()?.identity || '',
|
||||||
reason
|
reason
|
||||||
});
|
});
|
||||||
}, false);
|
}, false);
|
||||||
|
@ -447,7 +448,7 @@ export class SessionComponent implements OnInit, OnDestroy {
|
||||||
this.log.d(`Data event received: ${topic}`);
|
this.log.d(`Data event received: ${topic}`);
|
||||||
switch (topic) {
|
switch (topic) {
|
||||||
case DataTopic.CHAT:
|
case DataTopic.CHAT:
|
||||||
const participantName = participant?.identity || 'Unknown';
|
const participantName = participant?.name || 'Unknown';
|
||||||
this.chatService.addRemoteMessage(event.message, participantName);
|
this.chatService.addRemoteMessage(event.message, participantName);
|
||||||
break;
|
break;
|
||||||
case DataTopic.RECORDING_STARTING:
|
case DataTopic.RECORDING_STARTING:
|
||||||
|
@ -537,7 +538,8 @@ export class SessionComponent implements OnInit, OnDestroy {
|
||||||
this.actionService.closeConnectionDialog();
|
this.actionService.closeConnectionDialog();
|
||||||
const participantLeftEvent: ParticipantLeftEvent = {
|
const participantLeftEvent: ParticipantLeftEvent = {
|
||||||
roomName: this.openviduService.getRoomName(),
|
roomName: this.openviduService.getRoomName(),
|
||||||
participantName: this.participantService.getLocalParticipant()?.identity || '',
|
participantName: this.participantService.getLocalParticipant()?.name || '',
|
||||||
|
identity: this.participantService.getLocalParticipant()?.identity || '',
|
||||||
reason: ParticipantLeftReason.NETWORK_DISCONNECT
|
reason: ParticipantLeftReason.NETWORK_DISCONNECT
|
||||||
};
|
};
|
||||||
const messageErrorKey = 'ERRORS.DISCONNECT';
|
const messageErrorKey = 'ERRORS.DISCONNECT';
|
||||||
|
|
|
@ -558,7 +558,8 @@ export class ToolbarComponent implements OnInit, OnDestroy, AfterViewInit {
|
||||||
await this.openviduService.disconnectRoom(() => {
|
await this.openviduService.disconnectRoom(() => {
|
||||||
this.onParticipantLeft.emit({
|
this.onParticipantLeft.emit({
|
||||||
roomName: this.openviduService.getRoomName(),
|
roomName: this.openviduService.getRoomName(),
|
||||||
participantName: this.participantService.getLocalParticipant()?.identity || '',
|
participantName: this.participantService.getLocalParticipant()?.name || '',
|
||||||
|
identity: this.participantService.getLocalParticipant()?.identity || '',
|
||||||
reason: ParticipantLeftReason.LEAVE
|
reason: ParticipantLeftReason.LEAVE
|
||||||
});
|
});
|
||||||
this.onRoomDisconnected.emit();
|
this.onRoomDisconnected.emit();
|
||||||
|
|
|
@ -18,6 +18,7 @@ import {
|
||||||
export interface ParticipantLeftEvent {
|
export interface ParticipantLeftEvent {
|
||||||
roomName: string;
|
roomName: string;
|
||||||
participantName: string;
|
participantName: string;
|
||||||
|
identity: string;
|
||||||
reason: ParticipantLeftReason;
|
reason: ParticipantLeftReason;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue