From e4a6d9be1d8bff240c82477cbe7ddf07776bd783 Mon Sep 17 00:00:00 2001
From: csantosm <4a.santos@gmail.com>
Date: Wed, 2 Feb 2022 13:42:33 +0100
Subject: [PATCH 01/74] openvidu-components: Added panel component
---
.../lib/components/panel/panel.component.css | 0
.../lib/components/panel/panel.component.html | 1 +
.../components/panel/panel.component.spec.ts | 25 +++++++++++++++++++
.../lib/components/panel/panel.component.ts | 15 +++++++++++
.../src/lib/openvidu-angular.module.ts | 4 ++-
5 files changed, 44 insertions(+), 1 deletion(-)
create mode 100644 openvidu-components-angular/projects/openvidu-angular/src/lib/components/panel/panel.component.css
create mode 100644 openvidu-components-angular/projects/openvidu-angular/src/lib/components/panel/panel.component.html
create mode 100644 openvidu-components-angular/projects/openvidu-angular/src/lib/components/panel/panel.component.spec.ts
create mode 100644 openvidu-components-angular/projects/openvidu-angular/src/lib/components/panel/panel.component.ts
diff --git a/openvidu-components-angular/projects/openvidu-angular/src/lib/components/panel/panel.component.css b/openvidu-components-angular/projects/openvidu-angular/src/lib/components/panel/panel.component.css
new file mode 100644
index 00000000..e69de29b
diff --git a/openvidu-components-angular/projects/openvidu-angular/src/lib/components/panel/panel.component.html b/openvidu-components-angular/projects/openvidu-angular/src/lib/components/panel/panel.component.html
new file mode 100644
index 00000000..4d957c87
--- /dev/null
+++ b/openvidu-components-angular/projects/openvidu-angular/src/lib/components/panel/panel.component.html
@@ -0,0 +1 @@
+
panel works!
diff --git a/openvidu-components-angular/projects/openvidu-angular/src/lib/components/panel/panel.component.spec.ts b/openvidu-components-angular/projects/openvidu-angular/src/lib/components/panel/panel.component.spec.ts
new file mode 100644
index 00000000..b0f6a9d7
--- /dev/null
+++ b/openvidu-components-angular/projects/openvidu-angular/src/lib/components/panel/panel.component.spec.ts
@@ -0,0 +1,25 @@
+import { ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { PanelComponent } from './panel.component';
+
+describe('PanelComponent', () => {
+ let component: PanelComponent;
+ let fixture: ComponentFixture;
+
+ beforeEach(async () => {
+ await TestBed.configureTestingModule({
+ declarations: [ PanelComponent ]
+ })
+ .compileComponents();
+ });
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(PanelComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/openvidu-components-angular/projects/openvidu-angular/src/lib/components/panel/panel.component.ts b/openvidu-components-angular/projects/openvidu-angular/src/lib/components/panel/panel.component.ts
new file mode 100644
index 00000000..aabdad27
--- /dev/null
+++ b/openvidu-components-angular/projects/openvidu-angular/src/lib/components/panel/panel.component.ts
@@ -0,0 +1,15 @@
+import { Component, OnInit } from '@angular/core';
+
+@Component({
+ selector: 'ov-panel',
+ templateUrl: './panel.component.html',
+ styleUrls: ['./panel.component.css']
+})
+export class PanelComponent implements OnInit {
+
+ constructor() { }
+
+ ngOnInit(): void {
+ }
+
+}
diff --git a/openvidu-components-angular/projects/openvidu-angular/src/lib/openvidu-angular.module.ts b/openvidu-components-angular/projects/openvidu-angular/src/lib/openvidu-angular.module.ts
index 6885fe47..bf3cbf81 100644
--- a/openvidu-components-angular/projects/openvidu-angular/src/lib/openvidu-angular.module.ts
+++ b/openvidu-components-angular/projects/openvidu-angular/src/lib/openvidu-angular.module.ts
@@ -57,6 +57,7 @@ import { ParticipantService } from './services/participant/participant.service';
import { ParticipantItemComponent } from './components/participants-panel/participant-item/participant-item.component';
import { ParticipantsPanelComponent } from './components/participants-panel/participants-panel/participants-panel.component';
import { VideoconferenceComponent } from './components/videoconference/videoconference.component';
+import { PanelComponent } from './components/panel/panel.component';
@NgModule({
declarations: [
@@ -75,7 +76,8 @@ import { VideoconferenceComponent } from './components/videoconference/videoconf
NicknamePipe,
ParticipantItemComponent,
ParticipantsPanelComponent,
- VideoconferenceComponent
+ VideoconferenceComponent,
+ PanelComponent
],
imports: [
CommonModule,
From bfd21ecd1e926650f023efec3024dc86dd7eb2dc Mon Sep 17 00:00:00 2001
From: csantosm <4a.santos@gmail.com>
Date: Wed, 2 Feb 2022 13:44:49 +0100
Subject: [PATCH 02/74] openvidu-components: Moved panels into panel component
---
.../{ => panel}/chat-panel/chat-panel.component.css | 0
.../{ => panel}/chat-panel/chat-panel.component.html | 0
.../{ => panel}/chat-panel/chat-panel.component.spec.ts | 4 ++--
.../{ => panel}/chat-panel/chat-panel.component.ts | 8 ++++----
.../participant-item/participant-item.component.css | 0
.../participant-item/participant-item.component.html | 0
.../participant-item/participant-item.component.spec.ts | 0
.../participant-item/participant-item.component.ts | 0
.../participants-panel/participants-panel.component.css | 0
.../participants-panel/participants-panel.component.html | 0
.../participants-panel.component.spec.ts | 0
.../participants-panel/participants-panel.component.ts | 6 +++---
.../openvidu-angular/src/lib/openvidu-angular.module.ts | 6 +++---
.../projects/openvidu-angular/src/public-api.ts | 4 ++--
14 files changed, 14 insertions(+), 14 deletions(-)
rename openvidu-components-angular/projects/openvidu-angular/src/lib/components/{ => panel}/chat-panel/chat-panel.component.css (100%)
rename openvidu-components-angular/projects/openvidu-angular/src/lib/components/{ => panel}/chat-panel/chat-panel.component.html (100%)
rename openvidu-components-angular/projects/openvidu-angular/src/lib/components/{ => panel}/chat-panel/chat-panel.component.spec.ts (82%)
rename openvidu-components-angular/projects/openvidu-angular/src/lib/components/{ => panel}/chat-panel/chat-panel.component.ts (87%)
rename openvidu-components-angular/projects/openvidu-angular/src/lib/components/{ => panel}/participants-panel/participant-item/participant-item.component.css (100%)
rename openvidu-components-angular/projects/openvidu-angular/src/lib/components/{ => panel}/participants-panel/participant-item/participant-item.component.html (100%)
rename openvidu-components-angular/projects/openvidu-angular/src/lib/components/{ => panel}/participants-panel/participant-item/participant-item.component.spec.ts (100%)
rename openvidu-components-angular/projects/openvidu-angular/src/lib/components/{ => panel}/participants-panel/participant-item/participant-item.component.ts (100%)
rename openvidu-components-angular/projects/openvidu-angular/src/lib/components/{ => panel}/participants-panel/participants-panel/participants-panel.component.css (100%)
rename openvidu-components-angular/projects/openvidu-angular/src/lib/components/{ => panel}/participants-panel/participants-panel/participants-panel.component.html (100%)
rename openvidu-components-angular/projects/openvidu-angular/src/lib/components/{ => panel}/participants-panel/participants-panel/participants-panel.component.spec.ts (100%)
rename openvidu-components-angular/projects/openvidu-angular/src/lib/components/{ => panel}/participants-panel/participants-panel/participants-panel.component.ts (83%)
diff --git a/openvidu-components-angular/projects/openvidu-angular/src/lib/components/chat-panel/chat-panel.component.css b/openvidu-components-angular/projects/openvidu-angular/src/lib/components/panel/chat-panel/chat-panel.component.css
similarity index 100%
rename from openvidu-components-angular/projects/openvidu-angular/src/lib/components/chat-panel/chat-panel.component.css
rename to openvidu-components-angular/projects/openvidu-angular/src/lib/components/panel/chat-panel/chat-panel.component.css
diff --git a/openvidu-components-angular/projects/openvidu-angular/src/lib/components/chat-panel/chat-panel.component.html b/openvidu-components-angular/projects/openvidu-angular/src/lib/components/panel/chat-panel/chat-panel.component.html
similarity index 100%
rename from openvidu-components-angular/projects/openvidu-angular/src/lib/components/chat-panel/chat-panel.component.html
rename to openvidu-components-angular/projects/openvidu-angular/src/lib/components/panel/chat-panel/chat-panel.component.html
diff --git a/openvidu-components-angular/projects/openvidu-angular/src/lib/components/chat-panel/chat-panel.component.spec.ts b/openvidu-components-angular/projects/openvidu-angular/src/lib/components/panel/chat-panel/chat-panel.component.spec.ts
similarity index 82%
rename from openvidu-components-angular/projects/openvidu-angular/src/lib/components/chat-panel/chat-panel.component.spec.ts
rename to openvidu-components-angular/projects/openvidu-angular/src/lib/components/panel/chat-panel/chat-panel.component.spec.ts
index 8cc7ff68..0204558a 100644
--- a/openvidu-components-angular/projects/openvidu-angular/src/lib/components/chat-panel/chat-panel.component.spec.ts
+++ b/openvidu-components-angular/projects/openvidu-angular/src/lib/components/panel/chat-panel/chat-panel.component.spec.ts
@@ -1,6 +1,6 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
-import { ChatService } from '../../services/chat/chat.service';
-import { ChatServiceMock } from '../../services/chat/chat.service.mock';
+import { ChatService } from '../../../services/chat/chat.service';
+import { ChatServiceMock } from '../../../services/chat/chat.service.mock';
import { ChatPanelComponent } from './chat-panel.component';
diff --git a/openvidu-components-angular/projects/openvidu-angular/src/lib/components/chat-panel/chat-panel.component.ts b/openvidu-components-angular/projects/openvidu-angular/src/lib/components/panel/chat-panel/chat-panel.component.ts
similarity index 87%
rename from openvidu-components-angular/projects/openvidu-angular/src/lib/components/chat-panel/chat-panel.component.ts
rename to openvidu-components-angular/projects/openvidu-angular/src/lib/components/panel/chat-panel/chat-panel.component.ts
index 4182525d..a885dce2 100644
--- a/openvidu-components-angular/projects/openvidu-angular/src/lib/components/chat-panel/chat-panel.component.ts
+++ b/openvidu-components-angular/projects/openvidu-angular/src/lib/components/panel/chat-panel/chat-panel.component.ts
@@ -1,9 +1,9 @@
import { AfterViewInit, Component, ElementRef, HostListener, OnInit, ViewChild } from '@angular/core';
import { Subscription } from 'rxjs';
-import { ChatMessage } from '../../models/chat.model';
-import { MenuType } from '../../models/menu.model';
-import { ChatService } from '../../services/chat/chat.service';
-import { SidenavMenuService } from '../../services/sidenav-menu/sidenav-menu.service';
+import { ChatMessage } from '../../../models/chat.model';
+import { MenuType } from '../../../models/menu.model';
+import { ChatService } from '../../../services/chat/chat.service';
+import { SidenavMenuService } from '../../../services/sidenav-menu/sidenav-menu.service';
@Component({
selector: 'ov-chat-panel',
diff --git a/openvidu-components-angular/projects/openvidu-angular/src/lib/components/participants-panel/participant-item/participant-item.component.css b/openvidu-components-angular/projects/openvidu-angular/src/lib/components/panel/participants-panel/participant-item/participant-item.component.css
similarity index 100%
rename from openvidu-components-angular/projects/openvidu-angular/src/lib/components/participants-panel/participant-item/participant-item.component.css
rename to openvidu-components-angular/projects/openvidu-angular/src/lib/components/panel/participants-panel/participant-item/participant-item.component.css
diff --git a/openvidu-components-angular/projects/openvidu-angular/src/lib/components/participants-panel/participant-item/participant-item.component.html b/openvidu-components-angular/projects/openvidu-angular/src/lib/components/panel/participants-panel/participant-item/participant-item.component.html
similarity index 100%
rename from openvidu-components-angular/projects/openvidu-angular/src/lib/components/participants-panel/participant-item/participant-item.component.html
rename to openvidu-components-angular/projects/openvidu-angular/src/lib/components/panel/participants-panel/participant-item/participant-item.component.html
diff --git a/openvidu-components-angular/projects/openvidu-angular/src/lib/components/participants-panel/participant-item/participant-item.component.spec.ts b/openvidu-components-angular/projects/openvidu-angular/src/lib/components/panel/participants-panel/participant-item/participant-item.component.spec.ts
similarity index 100%
rename from openvidu-components-angular/projects/openvidu-angular/src/lib/components/participants-panel/participant-item/participant-item.component.spec.ts
rename to openvidu-components-angular/projects/openvidu-angular/src/lib/components/panel/participants-panel/participant-item/participant-item.component.spec.ts
diff --git a/openvidu-components-angular/projects/openvidu-angular/src/lib/components/participants-panel/participant-item/participant-item.component.ts b/openvidu-components-angular/projects/openvidu-angular/src/lib/components/panel/participants-panel/participant-item/participant-item.component.ts
similarity index 100%
rename from openvidu-components-angular/projects/openvidu-angular/src/lib/components/participants-panel/participant-item/participant-item.component.ts
rename to openvidu-components-angular/projects/openvidu-angular/src/lib/components/panel/participants-panel/participant-item/participant-item.component.ts
diff --git a/openvidu-components-angular/projects/openvidu-angular/src/lib/components/participants-panel/participants-panel/participants-panel.component.css b/openvidu-components-angular/projects/openvidu-angular/src/lib/components/panel/participants-panel/participants-panel/participants-panel.component.css
similarity index 100%
rename from openvidu-components-angular/projects/openvidu-angular/src/lib/components/participants-panel/participants-panel/participants-panel.component.css
rename to openvidu-components-angular/projects/openvidu-angular/src/lib/components/panel/participants-panel/participants-panel/participants-panel.component.css
diff --git a/openvidu-components-angular/projects/openvidu-angular/src/lib/components/participants-panel/participants-panel/participants-panel.component.html b/openvidu-components-angular/projects/openvidu-angular/src/lib/components/panel/participants-panel/participants-panel/participants-panel.component.html
similarity index 100%
rename from openvidu-components-angular/projects/openvidu-angular/src/lib/components/participants-panel/participants-panel/participants-panel.component.html
rename to openvidu-components-angular/projects/openvidu-angular/src/lib/components/panel/participants-panel/participants-panel/participants-panel.component.html
diff --git a/openvidu-components-angular/projects/openvidu-angular/src/lib/components/participants-panel/participants-panel/participants-panel.component.spec.ts b/openvidu-components-angular/projects/openvidu-angular/src/lib/components/panel/participants-panel/participants-panel/participants-panel.component.spec.ts
similarity index 100%
rename from openvidu-components-angular/projects/openvidu-angular/src/lib/components/participants-panel/participants-panel/participants-panel.component.spec.ts
rename to openvidu-components-angular/projects/openvidu-angular/src/lib/components/panel/participants-panel/participants-panel/participants-panel.component.spec.ts
diff --git a/openvidu-components-angular/projects/openvidu-angular/src/lib/components/participants-panel/participants-panel/participants-panel.component.ts b/openvidu-components-angular/projects/openvidu-angular/src/lib/components/panel/participants-panel/participants-panel/participants-panel.component.ts
similarity index 83%
rename from openvidu-components-angular/projects/openvidu-angular/src/lib/components/participants-panel/participants-panel/participants-panel.component.ts
rename to openvidu-components-angular/projects/openvidu-angular/src/lib/components/panel/participants-panel/participants-panel/participants-panel.component.ts
index 07496acb..b9d9dcc7 100644
--- a/openvidu-components-angular/projects/openvidu-angular/src/lib/components/participants-panel/participants-panel/participants-panel.component.ts
+++ b/openvidu-components-angular/projects/openvidu-angular/src/lib/components/panel/participants-panel/participants-panel/participants-panel.component.ts
@@ -1,7 +1,7 @@
import { ChangeDetectorRef, Component, OnInit } from '@angular/core';
-import { ParticipantAbstractModel, ParticipantModel } from '../../../models/participant.model';
-import { ParticipantService } from '../../../services/participant/participant.service';
-import { SidenavMenuService } from '../../../services/sidenav-menu/sidenav-menu.service';
+import { ParticipantAbstractModel, ParticipantModel } from '../../../../models/participant.model';
+import { ParticipantService } from '../../../../services/participant/participant.service';
+import { SidenavMenuService } from '../../../..//services/sidenav-menu/sidenav-menu.service';
@Component({
selector: 'ov-participants-panel',
diff --git a/openvidu-components-angular/projects/openvidu-angular/src/lib/openvidu-angular.module.ts b/openvidu-components-angular/projects/openvidu-angular/src/lib/openvidu-angular.module.ts
index bf3cbf81..eb66179d 100644
--- a/openvidu-components-angular/projects/openvidu-angular/src/lib/openvidu-angular.module.ts
+++ b/openvidu-components-angular/projects/openvidu-angular/src/lib/openvidu-angular.module.ts
@@ -29,7 +29,7 @@ import { HttpClientModule } from '@angular/common/http';
import { UserSettingsComponent } from './components/user-settings/user-settings.component';
import { ToolbarComponent } from './components/toolbar/toolbar.component';
import { VideoComponent } from './components/video/video.component';
-import { ChatPanelComponent } from './components/chat-panel/chat-panel.component';
+import { ChatPanelComponent } from './components/panel/chat-panel/chat-panel.component';
import { SessionComponent } from './components/session/session.component';
import { LayoutComponent } from './components/layout/layout.component';
import { StreamComponent } from './components/stream/stream.component';
@@ -54,8 +54,8 @@ import { DocumentService } from './services/document/document.service';
import { LayoutService } from './services/layout/layout.service';
import { SidenavMenuService } from './services/sidenav-menu/sidenav-menu.service';
import { ParticipantService } from './services/participant/participant.service';
-import { ParticipantItemComponent } from './components/participants-panel/participant-item/participant-item.component';
-import { ParticipantsPanelComponent } from './components/participants-panel/participants-panel/participants-panel.component';
+import { ParticipantItemComponent } from './components/panel/participants-panel/participant-item/participant-item.component';
+import { ParticipantsPanelComponent } from './components/panel/participants-panel/participants-panel/participants-panel.component';
import { VideoconferenceComponent } from './components/videoconference/videoconference.component';
import { PanelComponent } from './components/panel/panel.component';
diff --git a/openvidu-components-angular/projects/openvidu-angular/src/public-api.ts b/openvidu-components-angular/projects/openvidu-angular/src/public-api.ts
index 143daa78..d7fef6a0 100644
--- a/openvidu-components-angular/projects/openvidu-angular/src/public-api.ts
+++ b/openvidu-components-angular/projects/openvidu-angular/src/public-api.ts
@@ -24,8 +24,8 @@ export * from './lib/services/storage/storage.service';
export * from './lib/components/videoconference/videoconference.component';
export * from './lib/components/user-settings/user-settings.component';
export * from './lib/components/toolbar/toolbar.component';
-export * from './lib/components/chat-panel/chat-panel.component';
-export * from './lib/components/participants-panel/participants-panel/participants-panel.component';
+export * from './lib/components/panel/chat-panel/chat-panel.component';
+export * from './lib/components/panel/participants-panel/participants-panel/participants-panel.component';
export * from './lib/components/session/session.component';
export * from './lib/components/layout/layout.component';
export * from './lib/components/stream/stream.component';
From 00087a7dc7503c5735093a84626a8eb742bc93cd Mon Sep 17 00:00:00 2001
From: csantosm <4a.santos@gmail.com>
Date: Thu, 3 Feb 2022 17:08:23 +0100
Subject: [PATCH 03/74] openvidu-components: Updated the dynamic components
injection
Allowed the custom components injection from the view instead of the config file.
---
.../components/layout/layout.component.html | 52 +++++------
.../lib/components/layout/layout.component.ts | 13 ++-
.../lib/components/panel/panel.component.html | 10 ++-
.../lib/components/panel/panel.component.ts | 34 ++++++--
.../components/session/session.component.html | 29 ++-----
.../components/session/session.component.ts | 6 +-
.../lib/components/stream/stream.component.ts | 7 +-
.../videoconference.component.html | 87 ++++++++++++++++---
.../videoconference.component.ts | 72 ++++++++-------
.../src/app/openvidu-call/call.component.html | 39 ++++++++-
.../src/app/openvidu-call/call.component.ts | 4 +-
11 files changed, 238 insertions(+), 115 deletions(-)
diff --git a/openvidu-components-angular/projects/openvidu-angular/src/lib/components/layout/layout.component.html b/openvidu-components-angular/projects/openvidu-angular/src/lib/components/layout/layout.component.html
index db8e1767..73a3a1f8 100644
--- a/openvidu-components-angular/projects/openvidu-angular/src/lib/components/layout/layout.component.html
+++ b/openvidu-components-angular/projects/openvidu-angular/src/lib/components/layout/layout.component.html
@@ -1,35 +1,23 @@
-
-
-
-
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
diff --git a/openvidu-components-angular/projects/openvidu-angular/src/lib/components/layout/layout.component.ts b/openvidu-components-angular/projects/openvidu-angular/src/lib/components/layout/layout.component.ts
index 86815573..abf429c1 100644
--- a/openvidu-components-angular/projects/openvidu-angular/src/lib/components/layout/layout.component.ts
+++ b/openvidu-components-angular/projects/openvidu-angular/src/lib/components/layout/layout.component.ts
@@ -1,4 +1,4 @@
-import { AfterViewInit, Component, ContentChild, OnDestroy, OnInit, TemplateRef } from '@angular/core';
+import { AfterViewInit, Component, ComponentRef, ContentChild, Directive, Input, OnDestroy, OnInit, TemplateRef, Type, ViewChild, ViewContainerRef } from '@angular/core';
import { Subscription } from 'rxjs';
import { ParticipantService } from '../../services/participant/participant.service';
import { ParticipantAbstractModel } from '../../models/participant.model';
@@ -10,8 +10,13 @@ import { LayoutService } from '../../services/layout/layout.service';
styleUrls: ['./layout.component.css']
})
export class LayoutComponent implements OnInit, OnDestroy, AfterViewInit {
- @ContentChild('customLocalParticipant', { read: TemplateRef }) customLocalParticipantTemplate: TemplateRef;
- @ContentChild('customRemoteParticipants', { read: TemplateRef }) customRemoteParticipantsTemplate: TemplateRef;
+ // @ContentChild('customLocalParticipant', { read: TemplateRef }) customLocalParticipantTemplate: TemplateRef;
+ // @ContentChild('customRemoteParticipants', { read: TemplateRef }) customRemoteParticipantsTemplate: TemplateRef;
+
+ @ContentChild('stream', { read: TemplateRef }) streamTemplate: TemplateRef;
+
+
+
localParticipant: ParticipantAbstractModel;
remoteParticipants: ParticipantAbstractModel[] = [];
@@ -22,6 +27,8 @@ export class LayoutComponent implements OnInit, OnDestroy, AfterViewInit {
constructor(protected layoutService: LayoutService, protected participantService: ParticipantService) {}
ngOnInit(): void {
+ this.layoutService.initialize();
+
this.subscribeToUsers();
}
diff --git a/openvidu-components-angular/projects/openvidu-angular/src/lib/components/panel/panel.component.html b/openvidu-components-angular/projects/openvidu-angular/src/lib/components/panel/panel.component.html
index 4d957c87..2016d3c9 100644
--- a/openvidu-components-angular/projects/openvidu-angular/src/lib/components/panel/panel.component.html
+++ b/openvidu-components-angular/projects/openvidu-angular/src/lib/components/panel/panel.component.html
@@ -1 +1,9 @@
-panel works!
+
+
+
+
+
+
+
+
+
diff --git a/openvidu-components-angular/projects/openvidu-angular/src/lib/components/panel/panel.component.ts b/openvidu-components-angular/projects/openvidu-angular/src/lib/components/panel/panel.component.ts
index aabdad27..f27ce24e 100644
--- a/openvidu-components-angular/projects/openvidu-angular/src/lib/components/panel/panel.component.ts
+++ b/openvidu-components-angular/projects/openvidu-angular/src/lib/components/panel/panel.component.ts
@@ -1,15 +1,35 @@
-import { Component, OnInit } from '@angular/core';
+import { Component, ContentChild, OnInit, TemplateRef } from '@angular/core';
+import { skip, Subscription } from 'rxjs';
+import { MenuType } from '../../models/menu.model';
+import { SidenavMenuService } from '../../services/sidenav-menu/sidenav-menu.service';
@Component({
- selector: 'ov-panel',
- templateUrl: './panel.component.html',
- styleUrls: ['./panel.component.css']
+ selector: 'ov-panel',
+ templateUrl: './panel.component.html',
+ styleUrls: ['./panel.component.css']
})
export class PanelComponent implements OnInit {
+ @ContentChild('participantsPanel', { read: TemplateRef }) participantsPanelTemplate: TemplateRef;
+ @ContentChild('chatPanel', { read: TemplateRef }) chatPanelTemplate: TemplateRef;
- constructor() { }
+ isParticipantsPanelOpened: boolean;
+ isChatPanelOpened: boolean;
+ menuSubscription: Subscription;
+ constructor(protected menuService: SidenavMenuService) {}
- ngOnInit(): void {
- }
+ ngOnInit(): void {
+ this.subscribeToPanelToggling();
+ }
+ subscribeToPanelToggling() {
+ this.menuSubscription = this.menuService.menuOpenedObs.pipe(skip(1)).subscribe((ev: { opened: boolean; type?: MenuType }) => {
+ this.isChatPanelOpened = ev.opened && ev.type === MenuType.CHAT;
+ this.isParticipantsPanelOpened = ev.opened && ev.type === MenuType.PARTICIPANTS;
+ });
+ }
+ ngOnDestroy() {
+ this.isChatPanelOpened = false;
+ this.isParticipantsPanelOpened = false;
+ if (this.menuSubscription) this.menuSubscription.unsubscribe();
+ }
}
diff --git a/openvidu-components-angular/projects/openvidu-angular/src/lib/components/session/session.component.html b/openvidu-components-angular/projects/openvidu-angular/src/lib/components/session/session.component.html
index 85367ff7..45758150 100644
--- a/openvidu-components-angular/projects/openvidu-angular/src/lib/components/session/session.component.html
+++ b/openvidu-components-angular/projects/openvidu-angular/src/lib/components/session/session.component.html
@@ -1,6 +1,5 @@
-
-
-
-
+
+
+
-
-
-
-
-
-
-
-
-
+
+
+
+
+
-
-
-
+