Carlos Santos f709eb8da9 openvidu-testapp: Updated to Angular 14
ci: Updated testapp building 

openvidu-testapp: Added missing HTTPClient import

openvidu-testapp: Updated circular references stringifying a JSON
2022-11-23 17:15:34 +01:00

39 lines
1.1 KiB
TypeScript

import { Component, Input, ViewChild, ElementRef, OnInit, AfterViewInit } from '@angular/core';
import { DomSanitizer, SafeStyle } from '@angular/platform-browser';
import { StreamManager } from 'openvidu-browser';
@Component({
selector: 'app-ov-video',
template: '<video #videoElement [poster]="poster" [attr.style]="sanitizedStyle"></video>'
})
export class OpenViduVideoComponent implements OnInit, AfterViewInit {
@ViewChild('videoElement') elementRef: ElementRef;
@Input() poster = '';
@Input() attrstyle = '';
sanitizedStyle: SafeStyle;
_streamManager: StreamManager;
constructor(private sanitizer: DomSanitizer) { }
ngOnInit() {
this.sanitizedStyle = this.sanitizer.bypassSecurityTrustStyle(this.attrstyle);
}
ngAfterViewInit() {
this._streamManager.addVideoElement(this.elementRef.nativeElement);
}
@Input()
set streamManager(streamManager: StreamManager) {
this._streamManager = streamManager;
if (!!this.elementRef) {
this._streamManager.addVideoElement(this.elementRef.nativeElement);
}
}
}