mirror of https://github.com/OpenVidu/openvidu.git
openvidu-components: Added component events
parent
a3d5a9c98f
commit
e11af2ebd7
|
@ -19,7 +19,7 @@ import { StorageService } from '../../services/storage/storage.service';
|
||||||
styleUrls: ['./pre-join.component.css']
|
styleUrls: ['./pre-join.component.css']
|
||||||
})
|
})
|
||||||
export class PreJoinComponent implements OnInit, OnDestroy {
|
export class PreJoinComponent implements OnInit, OnDestroy {
|
||||||
@Output() onJoinClicked = new EventEmitter<any>();
|
@Output() onJoinButtonClicked = new EventEmitter<any>();
|
||||||
cameras: CustomDevice[];
|
cameras: CustomDevice[];
|
||||||
microphones: CustomDevice[];
|
microphones: CustomDevice[];
|
||||||
cameraSelected: CustomDevice;
|
cameraSelected: CustomDevice;
|
||||||
|
@ -207,7 +207,7 @@ export class PreJoinComponent implements OnInit, OnDestroy {
|
||||||
}
|
}
|
||||||
|
|
||||||
joinSession() {
|
joinSession() {
|
||||||
this.onJoinClicked.emit();
|
this.onJoinButtonClicked.emit();
|
||||||
}
|
}
|
||||||
|
|
||||||
private setDevicesInfo() {
|
private setDevicesInfo() {
|
||||||
|
|
|
@ -69,7 +69,7 @@
|
||||||
mat-icon-button
|
mat-icon-button
|
||||||
*ngIf="!isMinimal && showParticipantsPanelButton"
|
*ngIf="!isMinimal && showParticipantsPanelButton"
|
||||||
matTooltip="Show articipants"
|
matTooltip="Show articipants"
|
||||||
(click)="toggleMenu('participants')"
|
(click)="toggleParticipantsPanel()"
|
||||||
[disabled]="isConnectionLost"
|
[disabled]="isConnectionLost"
|
||||||
[class.active-btn]="isParticipantsOpened"
|
[class.active-btn]="isParticipantsOpened"
|
||||||
>
|
>
|
||||||
|
@ -80,7 +80,7 @@
|
||||||
<button
|
<button
|
||||||
mat-icon-button
|
mat-icon-button
|
||||||
*ngIf="!isMinimal && showChatPanelButton"
|
*ngIf="!isMinimal && showChatPanelButton"
|
||||||
(click)="toggleMenu('chat')"
|
(click)="toggleChatPanel()"
|
||||||
[disabled]="isConnectionLost"
|
[disabled]="isConnectionLost"
|
||||||
[class.active-btn]="isChatOpened"
|
[class.active-btn]="isChatOpened"
|
||||||
>
|
>
|
||||||
|
|
|
@ -36,12 +36,13 @@ import { OpenViduAngularConfigService } from '../../services/config/openvidu-ang
|
||||||
})
|
})
|
||||||
export class ToolbarComponent implements OnInit, OnDestroy {
|
export class ToolbarComponent implements OnInit, OnDestroy {
|
||||||
@ContentChild('centeredButtons', { read: TemplateRef }) centeredButtonsTemplate: TemplateRef<any>;
|
@ContentChild('centeredButtons', { read: TemplateRef }) centeredButtonsTemplate: TemplateRef<any>;
|
||||||
|
@Output() onLeaveButtonClicked = new EventEmitter<any>();
|
||||||
@Output() onMicClicked = new EventEmitter<any>();
|
@Output() onCameraButtonClicked = new EventEmitter<any>();
|
||||||
@Output() onCamClicked = new EventEmitter<any>();
|
@Output() onMicrophoneButtonClicked = new EventEmitter<any>();
|
||||||
@Output() onScreenShareClicked = new EventEmitter<any>();
|
@Output() onFullscreenButtonClicked = new EventEmitter<any>();
|
||||||
@Output() onLeaveSessionClicked = new EventEmitter<any>();
|
@Output() onScreenshareButtonClicked = new EventEmitter<any>();
|
||||||
@Output() onChatClicked = new EventEmitter<any>();
|
@Output() onParticipantsPanelButtonClicked = new EventEmitter<any>();
|
||||||
|
@Output() onChatPanelButtonClicked = new EventEmitter<any>();
|
||||||
|
|
||||||
session: Session;
|
session: Session;
|
||||||
unreadMessages: number = 0;
|
unreadMessages: number = 0;
|
||||||
|
@ -142,7 +143,7 @@ export class ToolbarComponent implements OnInit, OnDestroy {
|
||||||
}
|
}
|
||||||
|
|
||||||
toggleMicrophone() {
|
toggleMicrophone() {
|
||||||
this.onMicClicked.emit();
|
this.onMicrophoneButtonClicked.emit();
|
||||||
|
|
||||||
if (this.participantService.isMyCameraActive()) {
|
if (this.participantService.isMyCameraActive()) {
|
||||||
this.openviduService.publishAudio(
|
this.openviduService.publishAudio(
|
||||||
|
@ -155,7 +156,7 @@ export class ToolbarComponent implements OnInit, OnDestroy {
|
||||||
}
|
}
|
||||||
|
|
||||||
async toggleCamera() {
|
async toggleCamera() {
|
||||||
this.onCamClicked.emit();
|
this.onCameraButtonClicked.emit();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const publishVideo = !this.participantService.hasCameraVideoActive();
|
const publishVideo = !this.participantService.hasCameraVideoActive();
|
||||||
|
@ -189,7 +190,7 @@ export class ToolbarComponent implements OnInit, OnDestroy {
|
||||||
}
|
}
|
||||||
|
|
||||||
async toggleScreenShare() {
|
async toggleScreenShare() {
|
||||||
this.onScreenShareClicked.emit();
|
this.onScreenshareButtonClicked.emit();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// Disabling screenShare
|
// Disabling screenShare
|
||||||
|
@ -268,17 +269,23 @@ export class ToolbarComponent implements OnInit, OnDestroy {
|
||||||
leaveSession() {
|
leaveSession() {
|
||||||
this.log.d('Leaving session...');
|
this.log.d('Leaving session...');
|
||||||
this.openviduService.disconnect();
|
this.openviduService.disconnect();
|
||||||
this.onLeaveSessionClicked.emit();
|
this.onLeaveButtonClicked.emit();
|
||||||
}
|
}
|
||||||
|
|
||||||
toggleMenu(type: string) {
|
toggleParticipantsPanel() {
|
||||||
this.menuService.toggleMenu(<MenuType>type);
|
this.onParticipantsPanelButtonClicked.emit();
|
||||||
this.onChatClicked.emit();
|
this.menuService.toggleMenu(MenuType.PARTICIPANTS);
|
||||||
|
}
|
||||||
|
|
||||||
|
toggleChatPanel() {
|
||||||
|
this.onChatPanelButtonClicked.emit();
|
||||||
|
this.menuService.toggleMenu(MenuType.CHAT);
|
||||||
}
|
}
|
||||||
|
|
||||||
toggleFullscreen() {
|
toggleFullscreen() {
|
||||||
this.isFullscreenActive = !this.isFullscreenActive;
|
this.isFullscreenActive = !this.isFullscreenActive;
|
||||||
this.documentService.toggleFullscreen('session-container');
|
this.documentService.toggleFullscreen('session-container');
|
||||||
|
this.onFullscreenButtonClicked.emit();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected subscribeToReconnection() {
|
protected subscribeToReconnection() {
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
<div id="call-container">
|
<div id="call-container">
|
||||||
<div id="pre-join-container" *ngIf="!joinSessionClicked">
|
<div id="pre-join-container" *ngIf="!joinSessionClicked">
|
||||||
<ov-pre-join (onJoinClicked)="_onJoinClicked()"></ov-pre-join>
|
<ov-pre-join (onJoinButtonClicked)="_onJoinButtonClicked()"></ov-pre-join>
|
||||||
<!-- <ov-user-settings (onJoinClicked)="_onJoinClicked()" (onCloseClicked)="onLeaveSessionClicked()"></ov-user-settings> -->
|
<!-- <ov-user-settings (onJoinClicked)="_onJoinClicked()" (onCloseClicked)="onLeaveSessionClicked()"></ov-user-settings> -->
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="spinner" *ngIf="joinSessionClicked && !isSessionAlive && !error">
|
<div id="spinner" *ngIf="joinSessionClicked && !isSessionAlive && !error">
|
||||||
|
@ -39,7 +38,15 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<ng-template #defaultToolbar>
|
<ng-template #defaultToolbar>
|
||||||
<ov-toolbar></ov-toolbar>
|
<ov-toolbar
|
||||||
|
(onLeaveButtonClicked)="onLeaveButtonClicked()"
|
||||||
|
(onCameraButtonClicked)="onCameraButtonClicked()"
|
||||||
|
(onMicrophoneButtonClicked)="onMicrophoneButtonClicked()"
|
||||||
|
(onScreenshareButtonClicked)="onScreenshareButtonClicked()"
|
||||||
|
(onFullscreenButtonClicked)="onFullscreenButtonClicked()"
|
||||||
|
(onParticipantsPanelButtonClicked)="onParticipantsPanelButtonClicked()"
|
||||||
|
(onChatPanelButtonClicked)="onChatPanelButtonClicked()"
|
||||||
|
></ov-toolbar>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
|
|
||||||
<ng-template #defaultPanel>
|
<ng-template #defaultPanel>
|
||||||
|
|
|
@ -70,19 +70,26 @@ export class VideoconferenceComponent implements OnInit, AfterViewInit {
|
||||||
// *** Events ***
|
// *** Events ***
|
||||||
|
|
||||||
// Event sent when user click on the join button in pre-join page
|
// Event sent when user click on the join button in pre-join page
|
||||||
@Output() onJoinSessionClicked = new EventEmitter<any>();
|
@Output() onJoinButtonClicked = new EventEmitter<any>();
|
||||||
|
// Event sent when user click on the join button in pre-join page
|
||||||
|
@Output() onToolbarLeaveButtonClicked = new EventEmitter<any>();
|
||||||
|
@Output() onToolbarCameraButtonClicked = new EventEmitter<any>();
|
||||||
|
@Output() onToolbarMicrophoneButtonClicked = new EventEmitter<any>();
|
||||||
|
@Output() onToolbarScreenshareButtonClicked = new EventEmitter<any>();
|
||||||
|
@Output() onToolbarFullscreenButtonClicked = new EventEmitter<any>();
|
||||||
|
@Output() onToolbarParticipantsPanelButtonClicked = new EventEmitter<any>();
|
||||||
|
@Output() onToolbarChatPanelButtonClicked = new EventEmitter<any>();
|
||||||
|
|
||||||
// Event sent when participant has joined the session
|
// Event sent when participant has joined the session
|
||||||
@Output() onParticipantJoined = new EventEmitter<any>();
|
@Output() onParticipantJoined = new EventEmitter<any>();
|
||||||
|
|
||||||
// Event sent when participant has left the session
|
// Event sent when participant has left the session
|
||||||
@Output() onParticipantLeft = new EventEmitter<any>();
|
// @Output() onParticipantLeft = new EventEmitter<any>();
|
||||||
|
|
||||||
// Event sent when session has been created
|
// Event sent when session has been created
|
||||||
@Output() onSessionCreated = new EventEmitter<any>();
|
@Output() onSessionCreated = new EventEmitter<any>();
|
||||||
|
|
||||||
joinSessionClicked: boolean = false;
|
joinSessionClicked: boolean = false;
|
||||||
// closeClicked: boolean = false;
|
|
||||||
isSessionAlive: boolean = false;
|
isSessionAlive: boolean = false;
|
||||||
_tokens: { webcam: string; screen: string };
|
_tokens: { webcam: string; screen: string };
|
||||||
error: boolean = false;
|
error: boolean = false;
|
||||||
|
@ -153,12 +160,32 @@ export class VideoconferenceComponent implements OnInit, AfterViewInit {
|
||||||
|
|
||||||
ngOnInit() {}
|
ngOnInit() {}
|
||||||
|
|
||||||
async _onJoinClicked() {
|
_onJoinButtonClicked() {
|
||||||
this.joinSessionClicked = true;
|
this.joinSessionClicked = true;
|
||||||
this.onJoinSessionClicked.emit();
|
this.onJoinButtonClicked.emit();
|
||||||
|
}
|
||||||
|
onLeaveButtonClicked() {
|
||||||
|
this.joinSessionClicked = false;
|
||||||
|
this.isSessionAlive = false;
|
||||||
|
this.onToolbarLeaveButtonClicked.emit();
|
||||||
|
}
|
||||||
|
onCameraButtonClicked() {
|
||||||
|
this.onToolbarCameraButtonClicked.emit();
|
||||||
|
}
|
||||||
|
|
||||||
|
onMicrophoneButtonClicked() {
|
||||||
|
this.onToolbarMicrophoneButtonClicked.emit();
|
||||||
|
}
|
||||||
|
onScreenshareButtonClicked() {
|
||||||
|
this.onToolbarScreenshareButtonClicked.emit();
|
||||||
|
}
|
||||||
|
onFullscreenButtonClicked() {
|
||||||
|
this.onToolbarFullscreenButtonClicked.emit();
|
||||||
|
}
|
||||||
|
onParticipantsPanelButtonClicked() {
|
||||||
|
this.onToolbarParticipantsPanelButtonClicked.emit();
|
||||||
|
}
|
||||||
|
onChatPanelButtonClicked() {
|
||||||
|
this.onToolbarChatPanelButtonClicked.emit();
|
||||||
}
|
}
|
||||||
// onLeaveSessionClicked() {
|
|
||||||
// this.isSessionAlive = false;
|
|
||||||
// this.closeClicked = true;
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue