0">
-
diff --git a/openvidu-components-angular/projects/openvidu-components-angular/src/lib/components/panel/participants-panel/participants-panel/participants-panel.component.ts b/openvidu-components-angular/projects/openvidu-components-angular/src/lib/components/panel/participants-panel/participants-panel/participants-panel.component.ts
index 3fe03b02..7b9e00ff 100644
--- a/openvidu-components-angular/projects/openvidu-components-angular/src/lib/components/panel/participants-panel/participants-panel/participants-panel.component.ts
+++ b/openvidu-components-angular/projects/openvidu-components-angular/src/lib/components/panel/participants-panel/participants-panel/participants-panel.component.ts
@@ -13,9 +13,10 @@ import {
import { ParticipantService } from '../../../../services/participant/participant.service';
import { PanelService } from '../../../../services/panel/panel.service';
import { ParticipantPanelItemDirective } from '../../../../directives/template/openvidu-components-angular.directive';
-import { Subscription } from 'rxjs';
+import { Subject, takeUntil } from 'rxjs';
import { ParticipantModel } from '../../../../models/participant.model';
import { TemplateManagerService, ParticipantsPanelTemplateConfiguration } from '../../../../services/template/template-manager.service';
+import { OpenViduComponentsConfigService } from '../../../../services/config/directive-config.service';
/**
* The **ParticipantsPanelComponent** is hosted inside of the {@link PanelComponent}.
@@ -49,6 +50,12 @@ export class ParticipantsPanelComponent implements OnInit, OnDestroy, AfterViewI
*/
@ContentChild('participantPanelItem', { read: TemplateRef }) participantPanelItemTemplate: TemplateRef
;
+ /**
+ * @ignore
+ */
+ @ContentChild('participantPanelAfterLocalParticipant', { read: TemplateRef })
+ participantPanelAfterLocalParticipantTemplate: TemplateRef;
+
/**
* @ignore
*/
@@ -69,8 +76,7 @@ export class ParticipantsPanelComponent implements OnInit, OnDestroy, AfterViewI
// Store directive references for template setup
private _externalParticipantPanelItem?: ParticipantPanelItemDirective;
- private localParticipantSubs: Subscription;
- private remoteParticipantsSubs: Subscription;
+ private destroy$ = new Subject();
/**
* @ignore
@@ -79,7 +85,8 @@ export class ParticipantsPanelComponent implements OnInit, OnDestroy, AfterViewI
private participantService: ParticipantService,
private panelService: PanelService,
private cd: ChangeDetectorRef,
- private templateManagerService: TemplateManagerService
+ private templateManagerService: TemplateManagerService,
+ private libService: OpenViduComponentsConfigService
) {}
/**
@@ -88,25 +95,15 @@ export class ParticipantsPanelComponent implements OnInit, OnDestroy, AfterViewI
ngOnInit(): void {
this.setupTemplates();
- this.localParticipantSubs = this.participantService.localParticipant$.subscribe((p: ParticipantModel | undefined) => {
- if (p) {
- this.localParticipant = p;
- this.cd.markForCheck();
- }
- });
-
- this.remoteParticipantsSubs = this.participantService.remoteParticipants$.subscribe((p: ParticipantModel[]) => {
- this.remoteParticipants = p;
- this.cd.markForCheck();
- });
+ this.subscribeToParticipantsChanges();
}
/**
* @ignore
*/
ngOnDestroy() {
- if (this.localParticipantSubs) this.localParticipantSubs.unsubscribe();
- if (this.remoteParticipantsSubs) this.remoteParticipantsSubs.unsubscribe;
+ this.destroy$.next();
+ this.destroy$.complete();
}
/**
@@ -121,6 +118,21 @@ export class ParticipantsPanelComponent implements OnInit, OnDestroy, AfterViewI
}
}
+ private subscribeToParticipantsChanges() {
+ this.participantService.localParticipant$.pipe(takeUntil(this.destroy$)).subscribe((p: ParticipantModel | undefined) => {
+ if (p) {
+ this.localParticipant = p;
+ this.cd.markForCheck();
+ }
+ });
+
+ this.participantService.remoteParticipants$.pipe(takeUntil(this.destroy$)).subscribe((p: ParticipantModel[]) => {
+ this.remoteParticipants = p;
+ this.cd.markForCheck();
+ });
+ }
+
+
/**
* @internal
* Sets up all templates using the template manager service
@@ -143,6 +155,9 @@ export class ParticipantsPanelComponent implements OnInit, OnDestroy, AfterViewI
if (this.templateConfig.participantPanelItemTemplate) {
this.participantPanelItemTemplate = this.templateConfig.participantPanelItemTemplate;
}
+ if (this.templateConfig.participantPanelAfterLocalParticipantTemplate) {
+ this.participantPanelAfterLocalParticipantTemplate = this.templateConfig.participantPanelAfterLocalParticipantTemplate;
+ }
}
/**
diff --git a/openvidu-components-angular/projects/openvidu-components-angular/src/lib/components/videoconference/videoconference.component.html b/openvidu-components-angular/projects/openvidu-components-angular/src/lib/components/videoconference/videoconference.component.html
index e98f47cb..0a2f1787 100644
--- a/openvidu-components-angular/projects/openvidu-components-angular/src/lib/components/videoconference/videoconference.component.html
+++ b/openvidu-components-angular/projects/openvidu-components-angular/src/lib/components/videoconference/videoconference.component.html
@@ -26,7 +26,11 @@
{{ componentState.error?.message }}