diff --git a/openvidu-components-angular/projects/openvidu-components-angular/src/lib/components/pre-join/pre-join.component.ts b/openvidu-components-angular/projects/openvidu-components-angular/src/lib/components/pre-join/pre-join.component.ts index c22dae54..1b459f6a 100644 --- a/openvidu-components-angular/projects/openvidu-components-angular/src/lib/components/pre-join/pre-join.component.ts +++ b/openvidu-components-angular/projects/openvidu-components-angular/src/lib/components/pre-join/pre-join.component.ts @@ -128,7 +128,7 @@ export class PreJoinComponent implements OnInit, OnDestroy { } onParticipantNameChanged(name: string) { - this.participantName = name; + if (name) this.participantName = name; } onEnterPressed() { @@ -151,6 +151,7 @@ export class PreJoinComponent implements OnInit, OnDestroy { // this.cd.markForCheck(); }); this.libService.participantName$.subscribe((value: string) => { + console.warn('participantName', value); if (value) this.participantName = value; // this.cd.markForCheck(); }); diff --git a/openvidu-components-angular/projects/openvidu-components-angular/src/lib/directives/api/videoconference.directive.ts b/openvidu-components-angular/projects/openvidu-components-angular/src/lib/directives/api/videoconference.directive.ts index 795acc24..bc5e2079 100644 --- a/openvidu-components-angular/projects/openvidu-components-angular/src/lib/directives/api/videoconference.directive.ts +++ b/openvidu-components-angular/projects/openvidu-components-angular/src/lib/directives/api/videoconference.directive.ts @@ -1,4 +1,4 @@ -import { Directive, ElementRef, Input, OnDestroy, OnInit } from '@angular/core'; +import { AfterViewInit, Directive, ElementRef, Input, OnDestroy, OnInit } from '@angular/core'; import { CaptionsLangOption } from '../../models/caption.model'; // import { CaptionService } from '../../services/caption/caption.service'; import { OpenViduComponentsConfigService } from '../../services/config/directive-config.service'; @@ -490,7 +490,7 @@ export class LangOptionsDirective implements OnDestroy { @Directive({ selector: 'ov-videoconference[participantName]' }) -export class ParticipantNameDirective implements OnInit { +export class ParticipantNameDirective implements AfterViewInit, OnDestroy { /** * @ignore */ @@ -509,7 +509,7 @@ export class ParticipantNameDirective implements OnInit { /** * @ignore */ - ngOnInit(): void { + ngAfterViewInit(): void { this.update(this.participantName); } @@ -531,7 +531,7 @@ export class ParticipantNameDirective implements OnInit { * @ignore */ update(value: string) { - this.libService.setParticipantName(value); + if (value) this.libService.setParticipantName(value); } }