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(); expect(await utils.isPresent('#leave-btn')).toBeTrue();
await leaveButton.click(); await leaveButton.click();
await utils.waitForElement('#events');
// Checking if onParticipantLeft has been received // Checking if onParticipantLeft has been received
await utils.waitForElement('#onParticipantLeft'); await utils.waitForElement('#onParticipantLeft');
expect(await utils.isPresent('#onParticipantLeft')).toBeTrue(); expect(await utils.isPresent('#onParticipantLeft')).toBeTrue();

View File

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

View File

@ -175,6 +175,8 @@ export class CallComponent implements OnInit {
} }
async onParticipantLeft(event: ParticipantLeftEvent) { async onParticipantLeft(event: ParticipantLeftEvent) {
this.configReady = false;
this.isSessionAlive = false;
this.appendElement('onParticipantLeft'); this.appendElement('onParticipantLeft');
console.warn('VC PARTICIPANT LEFT', event); console.warn('VC PARTICIPANT LEFT', event);
if (this.redirectToHomeOnLeaves) await this.router.navigate(['/']); if (this.redirectToHomeOnLeaves) await this.router.navigate(['/']);