ov-components: add participant left event handling and navigation in testapp

master
Carlos Santos 2025-05-22 12:47:13 +02:00
parent cea8ce0def
commit 421c5ea29c
2 changed files with 8 additions and 2 deletions

View File

@ -70,7 +70,7 @@
<div id="events"></div>
<ov-videoconference *ngIf="!showDirectives" [token]="token" [prejoin]="false" [participantName]="'Testing'">
<ov-videoconference *ngIf="!showDirectives" [token]="token" [prejoin]="false" [participantName]="'Testing'" (onParticipantLeft)="onParticipantLeft($event)">
<!-- TOOLBAR -->
<ng-template [ngIf]="ovToolbarSelected">
<ov-toolbar

View File

@ -1,8 +1,9 @@
import { AfterViewInit, Component } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { ActivatedRoute, Router } from '@angular/router';
import { PanelService } from 'openvidu-components-angular';
import { Subscription } from 'rxjs';
import { RestService } from '../services/rest.service';
import { ParticipantLeftEvent } from '../../../projects/openvidu-components-angular/src/lib/models/participant.model';
interface TemplateDirectives {
name: string;
@ -157,6 +158,7 @@ export class TestingComponent implements AfterViewInit {
constructor(
private restService: RestService,
private route: ActivatedRoute,
private router: Router,
private panelService: PanelService
) {}
@ -296,6 +298,10 @@ export class TestingComponent implements AfterViewInit {
this.subscription.unsubscribe();
}
onParticipantLeft(event: ParticipantLeftEvent) {
this.router.navigate(['']);
}
toggleMyPanel(type: string) {
this.panelService.togglePanel(type);
}