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>
|
<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 -->
|
<!-- TOOLBAR -->
|
||||||
<ng-template [ngIf]="ovToolbarSelected">
|
<ng-template [ngIf]="ovToolbarSelected">
|
||||||
<ov-toolbar
|
<ov-toolbar
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
import { AfterViewInit, Component } from '@angular/core';
|
import { AfterViewInit, Component } from '@angular/core';
|
||||||
import { ActivatedRoute } from '@angular/router';
|
import { ActivatedRoute, Router } from '@angular/router';
|
||||||
import { PanelService } from 'openvidu-components-angular';
|
import { PanelService } from 'openvidu-components-angular';
|
||||||
import { Subscription } from 'rxjs';
|
import { Subscription } from 'rxjs';
|
||||||
import { RestService } from '../services/rest.service';
|
import { RestService } from '../services/rest.service';
|
||||||
|
import { ParticipantLeftEvent } from '../../../projects/openvidu-components-angular/src/lib/models/participant.model';
|
||||||
|
|
||||||
interface TemplateDirectives {
|
interface TemplateDirectives {
|
||||||
name: string;
|
name: string;
|
||||||
|
@ -157,6 +158,7 @@ export class TestingComponent implements AfterViewInit {
|
||||||
constructor(
|
constructor(
|
||||||
private restService: RestService,
|
private restService: RestService,
|
||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
|
private router: Router,
|
||||||
private panelService: PanelService
|
private panelService: PanelService
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
|
@ -296,6 +298,10 @@ export class TestingComponent implements AfterViewInit {
|
||||||
this.subscription.unsubscribe();
|
this.subscription.unsubscribe();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onParticipantLeft(event: ParticipantLeftEvent) {
|
||||||
|
this.router.navigate(['']);
|
||||||
|
}
|
||||||
|
|
||||||
toggleMyPanel(type: string) {
|
toggleMyPanel(type: string) {
|
||||||
this.panelService.togglePanel(type);
|
this.panelService.togglePanel(type);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue