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 81de313a..da033354 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 @@ -3,6 +3,7 @@ import { Subscription } from 'rxjs'; import { ParticipantService } from '../../services/participant/participant.service'; import { ParticipantAbstractModel } from '../../models/participant.model'; import { LayoutService } from '../../services/layout/layout.service'; +import { StreamDirective } from '../../directives/openvidu-angular.directive'; @Component({ selector: 'ov-layout', @@ -12,6 +13,15 @@ import { LayoutService } from '../../services/layout/layout.service'; export class LayoutComponent implements OnInit, OnDestroy, AfterViewInit { @ContentChild('stream', { read: TemplateRef }) streamTemplate: TemplateRef; + @ContentChild(StreamDirective) + set externalStream (externalStream: StreamDirective) { + // This directive will has value only when STREAM component tagget with '*ovStream' directive + // is inside of the layout component tagged with '*ovLayout' directive + if(externalStream) { + this.streamTemplate = externalStream.template; + } + } + localParticipant: ParticipantAbstractModel; remoteParticipants: ParticipantAbstractModel[] = []; protected localParticipantSubs: Subscription; 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 cf561c12..74eb725a 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,6 +1,12 @@ - + + + + - + + + + 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 f27ce24e..cfa965bd 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,5 +1,6 @@ import { Component, ContentChild, OnInit, TemplateRef } from '@angular/core'; import { skip, Subscription } from 'rxjs'; +import { ChatPanelDirective, ParticipantsPanelDirective } from '../../directives/openvidu-angular.directive'; import { MenuType } from '../../models/menu.model'; import { SidenavMenuService } from '../../services/sidenav-menu/sidenav-menu.service'; @@ -12,6 +13,24 @@ export class PanelComponent implements OnInit { @ContentChild('participantsPanel', { read: TemplateRef }) participantsPanelTemplate: TemplateRef; @ContentChild('chatPanel', { read: TemplateRef }) chatPanelTemplate: TemplateRef; + @ContentChild(ParticipantsPanelDirective) + set externalParticipantPanel(externalParticipantsPanel: ParticipantsPanelDirective) { + // This directive will has value only when PARTICIPANTS PANEL component tagged with '*ovParticipantsPanel' + // is inside of the PANEL component tagged with '*ovPanel' + if (externalParticipantsPanel) { + this.participantsPanelTemplate = externalParticipantsPanel.template; + } + } + + @ContentChild(ChatPanelDirective) + set externalChatPanel(externalChatPanel: ChatPanelDirective) { + // This directive will has value only when CHAT PANEL component tagged with '*ovChatPanel' + // is inside of the PANEL component tagged with '*ovPanel' + if (externalChatPanel) { + this.chatPanelTemplate = externalChatPanel.template; + } + } + isParticipantsPanelOpened: boolean; isChatPanelOpened: boolean; menuSubscription: Subscription; diff --git a/openvidu-components-angular/projects/openvidu-angular/src/lib/components/panel/participants-panel/participant-panel-item/participant-panel-item.component.html b/openvidu-components-angular/projects/openvidu-angular/src/lib/components/panel/participants-panel/participant-panel-item/participant-panel-item.component.html index d76a303f..fdba655f 100644 --- a/openvidu-components-angular/projects/openvidu-angular/src/lib/components/panel/participants-panel/participant-panel-item/participant-panel-item.component.html +++ b/openvidu-components-angular/projects/openvidu-angular/src/lib/components/panel/participants-panel/participant-panel-item/participant-panel-item.component.html @@ -1,11 +1,10 @@ person -

{{ participant | nickname }}

-

{{ participant | streamsEnabled }}

+

{{ _participant | nickname }}

+

{{ _participant | streamsEnabled }}

-
\ No newline at end of file diff --git a/openvidu-components-angular/projects/openvidu-angular/src/lib/components/panel/participants-panel/participant-panel-item/participant-panel-item.component.ts b/openvidu-components-angular/projects/openvidu-angular/src/lib/components/panel/participants-panel/participant-panel-item/participant-panel-item.component.ts index 99f2973b..edd0b7ef 100644 --- a/openvidu-components-angular/projects/openvidu-angular/src/lib/components/panel/participants-panel/participant-panel-item/participant-panel-item.component.ts +++ b/openvidu-components-angular/projects/openvidu-angular/src/lib/components/panel/participants-panel/participant-panel-item/participant-panel-item.component.ts @@ -1,4 +1,4 @@ -import { Component, Input, OnInit } from '@angular/core'; +import { Component, Input } from '@angular/core'; import { ParticipantAbstractModel } from '../../../../models/participant.model'; @Component({ @@ -6,11 +6,13 @@ import { ParticipantAbstractModel } from '../../../../models/participant.model'; templateUrl: './participant-panel-item.component.html', styleUrls: ['./participant-panel-item.component.css'] }) -export class ParticipantPanelItemComponent implements OnInit { - @Input() participant: ParticipantAbstractModel; - @Input() showDividerLine: boolean; +export class ParticipantPanelItemComponent { + @Input() + set participant( p: ParticipantAbstractModel) { + this._participant = p; + } + _participant: ParticipantAbstractModel; constructor() {} - ngOnInit(): void {} } diff --git a/openvidu-components-angular/projects/openvidu-angular/src/lib/components/panel/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 index e2fefabd..3f0bc91e 100644 --- a/openvidu-components-angular/projects/openvidu-angular/src/lib/components/panel/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 @@ -9,18 +9,15 @@
- + +
- + +
+ +
diff --git a/openvidu-components-angular/projects/openvidu-angular/src/lib/components/panel/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 index 8de179af..65660d73 100644 --- a/openvidu-components-angular/projects/openvidu-angular/src/lib/components/panel/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,8 @@ -import { ChangeDetectorRef, Component, OnInit } from '@angular/core'; +import { ChangeDetectorRef, Component, ContentChild, OnInit, TemplateRef } 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 { ParticipantPanelItemDirective } from '../../../../directives/openvidu-angular.directive'; @Component({ selector: 'ov-participants-panel', @@ -11,8 +12,22 @@ import { SidenavMenuService } from '../../../..//services/sidenav-menu/sidenav-m export class ParticipantsPanelComponent implements OnInit { localParticipant: any; remoteParticipants: ParticipantAbstractModel[] = []; + @ContentChild('participantPanelItem', { read: TemplateRef }) participantPanelItemTemplate: TemplateRef; - constructor(protected participantService: ParticipantService, protected menuService: SidenavMenuService, private cd: ChangeDetectorRef) {} + @ContentChild(ParticipantPanelItemDirective) + set externalParticipantPanelItem(externalParticipantPanelItem: ParticipantPanelItemDirective) { + // This directive will has value only when PARTICIPANT PANEL ITEM component tagged with '*ovParticipantPanelItem' + // is inside of the PARTICIPANTS PANEL component tagged with '*ovParticipantsPanel' + if (externalParticipantPanelItem) { + this.participantPanelItemTemplate = externalParticipantPanelItem.template; + } + } + + constructor( + protected participantService: ParticipantService, + protected menuService: SidenavMenuService, + private cd: ChangeDetectorRef + ) {} ngOnInit(): void { this.participantService.localParticipantObs.subscribe((p: ParticipantModel) => { 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 46ca5801..16ed92b0 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 @@ -9,30 +9,17 @@ fixedTopGap="0" fixedBottomGap="0" > - - - - + - - -
- -
-
+
+ +
- diff --git a/openvidu-components-angular/projects/openvidu-angular/src/lib/components/session/session.component.ts b/openvidu-components-angular/projects/openvidu-angular/src/lib/components/session/session.component.ts index acd13dd5..638e2064 100644 --- a/openvidu-components-angular/projects/openvidu-angular/src/lib/components/session/session.component.ts +++ b/openvidu-components-angular/projects/openvidu-angular/src/lib/components/session/session.component.ts @@ -24,6 +24,8 @@ import { SidenavMenuService } from '../../services/sidenav-menu/sidenav-menu.ser styleUrls: ['./session.component.css'] }) export class SessionComponent implements OnInit, AfterViewInit { + @ContentChild('toolbar', { read: TemplateRef }) toolbarTemplate: TemplateRef; + @ContentChild('panel', { read: TemplateRef }) panelTemplate: TemplateRef; @ContentChild('layout', { read: TemplateRef }) layoutTemplate: TemplateRef; @Input() tokens: { webcam: string; screen: string }; diff --git a/openvidu-components-angular/projects/openvidu-angular/src/lib/components/videoconference/videoconference.component.html b/openvidu-components-angular/projects/openvidu-angular/src/lib/components/videoconference/videoconference.component.html index fef79f95..2e0e1a9e 100644 --- a/openvidu-components-angular/projects/openvidu-angular/src/lib/components/videoconference/videoconference.component.html +++ b/openvidu-components-angular/projects/openvidu-angular/src/lib/components/videoconference/videoconference.component.html @@ -15,54 +15,69 @@
- + + + + + - - - - - - - - - - - - - - - - - - - - - - - - + + + + + - - - - - - - - - - - - - - - - - - - + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/openvidu-components-angular/projects/openvidu-angular/src/lib/components/videoconference/videoconference.component.ts b/openvidu-components-angular/projects/openvidu-angular/src/lib/components/videoconference/videoconference.component.ts index 984b21c5..94162392 100644 --- a/openvidu-components-angular/projects/openvidu-angular/src/lib/components/videoconference/videoconference.component.ts +++ b/openvidu-components-angular/projects/openvidu-angular/src/lib/components/videoconference/videoconference.component.ts @@ -1,20 +1,47 @@ -import { Component, ContentChild, EventEmitter, Input, OnInit, Output, TemplateRef, ViewChild } from '@angular/core'; -import { StreamDirective } from '../../directives/stream/stream.directive'; +import { AfterViewInit, Component, ContentChild, EventEmitter, Input, OnInit, Output, TemplateRef, ViewChild } from '@angular/core'; +import { + ChatPanelDirective, + LayoutDirective, + PanelDirective, + ParticipantPanelItemDirective, + ParticipantsPanelDirective, + StreamDirective, + ToolbarDirective +} from '../../directives/openvidu-angular.directive'; +import { ILogger } from '../../models/logger.model'; +import { LoggerService } from '../../services/logger/logger.service'; @Component({ selector: 'ov-videoconference', templateUrl: './videoconference.component.html', styleUrls: ['./videoconference.component.css'] }) -export class VideoconferenceComponent implements OnInit { - streamTemplate: TemplateRef; +export class VideoconferenceComponent implements OnInit, AfterViewInit { + //Toolbar + @ContentChild(ToolbarDirective) externalToolbar: ToolbarDirective; + // Panels + @ContentChild(PanelDirective) externalPanel: PanelDirective; + @ContentChild(ChatPanelDirective) externalChatPanel: ChatPanelDirective; + @ContentChild(ParticipantsPanelDirective) externalParticipantsPanel: ParticipantsPanelDirective; + @ContentChild(ParticipantPanelItemDirective) externalParticipantPanelItem: ParticipantPanelItemDirective; + @ContentChild(LayoutDirective) externalLayout: LayoutDirective; + @ContentChild(StreamDirective) externalStream: StreamDirective; - @ContentChild(StreamDirective) - set customStream(customStream: StreamDirective) { - if (customStream) { - this.streamTemplate = customStream.template; - } - } + @ViewChild('defaultToolbar', { static: false, read: TemplateRef }) defaultToolbarTemplate: TemplateRef; + @ViewChild('defaultPanel', { static: false, read: TemplateRef }) defaultPanelTemplate: TemplateRef; + @ViewChild('defaultChatPanel', { static: false, read: TemplateRef }) defaultChatPanelTemplate: TemplateRef; + @ViewChild('defaultParticipantsPanel', { static: false, read: TemplateRef }) defaultParticipantsPanelTemplate: TemplateRef; + @ViewChild('defaultParticipantPanelItem', { static: false, read: TemplateRef }) defaultParticipantPanelItemTemplate: TemplateRef; + @ViewChild('defaultLayout', { static: false, read: TemplateRef }) defaultLayoutTemplate: TemplateRef; + @ViewChild('defaultStream', { static: false, read: TemplateRef }) defaultStreamTemplate: TemplateRef; + + openviduAngularToolbarTemplate: TemplateRef; + openviduAngularPanelTemplate: TemplateRef; + openviduAngularChatPanelTemplate: TemplateRef; + openviduAngularParticipantsPanelTemplate: TemplateRef; + openviduAngularParticipantPanelItemTemplate: TemplateRef; + openviduAngularLayoutTemplate: TemplateRef; + openviduAngularStreamTemplate: TemplateRef; @Input() sessionName: string; @Input() userName: string; @@ -24,7 +51,7 @@ export class VideoconferenceComponent implements OnInit { if (!tokens || (!tokens.webcam && !tokens.screen)) { //No tokens received // throw new Error('No tokens received'); - console.warn('No tokens received'); + this.log.w('No tokens received'); } else { if (tokens.webcam || tokens.screen) { this._tokens = { @@ -37,9 +64,6 @@ export class VideoconferenceComponent implements OnInit { } } - // @Input() openviduServerUrl: string; - // @Input() openviduSecret: string; - @Output() onJoinClicked = new EventEmitter(); @Output() onCloseClicked = new EventEmitter(); @@ -50,7 +74,68 @@ export class VideoconferenceComponent implements OnInit { error: boolean = false; errorMessage: string = ''; - constructor() {} + private log: ILogger; + + constructor(private loggerSrv: LoggerService) { + this.log = this.loggerSrv.get('VideoconferenceComponent'); + } + + ngAfterViewInit() { + if (this.externalToolbar) { + this.openviduAngularToolbarTemplate = this.externalToolbar.template; + this.log.d('Setting EXTERNAL TOOLBAR'); + } else { + this.openviduAngularToolbarTemplate = this.defaultToolbarTemplate; + this.log.d('Setting DEFAULT TOOLBAR'); + } + + if (this.externalPanel) { + this.openviduAngularPanelTemplate = this.externalPanel.template; + this.log.d('Setting EXTERNAL PANEL'); + } else { + this.log.d('Setting DEFAULT PANEL'); + + if (this.externalParticipantsPanel) { + this.openviduAngularParticipantsPanelTemplate = this.externalParticipantsPanel.template; + this.log.d('Setting EXTERNAL PARTICIPANTS PANEL'); + } else { + this.log.d('Setting DEFAULT PARTICIPANTS PANEL'); + if (this.externalParticipantPanelItem) { + this.openviduAngularParticipantPanelItemTemplate = this.externalParticipantPanelItem.template; + this.log.d('Setting EXTERNAL P ITEM'); + } else { + this.openviduAngularParticipantPanelItemTemplate = this.defaultParticipantPanelItemTemplate; + this.log.d('Setting DEFAULT P ITEM'); + } + this.openviduAngularParticipantsPanelTemplate = this.defaultParticipantsPanelTemplate; + } + + if (this.externalChatPanel) { + this.openviduAngularChatPanelTemplate = this.externalChatPanel.template; + this.log.d('Setting EXTERNAL CHAT PANEL'); + } else { + this.openviduAngularChatPanelTemplate = this.defaultChatPanelTemplate; + this.log.d('Setting DEFAULT CHAT PANEL'); + } + this.openviduAngularPanelTemplate = this.defaultPanelTemplate; + } + + if (this.externalLayout) { + this.openviduAngularLayoutTemplate = this.externalLayout.template; + this.log.d('Setting EXTERNAL LAYOUT'); + } else { + this.log.d('Setting DEAFULT LAYOUT'); + + if (this.externalStream) { + this.openviduAngularStreamTemplate = this.externalStream.template; + this.log.d('Setting EXTERNAL STREAM'); + } else { + this.openviduAngularStreamTemplate = this.defaultStreamTemplate; + this.log.d('Setting DEFAULT STREAM'); + } + this.openviduAngularLayoutTemplate = this.defaultLayoutTemplate; + } + } ngOnInit() {} @@ -61,12 +146,4 @@ export class VideoconferenceComponent implements OnInit { this.isSessionAlive = false; this.closeClicked = true; } - - onMicClicked() {} - - onCamClicked() {} - - onScreenShareClicked() {} - - onSpeakerLayoutClicked() {} } diff --git a/openvidu-components-angular/projects/openvidu-angular/src/lib/directives/openvidu-angular.directive.spec.ts b/openvidu-components-angular/projects/openvidu-angular/src/lib/directives/openvidu-angular.directive.spec.ts new file mode 100644 index 00000000..c946870a --- /dev/null +++ b/openvidu-components-angular/projects/openvidu-angular/src/lib/directives/openvidu-angular.directive.spec.ts @@ -0,0 +1,8 @@ +import { OpenviduAngularDirective } from './openvidu-angular.directive'; + +describe('OpenviduAngularDirective', () => { + it('should create an instance', () => { + const directive = new OpenviduAngularDirective(); + expect(directive).toBeTruthy(); + }); +}); diff --git a/openvidu-components-angular/projects/openvidu-angular/src/lib/directives/openvidu-angular.directive.ts b/openvidu-components-angular/projects/openvidu-angular/src/lib/directives/openvidu-angular.directive.ts new file mode 100644 index 00000000..f8c8e321 --- /dev/null +++ b/openvidu-components-angular/projects/openvidu-angular/src/lib/directives/openvidu-angular.directive.ts @@ -0,0 +1,50 @@ +import { Directive, TemplateRef, ViewContainerRef } from '@angular/core'; + +@Directive({ + selector: '[ovToolbar]' +}) +export class ToolbarDirective { + constructor(public template: TemplateRef, public viewContainer: ViewContainerRef) {} +} + +@Directive({ + selector: '[ovPanel]' +}) +export class PanelDirective { + constructor(public template: TemplateRef, public viewContainer: ViewContainerRef) {} +} + +@Directive({ + selector: '[ovChatPanel]' +}) +export class ChatPanelDirective { + constructor(public template: TemplateRef, public viewContainer: ViewContainerRef) {} +} + +@Directive({ + selector: '[ovParticipantsPanel]' +}) +export class ParticipantsPanelDirective { + constructor(public template: TemplateRef, public viewContainer: ViewContainerRef) {} +} + +@Directive({ + selector: '[ovParticipantPanelItem]' +}) +export class ParticipantPanelItemDirective { + constructor(public template: TemplateRef, public viewContainer: ViewContainerRef) {} +} + +@Directive({ + selector: '[ovLayout]' +}) +export class LayoutDirective { + constructor(public template: TemplateRef, public container: ViewContainerRef) {} +} + +@Directive({ + selector: '[ovStream]' +}) +export class StreamDirective { + constructor(public template: TemplateRef, public container: ViewContainerRef) {} +} diff --git a/openvidu-components-angular/projects/openvidu-angular/src/lib/directives/stream/stream.directive.spec.ts b/openvidu-components-angular/projects/openvidu-angular/src/lib/directives/stream/stream.directive.spec.ts deleted file mode 100644 index 8908b61a..00000000 --- a/openvidu-components-angular/projects/openvidu-angular/src/lib/directives/stream/stream.directive.spec.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { StreamDirective } from './stream.directive'; - -describe('StreamDirective', () => { - it('should create an instance', () => { - const directive = new StreamDirective(); - expect(directive).toBeTruthy(); - }); -}); diff --git a/openvidu-components-angular/projects/openvidu-angular/src/lib/directives/stream/stream.directive.ts b/openvidu-components-angular/projects/openvidu-angular/src/lib/directives/stream/stream.directive.ts deleted file mode 100644 index 432e66af..00000000 --- a/openvidu-components-angular/projects/openvidu-angular/src/lib/directives/stream/stream.directive.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { Directive, OnInit, TemplateRef, ViewContainerRef } from '@angular/core'; - -@Directive({ - selector: '[ovStream]' -}) -export class StreamDirective implements OnInit { - constructor(public template: TemplateRef, public container: ViewContainerRef) {} - - ngOnInit() {} -} 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 b7e97453..0fe4ef35 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 @@ -36,7 +36,6 @@ import { StreamComponent } from './components/stream/stream.component'; import { DialogTemplateComponent } from './components/material/dialog.component'; import { LinkifyPipe } from './pipes/linkify.pipe'; -import { TooltipListPipe } from './pipes/tooltip-list.pipe'; import { StreamsEnabledPipe, NicknamePipe, ParticipantStreamsPipe } from './pipes/participant.pipe'; import { OpenViduAngularConfig } from './config/openvidu-angular.config'; @@ -58,12 +57,12 @@ import { ParticipantPanelItemComponent } from './components/panel/participants-p 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'; -import { StreamDirective } from './directives/stream/stream.directive'; import { AudioWaveComponent } from './components/audio-wave/audio-wave.component'; +import { ChatPanelDirective, LayoutDirective, PanelDirective, ParticipantPanelItemDirective, ParticipantsPanelDirective, StreamDirective, ToolbarDirective } from './directives/openvidu-angular.directive'; + @NgModule({ declarations: [ - StreamDirective, UserSettingsComponent, VideoComponent, ToolbarComponent, @@ -73,7 +72,6 @@ import { AudioWaveComponent } from './components/audio-wave/audio-wave.component StreamComponent, DialogTemplateComponent, LinkifyPipe, - TooltipListPipe, ParticipantStreamsPipe, StreamsEnabledPipe, NicknamePipe, @@ -82,6 +80,13 @@ import { AudioWaveComponent } from './components/audio-wave/audio-wave.component VideoconferenceComponent, AudioWaveComponent, PanelComponent, + ToolbarDirective, + PanelDirective, + ChatPanelDirective, + ParticipantsPanelDirective, + ParticipantPanelItemDirective, + LayoutDirective, + StreamDirective ], imports: [ CommonModule, @@ -130,6 +135,9 @@ import { AudioWaveComponent } from './components/audio-wave/audio-wave.component VideoconferenceComponent, UserSettingsComponent, ToolbarComponent, + PanelComponent, + ParticipantsPanelComponent, + ParticipantPanelItemComponent, ChatPanelComponent, SessionComponent, LayoutComponent, @@ -137,7 +145,15 @@ import { AudioWaveComponent } from './components/audio-wave/audio-wave.component VideoComponent, AudioWaveComponent, ParticipantStreamsPipe, + StreamsEnabledPipe, + NicknamePipe, CommonModule, + ToolbarDirective, + PanelDirective, + ChatPanelDirective, + ParticipantsPanelDirective, + ParticipantPanelItemDirective, + LayoutDirective, StreamDirective ], entryComponents: [DialogTemplateComponent] diff --git a/openvidu-components-angular/projects/openvidu-angular/src/lib/pipes/participant.pipe.ts b/openvidu-components-angular/projects/openvidu-angular/src/lib/pipes/participant.pipe.ts index 32c42364..80634a19 100644 --- a/openvidu-components-angular/projects/openvidu-angular/src/lib/pipes/participant.pipe.ts +++ b/openvidu-components-angular/projects/openvidu-angular/src/lib/pipes/participant.pipe.ts @@ -23,7 +23,7 @@ export class StreamsEnabledPipe implements PipeTransform { constructor() {} transform(participant: ParticipantAbstractModel): string { - return `(${participant.getConnectionTypesEnabled().toString().replace(',', ', ')})`; + return `(${participant?.getConnectionTypesEnabled().toString().replace(',', ', ')})`; } } @@ -31,6 +31,6 @@ export class StreamsEnabledPipe implements PipeTransform { export class NicknamePipe implements PipeTransform { constructor() {} transform(participant: ParticipantAbstractModel): string { - return participant.getCameraNickname(); + return participant?.getCameraNickname(); } } diff --git a/openvidu-components-angular/projects/openvidu-angular/src/lib/pipes/settings.pipe.ts b/openvidu-components-angular/projects/openvidu-angular/src/lib/pipes/settings.pipe.ts deleted file mode 100644 index 78045472..00000000 --- a/openvidu-components-angular/projects/openvidu-angular/src/lib/pipes/settings.pipe.ts +++ /dev/null @@ -1,82 +0,0 @@ -// import { Pipe, PipeTransform } from '@angular/core'; -// import { SettingsModel } from '../models/settings.model'; - -// @Pipe({ name: 'hasChat', pure: true }) -// export class HasChatPipe implements PipeTransform { -// constructor() {} -// transform(ovSettings: SettingsModel): boolean { -// return !ovSettings || ovSettings.hasChat(); -// } -// } - -// @Pipe({ name: 'hasAudio', pure: true }) -// export class HasAudioPipe implements PipeTransform { -// constructor() {} -// transform(ovSettings: SettingsModel): boolean { -// return !ovSettings || ovSettings.hasAudio(); -// } -// } - -// @Pipe({ name: 'hasVideo', pure: true }) -// export class HasVideoPipe implements PipeTransform { -// constructor() {} -// transform(ovSettings: SettingsModel): boolean { -// return !ovSettings || ovSettings.hasVideo(); -// } -// } - -// @Pipe({ name: 'isAutoPublish', pure: true }) -// export class IsAutoPublishPipe implements PipeTransform { -// constructor() {} -// transform(ovSettings: SettingsModel): boolean { -// return !ovSettings || ovSettings.isAutoPublish(); -// } -// } - -// @Pipe({ name: 'hasScreenSharing', pure: true }) -// export class HasScreenSharingPipe implements PipeTransform { -// constructor() {} -// transform(ovSettings: SettingsModel): boolean { -// return !ovSettings || ovSettings.hasScreenSharing(); -// } -// } - -// @Pipe({ name: 'hasFullscreen', pure: true }) -// export class HasFullscreenPipe implements PipeTransform { -// constructor() {} -// transform(ovSettings: SettingsModel): boolean { -// return !ovSettings || ovSettings.hasFullscreen(); -// } -// } - -// @Pipe({ name: 'hasLayoutSpeaking', pure: true }) -// export class HasLayoutSpeakingPipe implements PipeTransform { -// constructor() {} -// transform(ovSettings: SettingsModel): boolean { -// return !ovSettings || ovSettings.hasLayoutSpeaking(); -// } -// } - -// @Pipe({ name: 'hasExit', pure: true }) -// export class HasExitPipe implements PipeTransform { -// constructor() {} -// transform(ovSettings: SettingsModel): boolean { -// return !ovSettings || ovSettings.hasExit(); -// } -// } - -// @Pipe({ name: 'hasToolbar', pure: true }) -// export class HasToolbarPipe implements PipeTransform { -// constructor() {} -// transform(ovSettings: SettingsModel): boolean { -// return !ovSettings || ovSettings.hasToolbar(); -// } -// } - -// @Pipe({ name: 'hasFooter', pure: true }) -// export class HasFooterPipe implements PipeTransform { -// constructor() {} -// transform(ovSettings: SettingsModel): boolean { -// return !ovSettings || ovSettings.hasFooter(); -// } -// } diff --git a/openvidu-components-angular/projects/openvidu-angular/src/lib/pipes/tooltip-list.pipe.ts b/openvidu-components-angular/projects/openvidu-angular/src/lib/pipes/tooltip-list.pipe.ts deleted file mode 100644 index b81fda80..00000000 --- a/openvidu-components-angular/projects/openvidu-angular/src/lib/pipes/tooltip-list.pipe.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { Pipe, PipeTransform } from '@angular/core'; - -@Pipe({ name: 'tooltipList', pure: true }) -export class TooltipListPipe implements PipeTransform { - transform(lines: string[]): string { - let list = ''; - lines.forEach((line) => { - list += '• ' + line + '\n'; - }); - - return list; - } -} 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 d6ac2a26..ca1bc888 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,10 @@ 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/panel/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/panel/participants-panel/participant-panel-item/participant-panel-item.component'; export * from './lib/components/session/session.component'; export * from './lib/components/layout/layout.component'; export * from './lib/components/stream/stream.component'; @@ -43,4 +45,4 @@ export * from './lib/models/notification-options.model'; export * from './lib/pipes/participant.pipe'; // Directives -export * from './lib/directives/stream/stream.directive'; \ No newline at end of file +export * from './lib/directives/openvidu-angular.directive'; \ No newline at end of file