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 { CdkTextareaAutosize } from '@angular/cdk/text-field';
|
||||||
import { take } from 'rxjs/operators';
|
import { take } from 'rxjs/operators';
|
||||||
import { MAT_DIALOG_DATA } from '@angular/material/dialog';
|
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',
|
templateUrl: './info-dialog.component.html',
|
||||||
styleUrls: ['./info-dialog.component.css'],
|
styleUrls: ['./info-dialog.component.css'],
|
||||||
})
|
})
|
||||||
export class InfoDialogComponent {
|
export class InfoDialogComponent implements OnDestroy {
|
||||||
title: string;
|
title: string;
|
||||||
subtitle: string;
|
subtitle: string;
|
||||||
updateFunction: () => Promise<string>;
|
updateFunction: () => Promise<string>;
|
||||||
|
|
||||||
textAreaValue: string;
|
textAreaValue: string;
|
||||||
|
|
||||||
|
interval;
|
||||||
|
|
||||||
@ViewChild('autosize') autosize: CdkTextareaAutosize;
|
@ViewChild('autosize') autosize: CdkTextareaAutosize;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
|
@ -31,6 +33,9 @@ export class InfoDialogComponent {
|
||||||
this.updateFunction = data.updateFunction;
|
this.updateFunction = data.updateFunction;
|
||||||
|
|
||||||
this.updateValue();
|
this.updateValue();
|
||||||
|
this.interval = setInterval(() => {
|
||||||
|
this.updateValue();
|
||||||
|
}, 700);
|
||||||
|
|
||||||
// this.publisher
|
// this.publisher
|
||||||
// .getSenders()
|
// .getSenders()
|
||||||
|
@ -70,6 +75,10 @@ export class InfoDialogComponent {
|
||||||
// });
|
// });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ngOnDestroy() {
|
||||||
|
clearInterval(this.interval);
|
||||||
|
}
|
||||||
|
|
||||||
async updateValue() {
|
async updateValue() {
|
||||||
this.textAreaValue = await this.updateFunction();
|
this.textAreaValue = await this.updateFunction();
|
||||||
this.triggerResize();
|
this.triggerResize();
|
||||||
|
|
Loading…
Reference in New Issue