ov-components: add event handling for participant left and update config state

master
Carlos Santos 2025-05-23 11:24:45 +02:00
parent 549a822491
commit dfae82d4cf
3 changed files with 6 additions and 5 deletions

View File

@ -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();

View File

@ -1,3 +1,5 @@
<div id="events"></div>
@if (configReady) {
<ov-videoconference
[token]="token"
@ -30,7 +32,6 @@
[activitiesPanelRecordingActivity]="activitiesPanelRecordingActivity"
[activitiesPanelBroadcastingActivity]="activitiesPanelBroadcastingActivity"
[toolbarSettingsButton]="toolbarSettingsButton"
(onTokenRequested)="onTokenRequested($event)"
(onReadyToJoin)="onReadyToJoin()"
(onRoomCreated)="onRoomCreated($event)"
@ -55,8 +56,4 @@
(onActivitiesPanelStatusChanged)="onActivitiesPanelStatusChanged($event)"
>
</ov-videoconference>
}
<div id="events"></div>

View File

@ -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(['/']);