frontend: add force disconnect functionality for participants in video room

This commit is contained in:
Carlos Santos 2025-07-03 12:44:22 +02:00
parent 9cdba7259f
commit a700fff911
4 changed files with 30 additions and 1 deletions

View File

@ -146,7 +146,6 @@
<mat-menu #leaveMenu="matMenu">
<button mat-menu-item (click)="leaveMeeting()" id="leave-option">
<mat-icon>logout</mat-icon>
<span>Leave meeting</span>
</button>
<mat-divider></mat-divider>
@ -156,6 +155,21 @@
</button>
</mat-menu>
</div>
<!-- Participant Panel Item Elements -->
<div *ovParticipantPanelItemElements="let participant">
<!-- Leave Button for Local Participant -->
@if (!participant.isLocal) {
<button
mat-icon-button
(click)="forceDisconnectParticipant(participant)"
matTooltip="Disconnect participant"
class="force-disconnect-btn"
>
<mat-icon>call_end</mat-icon>
</button>
}
</div>
}
</ov-videoconference>
}

View File

@ -263,3 +263,8 @@
margin: 0px !important;
}
}
// Custom force disconnect button
.force-disconnect-btn {
color: var(--ov-meet-color-error)
}

View File

@ -146,6 +146,10 @@ export class VideoRoomComponent implements OnInit, OnDestroy {
}
}
async forceDisconnectParticipant(participant: ParticipantModel) {
await this.roomService.kickParticipant(this.roomId, participant.identity);
}
/**
* Initializes the participant name in the form control.
*

View File

@ -243,4 +243,10 @@ export class RoomService {
const path = `${this.MEETINGS_API}/${roomId}`;
return this.httpService.deleteRequest(path);
}
async kickParticipant(roomId: string, participantId: string): Promise<void> {
const path = `${this.MEETINGS_API}/${roomId}/participants/${participantId}`;
await this.httpService.deleteRequest(path);
this.log.d(`Participant ${participantId} kicked from room ${roomId}`);
}
}