From dfae82d4cfeb65311e51574abae0e632561ec860 Mon Sep 17 00:00:00 2001 From: Carlos Santos <4a.santos@gmail.com> Date: Fri, 23 May 2025 11:24:45 +0200 Subject: [PATCH] ov-components: add event handling for participant left and update config state --- openvidu-components-angular/e2e/events.test.ts | 2 ++ .../src/app/openvidu-call/call.component.html | 7 ++----- .../src/app/openvidu-call/call.component.ts | 2 ++ 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/openvidu-components-angular/e2e/events.test.ts b/openvidu-components-angular/e2e/events.test.ts index c6e261a9..44ab0c1b 100644 --- a/openvidu-components-angular/e2e/events.test.ts +++ b/openvidu-components-angular/e2e/events.test.ts @@ -620,6 +620,8 @@ describe('Testing videoconference EVENTS', () => { expect(await utils.isPresent('#leave-btn')).toBeTrue(); await leaveButton.click(); + await utils.waitForElement('#events'); + // Checking if onParticipantLeft has been received await utils.waitForElement('#onParticipantLeft'); expect(await utils.isPresent('#onParticipantLeft')).toBeTrue(); diff --git a/openvidu-components-angular/src/app/openvidu-call/call.component.html b/openvidu-components-angular/src/app/openvidu-call/call.component.html index b7e78f47..375b2429 100644 --- a/openvidu-components-angular/src/app/openvidu-call/call.component.html +++ b/openvidu-components-angular/src/app/openvidu-call/call.component.html @@ -1,3 +1,5 @@ +
+ @if (configReady) { - } - - -
\ No newline at end of file diff --git a/openvidu-components-angular/src/app/openvidu-call/call.component.ts b/openvidu-components-angular/src/app/openvidu-call/call.component.ts index d181d3d9..b0da6073 100644 --- a/openvidu-components-angular/src/app/openvidu-call/call.component.ts +++ b/openvidu-components-angular/src/app/openvidu-call/call.component.ts @@ -175,6 +175,8 @@ export class CallComponent implements OnInit { } async onParticipantLeft(event: ParticipantLeftEvent) { + this.configReady = false; + this.isSessionAlive = false; this.appendElement('onParticipantLeft'); console.warn('VC PARTICIPANT LEFT', event); if (this.redirectToHomeOnLeaves) await this.router.navigate(['/']);