frontend: Enhance meeting component to manage participant left events and update state

This commit is contained in:
CSantosM 2026-01-18 16:38:55 +01:00
parent 13a339eb87
commit b5ccd7c087
2 changed files with 16 additions and 3 deletions

View File

@ -13,7 +13,7 @@
<p class="prejoin-error-text">Unable to load the lobby. Please try reloading the page.</p>
</div>
}
} @else {
} @else if (!isMeetingLeft()) {
<ov-videoconference
[token]="roomMemberToken()!"
[prejoin]="true"
@ -50,7 +50,7 @@
[showDisconnectionDialog]="false"
(onRoomCreated)="onRoomCreated($event)"
(onParticipantConnected)="eventHandlerService.onParticipantConnected($event)"
(onParticipantLeft)="eventHandlerService.onParticipantLeft($event)"
(onParticipantLeft)="onParticipantLeft($event)"
(onRecordingStartRequested)="eventHandlerService.onRecordingStartRequested($event)"
(onRecordingStopRequested)="eventHandlerService.onRecordingStopRequested($event)"
(onViewRecordingsClicked)="onViewRecordingsClicked()"

View File

@ -1,5 +1,5 @@
import { CommonModule } from '@angular/common';
import { Component, computed, ContentChild, effect, inject, OnInit, Signal } from '@angular/core';
import { Component, computed, ContentChild, effect, inject, OnInit, signal, Signal } from '@angular/core';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { MatIconModule } from '@angular/material/icon';
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
@ -58,6 +58,11 @@ export class MeetingComponent implements OnInit {
showLobby = true;
isLobbyReady = false;
/**
* Controls whether to show the videoconference component
*/
protected isMeetingLeft = signal(false);
protected features: Signal<ApplicationFeatures>;
protected meetingService = inject(MeetingService);
protected participantService = inject(RoomMemberService);
@ -196,6 +201,14 @@ export class MeetingComponent implements OnInit {
window.open(`/room/${this.roomId()}/recordings?secret=${this.roomSecret()}`, '_blank');
}
/**
* Handles the participant left event and hides the videoconference component
*/
protected onParticipantLeft(event: any): void {
this.isMeetingLeft.set(true);
this.eventHandlerService.onParticipantLeft(event);
}
/**
* Centralized logic for managing video pinning based on
* remote participants and local screen sharing state.