forked from OpenVidu/openvidu
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/OpenVidu/openvidu into fe…
…ature/custom-ice-servers
- Loading branch information
Showing
36 changed files
with
464 additions
and
171 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 19 additions & 32 deletions
51
...ponents-angular/projects/openvidu-angular/src/lib/components/layout/layout.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,22 @@ | ||
<div id="layout" class="bounds"> | ||
<!-- Custom local participant --> | ||
<ng-container *ngIf="customLocalParticipantTemplate; else defaultLocalParticipant"> | ||
<ng-container *ngTemplateOutlet="customLocalParticipantTemplate"></ng-container> | ||
</ng-container> | ||
<div | ||
class="OT_root OT_publisher" | ||
id="localUser" | ||
*ngFor="let connection of localParticipant | connections" | ||
[ngClass]="{ OV_small: !connection.streamManager?.stream?.videoActive }" | ||
> | ||
<ng-template #localStream [ngComponentOutlet]="_localStreamComponent" [ndcDynamicInputs]="{ participant: connection }"> | ||
</ng-template> | ||
</div> | ||
|
||
<!-- Default local participant if custom participant is not injected --> | ||
<ng-template #defaultLocalParticipant> | ||
<div | ||
class="OT_root OT_publisher" | ||
id="localUser" | ||
*ngFor="let connection of localParticipant | connections" | ||
[ngClass]="{ OV_small: !connection.streamManager?.stream?.videoActive }" | ||
> | ||
<ov-stream [participant]="connection" [videoEnlarged]="connection.videoEnlarged"></ov-stream> | ||
</div> | ||
</ng-template> | ||
|
||
<!-- Custom remote participant --> | ||
<ng-container *ngIf="customRemoteParticipantsTemplate; else defaultRemoteParticipants"> | ||
<ng-container *ngTemplateOutlet="customRemoteParticipantsTemplate"></ng-container> | ||
</ng-container> | ||
|
||
<!-- Default remote participants if custom participants is not injected --> | ||
<ng-template #defaultRemoteParticipants> | ||
<div | ||
*ngFor="let connection of remoteParticipants | connections" | ||
class="OT_root OT_publisher" | ||
id="remote-participant" | ||
[ngClass]="{ OV_small: !connection.streamManager?.stream?.videoActive }" | ||
> | ||
<ov-stream [participant]="connection" [videoEnlarged]="connection.videoEnlarged"></ov-stream> | ||
</div> | ||
</ng-template> | ||
<div | ||
*ngFor="let connection of remoteParticipants | connections" | ||
class="OT_root OT_publisher" | ||
id="remote-participant" | ||
[ngClass]="{ OV_small: !connection.streamManager?.stream?.videoActive }" | ||
> | ||
<!-- Dynamic ov-stream component injected --> | ||
<ng-template #remoteStream [ngComponentOutlet]="_remoteStreamComponent" [ndcDynamicInputs]="{ participant: connection }"> | ||
</ng-template> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions
4
...s/chat-panel/chat-panel.component.spec.ts → ...l/chat-panel/chat-panel.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions
8
...onents/chat-panel/chat-panel.component.ts → .../panel/chat-panel/chat-panel.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
5 changes: 5 additions & 0 deletions
5
...omponents-angular/projects/openvidu-angular/src/lib/components/panel/panel.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
|
||
|
||
<ng-container *ngIf="isChatPanelOpened" #chat></ng-container> | ||
|
||
<ng-container *ngIf="isParticipantsPanelOpened" #participants></ng-container> |
25 changes: 25 additions & 0 deletions
25
...onents-angular/projects/openvidu-angular/src/lib/components/panel/panel.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { PanelComponent } from './panel.component'; | ||
|
||
describe('PanelComponent', () => { | ||
let component: PanelComponent; | ||
let fixture: ComponentFixture<PanelComponent>; | ||
|
||
beforeEach(async () => { | ||
await TestBed.configureTestingModule({ | ||
declarations: [ PanelComponent ] | ||
}) | ||
.compileComponents(); | ||
}); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(PanelComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
57 changes: 57 additions & 0 deletions
57
...-components-angular/projects/openvidu-angular/src/lib/components/panel/panel.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
import { Component, OnDestroy, OnInit, ViewChild, ViewContainerRef } from '@angular/core'; | ||
import { skip, Subscription } from 'rxjs'; | ||
import { LibraryComponents } from '../../config/lib.config'; | ||
import { MenuType } from '../../models/menu.model'; | ||
import { LibraryConfigService } from '../../services/library-config/library-config.service'; | ||
import { SidenavMenuService } from '../../services/sidenav-menu/sidenav-menu.service'; | ||
|
||
@Component({ | ||
selector: 'ov-panel', | ||
templateUrl: './panel.component.html', | ||
styleUrls: ['./panel.component.css'] | ||
}) | ||
export class PanelComponent implements OnInit, OnDestroy { | ||
isParticipantsPanelOpened: boolean; | ||
isChatPanelOpened: boolean; | ||
menuSubscription: Subscription; | ||
|
||
@ViewChild('chat', { static: false, read: ViewContainerRef }) | ||
set chat(reference: ViewContainerRef) { | ||
setTimeout(() => { | ||
if (reference) { | ||
const component = this.libraryConfigSrv.getDynamicComponent(LibraryComponents.CHAT_PANEL); | ||
reference.clear(); | ||
reference.createComponent(component); | ||
} | ||
}, 0); | ||
} | ||
|
||
@ViewChild('participants', { static: false, read: ViewContainerRef }) | ||
set participants(reference: ViewContainerRef) { | ||
setTimeout(() => { | ||
if (reference) { | ||
const component = this.libraryConfigSrv.getDynamicComponent(LibraryComponents.PARTICIPANTS_PANEL); | ||
reference.clear(); | ||
reference.createComponent(component); | ||
} | ||
}, 0); | ||
} | ||
|
||
constructor(protected libraryConfigSrv: LibraryConfigService, protected menuService: SidenavMenuService) {} | ||
|
||
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(); | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions
6
...nts-panel/participants-panel.component.ts → ...nts-panel/participants-panel.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.