mirror of https://github.com/OpenVidu/openvidu.git
openvidu-testapp: add auto refresh of video track information
parent
baa753ac21
commit
0a3129e818
|
@ -1,4 +1,4 @@
|
|||
import { Component, Inject, NgZone, ViewChild } from '@angular/core';
|
||||
import { Component, Inject, NgZone, OnDestroy, ViewChild } from '@angular/core';
|
||||
import { CdkTextareaAutosize } from '@angular/cdk/text-field';
|
||||
import { take } from 'rxjs/operators';
|
||||
import { MAT_DIALOG_DATA } from '@angular/material/dialog';
|
||||
|
@ -8,13 +8,15 @@ import { MAT_DIALOG_DATA } from '@angular/material/dialog';
|
|||
templateUrl: './info-dialog.component.html',
|
||||
styleUrls: ['./info-dialog.component.css'],
|
||||
})
|
||||
export class InfoDialogComponent {
|
||||
export class InfoDialogComponent implements OnDestroy {
|
||||
title: string;
|
||||
subtitle: string;
|
||||
updateFunction: () => Promise<string>;
|
||||
|
||||
textAreaValue: string;
|
||||
|
||||
interval;
|
||||
|
||||
@ViewChild('autosize') autosize: CdkTextareaAutosize;
|
||||
|
||||
constructor(
|
||||
|
@ -31,6 +33,9 @@ export class InfoDialogComponent {
|
|||
this.updateFunction = data.updateFunction;
|
||||
|
||||
this.updateValue();
|
||||
this.interval = setInterval(() => {
|
||||
this.updateValue();
|
||||
}, 700);
|
||||
|
||||
// this.publisher
|
||||
// .getSenders()
|
||||
|
@ -70,6 +75,10 @@ export class InfoDialogComponent {
|
|||
// });
|
||||
}
|
||||
|
||||
ngOnDestroy() {
|
||||
clearInterval(this.interval);
|
||||
}
|
||||
|
||||
async updateValue() {
|
||||
this.textAreaValue = await this.updateFunction();
|
||||
this.triggerResize();
|
||||
|
|
Loading…
Reference in New Issue