mirror of https://github.com/OpenVidu/openvidu.git
ov-components: add participant left event handling and navigation in testapp
parent
cea8ce0def
commit
421c5ea29c
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue