2022-02-24 10:16:23 +01:00
|
|
|
import {
|
2022-06-09 14:45:59 +02:00
|
|
|
AfterViewInit,
|
2022-02-24 10:20:32 +01:00
|
|
|
ChangeDetectionStrategy,
|
|
|
|
ChangeDetectorRef,
|
2022-02-24 10:16:23 +01:00
|
|
|
Component,
|
|
|
|
ContentChild,
|
|
|
|
EventEmitter,
|
|
|
|
HostListener,
|
|
|
|
OnDestroy,
|
|
|
|
OnInit,
|
|
|
|
Output,
|
2022-04-25 16:17:32 +02:00
|
|
|
TemplateRef,
|
|
|
|
ViewChild
|
2022-02-24 10:16:23 +01:00
|
|
|
} from '@angular/core';
|
2022-10-14 14:46:32 +02:00
|
|
|
import { skip, Subscription } from 'rxjs';
|
2022-01-19 17:24:11 +01:00
|
|
|
import { ChatService } from '../../services/chat/chat.service';
|
|
|
|
import { DocumentService } from '../../services/document/document.service';
|
2022-12-23 16:17:04 +01:00
|
|
|
import { PanelService } from '../../services/panel/panel.service';
|
2022-01-19 17:24:11 +01:00
|
|
|
|
2022-10-14 14:46:32 +02:00
|
|
|
import { MediaChange } from '@angular/flex-layout';
|
|
|
|
import { MatMenuTrigger } from '@angular/material/menu';
|
2022-03-31 12:25:02 +02:00
|
|
|
import { Session } from 'openvidu-browser';
|
2022-04-18 16:39:23 +02:00
|
|
|
import {
|
|
|
|
ToolbarAdditionalButtonsDirective,
|
|
|
|
ToolbarAdditionalPanelButtonsDirective
|
|
|
|
} from '../../directives/template/openvidu-angular.directive';
|
2023-02-17 17:03:15 +01:00
|
|
|
import { BroadcastingStatus } from '../../models/broadcasting.model';
|
2022-10-14 14:46:32 +02:00
|
|
|
import { ChatMessage } from '../../models/chat.model';
|
|
|
|
import { ILogger } from '../../models/logger.model';
|
2022-12-23 16:17:04 +01:00
|
|
|
import { PanelEvent, PanelType } from '../../models/panel.model';
|
2022-06-02 10:57:47 +02:00
|
|
|
import { OpenViduRole, ParticipantAbstractModel } from '../../models/participant.model';
|
2022-10-14 14:46:32 +02:00
|
|
|
import { RecordingInfo, RecordingStatus } from '../../models/recording.model';
|
|
|
|
import { ActionService } from '../../services/action/action.service';
|
2023-02-17 17:03:15 +01:00
|
|
|
import { BroadcastingService } from '../../services/broadcasting/broadcasting.service';
|
2022-10-14 14:46:32 +02:00
|
|
|
import { OpenViduAngularConfigService } from '../../services/config/openvidu-angular.config.service';
|
|
|
|
import { DeviceService } from '../../services/device/device.service';
|
|
|
|
import { LayoutService } from '../../services/layout/layout.service';
|
|
|
|
import { LoggerService } from '../../services/logger/logger.service';
|
|
|
|
import { OpenViduService } from '../../services/openvidu/openvidu.service';
|
|
|
|
import { ParticipantService } from '../../services/participant/participant.service';
|
2022-04-08 11:57:07 +02:00
|
|
|
import { PlatformService } from '../../services/platform/platform.service';
|
2022-06-02 10:57:47 +02:00
|
|
|
import { RecordingService } from '../../services/recording/recording.service';
|
2022-11-04 16:24:42 +01:00
|
|
|
import { StorageService } from '../../services/storage/storage.service';
|
2022-05-13 17:11:04 +02:00
|
|
|
import { TranslateService } from '../../services/translate/translate.service';
|
2022-01-19 17:24:11 +01:00
|
|
|
|
2022-03-23 13:48:17 +01:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
* The **ToolbarComponent** is hosted inside of the {@link VideoconferenceComponent}.
|
|
|
|
* It is in charge of displaying the participants controlls for handling the media, panels and more videoconference features.
|
|
|
|
*
|
|
|
|
* <div class="custom-table-container">
|
|
|
|
* <div>
|
|
|
|
* <h3>API Directives</h3>
|
|
|
|
*
|
|
|
|
* This component allows us to show or hide certain HTML elements with the following {@link https://angular.io/guide/attribute-directives Angular attribute directives}
|
|
|
|
* with the aim of fully customizing the ToolbarComponent.
|
|
|
|
*
|
|
|
|
* | **Name** | **Type** | **Reference** |
|
|
|
|
* | :----------------------------: | :-------: | :---------------------------------------------: |
|
|
|
|
* | **screenshareButton** | `boolean` | {@link ToolbarScreenshareButtonDirective} |
|
|
|
|
* | **fullscreenButton** | `boolean` | {@link ToolbarFullscreenButtonDirective} |
|
2022-04-25 16:17:32 +02:00
|
|
|
* | **backgroundEffectsButton** | `boolean` | {@link ToolbarBackgroundEffectsButtonDirective} |
|
2022-03-23 13:48:17 +01:00
|
|
|
* | **leaveButton** | `boolean` | {@link ToolbarLeaveButtonDirective} |
|
|
|
|
* | **chatPanelButton** | `boolean` | {@link ToolbarChatPanelButtonDirective} |
|
|
|
|
* | **participantsPanelButton** | `boolean` | {@link ToolbarParticipantsPanelButtonDirective} |
|
|
|
|
* | **displayLogo** | `boolean` | {@link ToolbarDisplayLogoDirective} |
|
|
|
|
* | **displaySessionName** | `boolean` | {@link ToolbarDisplaySessionNameDirective} |
|
|
|
|
*
|
|
|
|
* <p class="component-link-text">
|
|
|
|
* <span class="italic">See all {@link ApiDirectiveModule API Directives}</span>
|
|
|
|
* </p>
|
|
|
|
*
|
|
|
|
* </div>
|
|
|
|
* <div>
|
|
|
|
*
|
|
|
|
* <h3>OpenVidu Angular Directives</h3>
|
|
|
|
*
|
|
|
|
* The ToolbarComponent can be replaced with a custom component. It provides us the following {@link https://angular.io/guide/structural-directives Angular structural directives}
|
|
|
|
* for doing this.
|
|
|
|
*
|
|
|
|
* | **Directive** | **Reference** |
|
|
|
|
* |:----------------------------------:|:---------------------------------------------:|
|
|
|
|
* | ***ovToolbar** | {@link ToolbarDirective} |
|
|
|
|
*
|
|
|
|
* </br>
|
|
|
|
*
|
|
|
|
* It is also providing us a way to **add additional buttons** to the default toolbar.
|
|
|
|
* It will recognise the following directive in a child element.
|
|
|
|
*
|
|
|
|
* | **Directive** | **Reference** |
|
|
|
|
* |:----------------------------------:|:---------------------------------------------:|
|
|
|
|
* | ***ovToolbarAdditionalButtons** | {@link ToolbarAdditionalButtonsDirective} |
|
2022-04-06 12:00:42 +02:00
|
|
|
* |***ovToolbarAdditionalPanelButtons** | {@link ToolbarAdditionalPanelButtonsDirective} |
|
2022-03-23 13:48:17 +01:00
|
|
|
*
|
|
|
|
* <p class="component-link-text">
|
|
|
|
* <span class="italic">See all {@link OpenViduAngularDirectiveModule OpenVidu Angular Directives}</span>
|
|
|
|
* </p>
|
|
|
|
* </div>
|
|
|
|
* </div>
|
|
|
|
*/
|
|
|
|
|
2022-01-19 17:24:11 +01:00
|
|
|
@Component({
|
|
|
|
selector: 'ov-toolbar',
|
|
|
|
templateUrl: './toolbar.component.html',
|
2022-02-24 10:20:32 +01:00
|
|
|
styleUrls: ['./toolbar.component.css'],
|
|
|
|
changeDetection: ChangeDetectionStrategy.OnPush
|
2022-01-19 17:24:11 +01:00
|
|
|
})
|
2022-06-09 14:45:59 +02:00
|
|
|
export class ToolbarComponent implements OnInit, OnDestroy, AfterViewInit {
|
2022-03-23 13:48:17 +01:00
|
|
|
/**
|
|
|
|
* @ignore
|
|
|
|
*/
|
2022-03-10 11:42:48 +01:00
|
|
|
@ContentChild('toolbarAdditionalButtons', { read: TemplateRef }) toolbarAdditionalButtonsTemplate: TemplateRef<any>;
|
|
|
|
|
2022-04-06 12:00:42 +02:00
|
|
|
/**
|
|
|
|
* @ignore
|
|
|
|
*/
|
|
|
|
@ContentChild('toolbarAdditionalPanelButtons', { read: TemplateRef }) toolbarAdditionalPanelButtonsTemplate: TemplateRef<any>;
|
|
|
|
|
2022-03-23 13:48:17 +01:00
|
|
|
/**
|
|
|
|
* @ignore
|
|
|
|
*/
|
2022-03-10 11:42:48 +01:00
|
|
|
@ContentChild(ToolbarAdditionalButtonsDirective)
|
|
|
|
set externalAdditionalButtons(externalAdditionalButtons: ToolbarAdditionalButtonsDirective) {
|
|
|
|
// This directive will has value only when ADDITIONAL BUTTONS component tagget with '*ovToolbarAdditionalButtons' directive
|
|
|
|
// is inside of the TOOLBAR component tagged with '*ovToolbar' directive
|
|
|
|
if (externalAdditionalButtons) {
|
|
|
|
this.toolbarAdditionalButtonsTemplate = externalAdditionalButtons.template;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-04-06 12:00:42 +02:00
|
|
|
/**
|
|
|
|
* @ignore
|
|
|
|
*/
|
2022-04-18 16:39:23 +02:00
|
|
|
@ContentChild(ToolbarAdditionalPanelButtonsDirective)
|
|
|
|
set externalAdditionalPanelButtons(externalAdditionalPanelButtons: ToolbarAdditionalPanelButtonsDirective) {
|
|
|
|
// This directive will has value only when ADDITIONAL PANEL BUTTONS component tagget with '*ovToolbarAdditionalPanelButtons' directive
|
|
|
|
// is inside of the TOOLBAR component tagged with '*ovToolbar' directive
|
|
|
|
if (externalAdditionalPanelButtons) {
|
|
|
|
this.toolbarAdditionalPanelButtonsTemplate = externalAdditionalPanelButtons.template;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Provides event notifications that fire when leave button has been clicked.
|
|
|
|
*/
|
|
|
|
@Output() onLeaveButtonClicked: EventEmitter<void> = new EventEmitter<any>();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Provides event notifications that fire when camera toolbar button has been clicked.
|
|
|
|
*/
|
|
|
|
@Output() onCameraButtonClicked: EventEmitter<void> = new EventEmitter<any>();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Provides event notifications that fire when microphone toolbar button has been clicked.
|
|
|
|
*/
|
|
|
|
@Output() onMicrophoneButtonClicked: EventEmitter<void> = new EventEmitter<any>();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Provides event notifications that fire when fullscreen toolbar button has been clicked.
|
|
|
|
*/
|
|
|
|
@Output() onFullscreenButtonClicked: EventEmitter<void> = new EventEmitter<any>();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Provides event notifications that fire when screenshare toolbar button has been clicked.
|
|
|
|
*/
|
|
|
|
@Output() onScreenshareButtonClicked: EventEmitter<void> = new EventEmitter<any>();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Provides event notifications that fire when participants panel button has been clicked.
|
|
|
|
*/
|
|
|
|
@Output() onParticipantsPanelButtonClicked: EventEmitter<void> = new EventEmitter<any>();
|
2022-04-06 12:00:42 +02:00
|
|
|
|
2022-04-25 16:17:32 +02:00
|
|
|
/**
|
2022-06-02 10:57:47 +02:00
|
|
|
* Provides event notifications that fire when chat panel button has been clicked.
|
2022-04-25 16:17:32 +02:00
|
|
|
*/
|
2022-06-02 10:57:47 +02:00
|
|
|
@Output() onChatPanelButtonClicked: EventEmitter<void> = new EventEmitter<any>();
|
2022-04-25 16:17:32 +02:00
|
|
|
|
2022-04-18 16:39:23 +02:00
|
|
|
/**
|
2022-06-02 10:57:47 +02:00
|
|
|
* Provides event notifications that fire when activities panel button has been clicked.
|
2022-04-18 16:39:23 +02:00
|
|
|
*/
|
2022-06-02 10:57:47 +02:00
|
|
|
@Output() onActivitiesPanelButtonClicked: EventEmitter<void> = new EventEmitter<any>();
|
|
|
|
/**
|
|
|
|
* Provides event notifications that fire when start recording button has been clicked.
|
|
|
|
*/
|
|
|
|
@Output() onStartRecordingClicked: EventEmitter<void> = new EventEmitter<void>();
|
|
|
|
|
2022-12-23 16:17:04 +01:00
|
|
|
/**
|
2023-02-17 17:03:15 +01:00
|
|
|
* Provides event notifications that fire when start broadcasting button has been clicked.
|
2022-12-23 16:17:04 +01:00
|
|
|
*/
|
2023-02-17 17:03:15 +01:00
|
|
|
@Output() onStopBroadcastingClicked: EventEmitter<void> = new EventEmitter<void>();
|
2022-12-23 16:17:04 +01:00
|
|
|
|
2022-06-02 10:57:47 +02:00
|
|
|
/**
|
|
|
|
* Provides event notifications that fire when stop recording button has been clicked.
|
|
|
|
*/
|
|
|
|
@Output() onStopRecordingClicked: EventEmitter<void> = new EventEmitter<void>();
|
2022-04-25 16:17:32 +02:00
|
|
|
/**
|
|
|
|
* @ignore
|
|
|
|
*/
|
|
|
|
@ViewChild(MatMenuTrigger) public menuTrigger: MatMenuTrigger;
|
2022-01-19 17:24:11 +01:00
|
|
|
|
2022-03-23 13:48:17 +01:00
|
|
|
/**
|
|
|
|
* @ignore
|
|
|
|
*/
|
2022-01-19 17:24:11 +01:00
|
|
|
session: Session;
|
2022-03-23 13:48:17 +01:00
|
|
|
/**
|
|
|
|
* @ignore
|
|
|
|
*/
|
2022-01-19 17:24:11 +01:00
|
|
|
unreadMessages: number = 0;
|
2022-03-23 13:48:17 +01:00
|
|
|
/**
|
|
|
|
* @ignore
|
|
|
|
*/
|
2022-01-19 17:24:11 +01:00
|
|
|
messageList: ChatMessage[] = [];
|
2022-03-23 13:48:17 +01:00
|
|
|
/**
|
|
|
|
* @ignore
|
|
|
|
*/
|
2022-02-24 10:16:23 +01:00
|
|
|
isScreenShareActive: boolean;
|
2022-03-23 13:48:17 +01:00
|
|
|
/**
|
|
|
|
* @ignore
|
|
|
|
*/
|
2022-02-24 10:16:23 +01:00
|
|
|
isWebcamVideoActive: boolean;
|
2022-03-23 13:48:17 +01:00
|
|
|
/**
|
|
|
|
* @ignore
|
|
|
|
*/
|
2022-03-30 11:58:35 +02:00
|
|
|
isAudioActive: boolean;
|
2022-03-23 13:48:17 +01:00
|
|
|
/**
|
|
|
|
* @ignore
|
|
|
|
*/
|
2022-01-19 17:24:11 +01:00
|
|
|
isConnectionLost: boolean;
|
2022-03-23 13:48:17 +01:00
|
|
|
/**
|
|
|
|
* @ignore
|
|
|
|
*/
|
2022-01-19 17:24:11 +01:00
|
|
|
hasVideoDevices: boolean;
|
2022-03-23 13:48:17 +01:00
|
|
|
/**
|
|
|
|
* @ignore
|
|
|
|
*/
|
2022-01-19 17:24:11 +01:00
|
|
|
hasAudioDevices: boolean;
|
2022-03-23 13:48:17 +01:00
|
|
|
/**
|
|
|
|
* @ignore
|
|
|
|
*/
|
2022-02-24 10:16:23 +01:00
|
|
|
isFullscreenActive: boolean = false;
|
2022-03-23 13:48:17 +01:00
|
|
|
/**
|
|
|
|
* @ignore
|
|
|
|
*/
|
2022-01-19 17:24:11 +01:00
|
|
|
isChatOpened: boolean = false;
|
2022-03-23 13:48:17 +01:00
|
|
|
/**
|
|
|
|
* @ignore
|
|
|
|
*/
|
2022-01-19 17:24:11 +01:00
|
|
|
isParticipantsOpened: boolean = false;
|
|
|
|
|
2022-04-25 16:17:32 +02:00
|
|
|
/**
|
|
|
|
* @ignore
|
|
|
|
*/
|
|
|
|
isActivitiesOpened: boolean = false;
|
|
|
|
|
2022-03-23 13:48:17 +01:00
|
|
|
/**
|
|
|
|
* @ignore
|
|
|
|
*/
|
2022-03-07 15:50:27 +01:00
|
|
|
isMinimal: boolean = false;
|
2022-03-23 13:48:17 +01:00
|
|
|
/**
|
|
|
|
* @ignore
|
|
|
|
*/
|
2022-03-07 15:50:27 +01:00
|
|
|
showScreenshareButton = true;
|
2022-03-23 13:48:17 +01:00
|
|
|
/**
|
|
|
|
* @ignore
|
|
|
|
*/
|
2022-03-07 15:50:27 +01:00
|
|
|
showFullscreenButton: boolean = true;
|
2022-04-25 16:17:32 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @ignore
|
|
|
|
*/
|
|
|
|
showBackgroundEffectsButton: boolean = true;
|
|
|
|
|
2022-03-23 13:48:17 +01:00
|
|
|
/**
|
|
|
|
* @ignore
|
|
|
|
*/
|
2022-03-07 15:50:27 +01:00
|
|
|
showLeaveButton: boolean = true;
|
2022-06-02 10:57:47 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @ignore
|
|
|
|
*/
|
|
|
|
showRecordingButton: boolean = true;
|
|
|
|
|
2022-12-23 16:17:04 +01:00
|
|
|
/**
|
|
|
|
* @ignore
|
|
|
|
*/
|
2023-02-17 17:03:15 +01:00
|
|
|
showBroadcastingButton: boolean = true;
|
2022-12-23 16:17:04 +01:00
|
|
|
|
2022-06-16 14:01:07 +02:00
|
|
|
/**
|
|
|
|
* @ignore
|
|
|
|
*/
|
|
|
|
showSettingsButton: boolean = true;
|
|
|
|
|
2022-06-02 10:57:47 +02:00
|
|
|
/**
|
|
|
|
* @ignore
|
|
|
|
*/
|
|
|
|
showMoreOptionsButton: boolean = true;
|
|
|
|
|
2022-03-23 13:48:17 +01:00
|
|
|
/**
|
|
|
|
* @ignore
|
|
|
|
*/
|
2022-03-07 15:50:27 +01:00
|
|
|
showParticipantsPanelButton: boolean = true;
|
2022-04-25 16:17:32 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @ignore
|
|
|
|
*/
|
|
|
|
showActivitiesPanelButton: boolean = true;
|
2022-03-23 13:48:17 +01:00
|
|
|
/**
|
|
|
|
* @ignore
|
|
|
|
*/
|
2022-03-07 15:50:27 +01:00
|
|
|
showChatPanelButton: boolean = true;
|
2022-03-23 13:48:17 +01:00
|
|
|
/**
|
|
|
|
* @ignore
|
|
|
|
*/
|
2022-03-07 15:50:27 +01:00
|
|
|
showLogo: boolean = true;
|
2022-03-23 13:48:17 +01:00
|
|
|
/**
|
|
|
|
* @ignore
|
|
|
|
*/
|
2022-03-07 15:50:27 +01:00
|
|
|
showSessionName: boolean = true;
|
2022-07-05 12:03:35 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @ignore
|
|
|
|
*/
|
2022-10-24 17:08:32 +02:00
|
|
|
showCaptionsButton: boolean = true;
|
2022-07-05 12:03:35 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @ignore
|
|
|
|
*/
|
2022-10-24 17:08:32 +02:00
|
|
|
captionsEnabled: boolean;
|
2022-07-05 12:03:35 +02:00
|
|
|
|
2022-05-05 14:03:41 +02:00
|
|
|
/**
|
|
|
|
* @ignore
|
|
|
|
*/
|
|
|
|
videoMuteChanging: boolean = false;
|
2022-01-19 17:24:11 +01:00
|
|
|
|
2022-04-25 16:17:32 +02:00
|
|
|
/**
|
|
|
|
* @ignore
|
|
|
|
*/
|
2022-06-02 10:57:47 +02:00
|
|
|
recordingStatus: RecordingStatus = RecordingStatus.STOPPED;
|
2022-12-23 16:17:04 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @ignore
|
|
|
|
*/
|
2023-02-17 17:03:15 +01:00
|
|
|
broadcastingStatus: BroadcastingStatus = BroadcastingStatus.STOPPED;
|
2022-06-02 10:57:47 +02:00
|
|
|
/**
|
|
|
|
* @ignore
|
|
|
|
*/
|
|
|
|
_recordingStatus = RecordingStatus;
|
2022-12-23 16:17:04 +01:00
|
|
|
/**
|
|
|
|
* @ignore
|
|
|
|
*/
|
2023-02-17 17:03:15 +01:00
|
|
|
_broadcastingStatus = BroadcastingStatus;
|
2022-06-02 10:57:47 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @ignore
|
|
|
|
*/
|
|
|
|
recordingTime: Date;
|
2022-12-23 16:17:04 +01:00
|
|
|
/**
|
|
|
|
* @ignore
|
|
|
|
*/
|
2023-02-17 17:03:15 +01:00
|
|
|
broadcastingTime: Date;
|
2022-06-02 10:57:47 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @ignore
|
|
|
|
*/
|
|
|
|
isSessionCreator: boolean = false;
|
2022-04-25 16:17:32 +02:00
|
|
|
|
2022-06-14 13:22:53 +02:00
|
|
|
/**
|
|
|
|
* @ignore
|
|
|
|
*/
|
|
|
|
screenSize: string;
|
|
|
|
|
2022-03-07 15:50:27 +01:00
|
|
|
private log: ILogger;
|
|
|
|
private minimalSub: Subscription;
|
2022-04-06 12:00:42 +02:00
|
|
|
private panelTogglingSubscription: Subscription;
|
2022-03-07 15:50:27 +01:00
|
|
|
private chatMessagesSubscription: Subscription;
|
|
|
|
private localParticipantSubscription: Subscription;
|
|
|
|
private screenshareButtonSub: Subscription;
|
|
|
|
private fullscreenButtonSub: Subscription;
|
2022-04-25 16:17:32 +02:00
|
|
|
private backgroundEffectsButtonSub: Subscription;
|
2022-03-07 15:50:27 +01:00
|
|
|
private leaveButtonSub: Subscription;
|
2022-06-02 10:57:47 +02:00
|
|
|
private recordingButtonSub: Subscription;
|
2023-02-17 17:03:15 +01:00
|
|
|
private broadcastingButtonSub: Subscription;
|
2022-04-25 16:17:32 +02:00
|
|
|
private recordingSubscription: Subscription;
|
2023-02-17 17:03:15 +01:00
|
|
|
private broadcastingSubscription: Subscription;
|
2022-04-25 16:17:32 +02:00
|
|
|
private activitiesPanelButtonSub: Subscription;
|
2022-03-07 15:50:27 +01:00
|
|
|
private participantsPanelButtonSub: Subscription;
|
|
|
|
private chatPanelButtonSub: Subscription;
|
|
|
|
private displayLogoSub: Subscription;
|
|
|
|
private displaySessionNameSub: Subscription;
|
2022-06-14 13:22:53 +02:00
|
|
|
private screenSizeSub: Subscription;
|
2022-06-16 14:01:07 +02:00
|
|
|
private settingsButtonSub: Subscription;
|
2022-10-24 17:08:32 +02:00
|
|
|
private captionsSubs: Subscription;
|
2022-03-07 15:50:27 +01:00
|
|
|
private currentWindowHeight = window.innerHeight;
|
2022-01-19 17:24:11 +01:00
|
|
|
|
2022-03-23 13:48:17 +01:00
|
|
|
/**
|
|
|
|
* @ignore
|
|
|
|
*/
|
|
|
|
constructor(
|
|
|
|
protected documentService: DocumentService,
|
|
|
|
protected chatService: ChatService,
|
2022-04-05 15:40:43 +02:00
|
|
|
protected panelService: PanelService,
|
2022-03-23 13:48:17 +01:00
|
|
|
protected participantService: ParticipantService,
|
|
|
|
protected openviduService: OpenViduService,
|
|
|
|
protected oVDevicesService: DeviceService,
|
|
|
|
protected actionService: ActionService,
|
|
|
|
protected loggerSrv: LoggerService,
|
2022-07-05 12:03:35 +02:00
|
|
|
private layoutService: LayoutService,
|
2022-03-23 13:48:17 +01:00
|
|
|
private cd: ChangeDetectorRef,
|
2022-04-08 11:57:07 +02:00
|
|
|
private libService: OpenViduAngularConfigService,
|
2022-04-25 16:17:32 +02:00
|
|
|
private platformService: PlatformService,
|
2022-05-13 17:11:04 +02:00
|
|
|
private recordingService: RecordingService,
|
2023-02-17 17:03:15 +01:00
|
|
|
private broadcastingService: BroadcastingService,
|
2022-11-04 16:24:42 +01:00
|
|
|
private translateService: TranslateService,
|
|
|
|
private storageSrv: StorageService
|
2022-03-23 13:48:17 +01:00
|
|
|
) {
|
|
|
|
this.log = this.loggerSrv.get('ToolbarComponent');
|
|
|
|
}
|
|
|
|
/**
|
|
|
|
* @ignore
|
|
|
|
*/
|
2022-01-19 17:24:11 +01:00
|
|
|
@HostListener('window:resize', ['$event'])
|
|
|
|
sizeChange(event) {
|
2022-03-07 15:50:27 +01:00
|
|
|
if (this.currentWindowHeight >= window.innerHeight) {
|
2022-02-24 10:16:23 +01:00
|
|
|
// The user has exit the fullscreen mode
|
|
|
|
this.isFullscreenActive = false;
|
|
|
|
this.currentWindowHeight = window.innerHeight;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-03-23 13:48:17 +01:00
|
|
|
/**
|
|
|
|
* @ignore
|
|
|
|
*/
|
2022-02-24 10:16:23 +01:00
|
|
|
@HostListener('document:keydown', ['$event'])
|
|
|
|
keyDown(event: KeyboardEvent) {
|
2022-03-07 15:50:27 +01:00
|
|
|
if (event.key === 'F11') {
|
2022-02-24 10:16:23 +01:00
|
|
|
event.preventDefault();
|
|
|
|
this.toggleFullscreen();
|
|
|
|
this.currentWindowHeight = window.innerHeight;
|
|
|
|
return false;
|
|
|
|
}
|
2022-01-19 17:24:11 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
async ngOnInit() {
|
2022-03-07 15:50:27 +01:00
|
|
|
this.subscribeToToolbarDirectives();
|
|
|
|
|
2022-01-19 17:24:11 +01:00
|
|
|
this.hasVideoDevices = this.oVDevicesService.hasVideoDeviceAvailable();
|
|
|
|
this.hasAudioDevices = this.oVDevicesService.hasAudioDeviceAvailable();
|
2022-02-15 15:52:59 +01:00
|
|
|
this.session = this.openviduService.getWebcamSession();
|
2022-01-19 17:24:11 +01:00
|
|
|
|
|
|
|
this.subscribeToUserMediaProperties();
|
|
|
|
this.subscribeToReconnection();
|
2022-02-14 14:12:58 +01:00
|
|
|
this.subscribeToMenuToggling();
|
|
|
|
this.subscribeToChatMessages();
|
2022-04-25 16:17:32 +02:00
|
|
|
this.subscribeToRecordingStatus();
|
2023-02-17 17:03:15 +01:00
|
|
|
this.subscribeToBroadcastingStatus();
|
2022-06-14 13:22:53 +02:00
|
|
|
this.subscribeToScreenSize();
|
2022-10-24 17:08:32 +02:00
|
|
|
this.subscribeToCaptionsToggling();
|
2022-01-19 17:24:11 +01:00
|
|
|
}
|
|
|
|
|
2022-06-09 14:45:59 +02:00
|
|
|
ngAfterViewInit() {
|
|
|
|
// Sometimes the connection is undefined so we have to check the role when the mat menu is opened
|
|
|
|
this.menuTrigger?.menuOpened.subscribe(() => {
|
2022-12-23 16:17:04 +01:00
|
|
|
this.isSessionCreator = this.participantService.amIModerator();
|
2022-06-09 14:45:59 +02:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2022-03-07 15:50:27 +01:00
|
|
|
ngOnDestroy(): void {
|
2022-04-06 12:00:42 +02:00
|
|
|
if (this.panelTogglingSubscription) this.panelTogglingSubscription.unsubscribe();
|
2022-03-07 15:50:27 +01:00
|
|
|
if (this.chatMessagesSubscription) this.chatMessagesSubscription.unsubscribe();
|
|
|
|
if (this.localParticipantSubscription) this.localParticipantSubscription.unsubscribe();
|
|
|
|
if (this.screenshareButtonSub) this.screenshareButtonSub.unsubscribe();
|
|
|
|
if (this.fullscreenButtonSub) this.fullscreenButtonSub.unsubscribe();
|
2022-04-25 16:17:32 +02:00
|
|
|
if (this.backgroundEffectsButtonSub) this.backgroundEffectsButtonSub.unsubscribe();
|
2022-03-07 15:50:27 +01:00
|
|
|
if (this.leaveButtonSub) this.leaveButtonSub.unsubscribe();
|
2022-06-02 10:57:47 +02:00
|
|
|
if (this.recordingButtonSub) this.recordingButtonSub.unsubscribe();
|
2023-02-17 17:03:15 +01:00
|
|
|
if (this.broadcastingButtonSub) this.broadcastingButtonSub.unsubscribe();
|
2022-03-07 15:50:27 +01:00
|
|
|
if (this.participantsPanelButtonSub) this.participantsPanelButtonSub.unsubscribe();
|
|
|
|
if (this.chatPanelButtonSub) this.chatPanelButtonSub.unsubscribe();
|
|
|
|
if (this.displayLogoSub) this.displayLogoSub.unsubscribe();
|
|
|
|
if (this.displaySessionNameSub) this.displaySessionNameSub.unsubscribe();
|
2022-03-23 13:48:17 +01:00
|
|
|
if (this.minimalSub) this.minimalSub.unsubscribe();
|
2022-04-25 16:17:32 +02:00
|
|
|
if (this.activitiesPanelButtonSub) this.activitiesPanelButtonSub.unsubscribe();
|
|
|
|
if (this.recordingSubscription) this.recordingSubscription.unsubscribe();
|
2023-02-17 17:03:15 +01:00
|
|
|
if (this.broadcastingSubscription) this.broadcastingSubscription.unsubscribe();
|
2022-06-14 13:22:53 +02:00
|
|
|
if (this.screenSizeSub) this.screenSizeSub.unsubscribe();
|
2022-06-16 14:01:07 +02:00
|
|
|
if (this.settingsButtonSub) this.settingsButtonSub.unsubscribe();
|
2022-10-24 17:08:32 +02:00
|
|
|
if (this.captionsSubs) this.captionsSubs.unsubscribe();
|
2022-03-07 15:50:27 +01:00
|
|
|
}
|
|
|
|
|
2022-03-23 13:48:17 +01:00
|
|
|
/**
|
|
|
|
* @ignore
|
|
|
|
*/
|
2022-03-31 12:25:02 +02:00
|
|
|
async toggleMicrophone() {
|
2022-03-09 15:31:21 +01:00
|
|
|
this.onMicrophoneButtonClicked.emit();
|
2022-03-31 12:25:02 +02:00
|
|
|
try {
|
2022-04-01 13:24:56 +02:00
|
|
|
await this.openviduService.publishAudio(!this.isAudioActive);
|
2022-03-31 12:25:02 +02:00
|
|
|
} catch (error) {
|
|
|
|
this.log.e('There was an error toggling microphone:', error.code, error.message);
|
2022-06-02 10:57:47 +02:00
|
|
|
this.actionService.openDialog(
|
|
|
|
this.translateService.translate('ERRORS.TOGGLE_MICROPHONE'),
|
|
|
|
error?.error || error?.message || error
|
|
|
|
);
|
2022-01-19 17:24:11 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-03-23 13:48:17 +01:00
|
|
|
/**
|
|
|
|
* @ignore
|
|
|
|
*/
|
2022-01-19 17:24:11 +01:00
|
|
|
async toggleCamera() {
|
2022-05-05 14:03:41 +02:00
|
|
|
this.videoMuteChanging = true;
|
2022-03-09 15:31:21 +01:00
|
|
|
this.onCameraButtonClicked.emit();
|
2022-01-19 17:24:11 +01:00
|
|
|
try {
|
2022-04-05 15:40:43 +02:00
|
|
|
const publishVideo = !this.participantService.isMyVideoActive();
|
2022-05-13 17:11:04 +02:00
|
|
|
if (this.panelService.isExternalPanelOpened() && !publishVideo) {
|
2022-05-10 17:18:33 +02:00
|
|
|
this.panelService.togglePanel(PanelType.BACKGROUND_EFFECTS);
|
|
|
|
}
|
2022-04-01 13:24:56 +02:00
|
|
|
await this.openviduService.publishVideo(publishVideo);
|
2022-01-19 17:24:11 +01:00
|
|
|
} catch (error) {
|
|
|
|
this.log.e('There was an error toggling camera:', error.code, error.message);
|
2022-05-13 17:11:04 +02:00
|
|
|
this.actionService.openDialog(this.translateService.translate('ERRORS.TOGGLE_CAMERA'), error?.error || error?.message || error);
|
2022-01-19 17:24:11 +01:00
|
|
|
}
|
2022-05-05 14:03:41 +02:00
|
|
|
this.videoMuteChanging = false;
|
2022-01-19 17:24:11 +01:00
|
|
|
}
|
|
|
|
|
2022-03-23 13:48:17 +01:00
|
|
|
/**
|
|
|
|
* @ignore
|
|
|
|
*/
|
2022-01-19 17:24:11 +01:00
|
|
|
async toggleScreenShare() {
|
2022-03-09 15:31:21 +01:00
|
|
|
this.onScreenshareButtonClicked.emit();
|
2022-01-19 17:24:11 +01:00
|
|
|
|
|
|
|
try {
|
2022-03-31 12:25:02 +02:00
|
|
|
await this.openviduService.toggleScreenshare();
|
2022-01-19 17:24:11 +01:00
|
|
|
} catch (error) {
|
2022-03-31 12:25:02 +02:00
|
|
|
this.log.e('There was an error toggling screen share', error.code, error.message);
|
|
|
|
if (error && error.name === 'SCREEN_SHARING_NOT_SUPPORTED') {
|
2022-06-02 10:57:47 +02:00
|
|
|
this.actionService.openDialog(
|
|
|
|
this.translateService.translate('ERRORS.SCREEN_SHARING'),
|
|
|
|
this.translateService.translate('ERRORS.SCREEN_SUPPORT')
|
|
|
|
);
|
2022-03-31 12:25:02 +02:00
|
|
|
}
|
2022-01-19 17:24:11 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-03-23 13:48:17 +01:00
|
|
|
/**
|
|
|
|
* @ignore
|
|
|
|
*/
|
2022-01-19 17:24:11 +01:00
|
|
|
leaveSession() {
|
|
|
|
this.log.d('Leaving session...');
|
2022-02-15 15:52:59 +01:00
|
|
|
this.openviduService.disconnect();
|
2022-03-09 15:31:21 +01:00
|
|
|
this.onLeaveButtonClicked.emit();
|
|
|
|
}
|
|
|
|
|
2022-04-25 16:17:32 +02:00
|
|
|
/**
|
|
|
|
* @ignore
|
|
|
|
*/
|
2022-06-02 10:57:47 +02:00
|
|
|
toggleRecording() {
|
|
|
|
if (this.recordingStatus === RecordingStatus.STARTED) {
|
|
|
|
this.log.d('Stopping recording');
|
|
|
|
this.onStopRecordingClicked.emit();
|
|
|
|
this.recordingService.updateStatus(RecordingStatus.STOPPING);
|
|
|
|
} else if (this.recordingStatus === RecordingStatus.STOPPED) {
|
|
|
|
this.onStartRecordingClicked.emit();
|
|
|
|
this.recordingService.updateStatus(RecordingStatus.STARTING);
|
|
|
|
|
|
|
|
if (this.showActivitiesPanelButton && !this.isActivitiesOpened) {
|
|
|
|
this.toggleActivitiesPanel('recording');
|
|
|
|
}
|
|
|
|
}
|
2022-04-25 16:17:32 +02:00
|
|
|
}
|
|
|
|
|
2022-12-23 16:17:04 +01:00
|
|
|
/**
|
|
|
|
* @ignore
|
|
|
|
*/
|
2023-02-17 17:03:15 +01:00
|
|
|
toggleBroadcasting() {
|
|
|
|
if (this.broadcastingStatus === BroadcastingStatus.STARTED) {
|
|
|
|
this.log.d('Stopping broadcasting');
|
|
|
|
this.onStopBroadcastingClicked.emit();
|
|
|
|
this.broadcastingService.updateStatus(BroadcastingStatus.STOPPING);
|
|
|
|
} else if (this.broadcastingStatus === BroadcastingStatus.STOPPED) {
|
2022-12-23 16:17:04 +01:00
|
|
|
if (this.showActivitiesPanelButton && !this.isActivitiesOpened) {
|
2023-02-17 17:03:15 +01:00
|
|
|
this.toggleActivitiesPanel('broadcasting');
|
2022-12-23 16:17:04 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-04-25 16:17:32 +02:00
|
|
|
/**
|
|
|
|
* @ignore
|
|
|
|
*/
|
|
|
|
toggleBackgroundEffects() {
|
2022-11-16 10:55:36 +01:00
|
|
|
if (this.openviduService.isOpenViduPro()) {
|
|
|
|
this.panelService.togglePanel(PanelType.BACKGROUND_EFFECTS);
|
|
|
|
} else {
|
|
|
|
this.actionService.openProFeatureDialog(
|
|
|
|
this.translateService.translate('PANEL.BACKGROUND.TITLE'),
|
|
|
|
this.translateService.translate('PANEL.PRO_FEATURE')
|
|
|
|
);
|
|
|
|
}
|
2022-04-25 16:17:32 +02:00
|
|
|
}
|
|
|
|
|
2022-07-05 12:03:35 +02:00
|
|
|
/**
|
|
|
|
* @ignore
|
|
|
|
*/
|
2022-10-24 17:08:32 +02:00
|
|
|
toggleCaptions() {
|
2022-11-16 10:55:36 +01:00
|
|
|
if (this.openviduService.isOpenViduPro()) {
|
|
|
|
this.layoutService.toggleCaptions();
|
|
|
|
} else {
|
|
|
|
this.actionService.openProFeatureDialog(
|
|
|
|
this.translateService.translate('PANEL.SETTINGS.CAPTIONS'),
|
|
|
|
this.translateService.translate('PANEL.PRO_FEATURE')
|
|
|
|
);
|
|
|
|
}
|
2022-07-05 12:03:35 +02:00
|
|
|
}
|
|
|
|
|
2022-06-16 14:01:07 +02:00
|
|
|
/**
|
|
|
|
* @ignore
|
|
|
|
*/
|
|
|
|
toggleSettings() {
|
|
|
|
this.panelService.togglePanel(PanelType.SETTINGS);
|
|
|
|
}
|
|
|
|
|
2022-03-23 13:48:17 +01:00
|
|
|
/**
|
|
|
|
* @ignore
|
|
|
|
*/
|
2022-03-09 15:31:21 +01:00
|
|
|
toggleParticipantsPanel() {
|
|
|
|
this.onParticipantsPanelButtonClicked.emit();
|
2022-04-06 12:00:42 +02:00
|
|
|
this.panelService.togglePanel(PanelType.PARTICIPANTS);
|
2022-01-19 17:24:11 +01:00
|
|
|
}
|
|
|
|
|
2022-03-23 13:48:17 +01:00
|
|
|
/**
|
|
|
|
* @ignore
|
|
|
|
*/
|
2022-03-09 15:31:21 +01:00
|
|
|
toggleChatPanel() {
|
|
|
|
this.onChatPanelButtonClicked.emit();
|
2022-04-06 12:00:42 +02:00
|
|
|
this.panelService.togglePanel(PanelType.CHAT);
|
2022-01-19 17:24:11 +01:00
|
|
|
}
|
|
|
|
|
2022-03-23 13:48:17 +01:00
|
|
|
/**
|
|
|
|
* @ignore
|
|
|
|
*/
|
2022-01-19 17:24:11 +01:00
|
|
|
toggleFullscreen() {
|
2022-02-24 10:16:23 +01:00
|
|
|
this.isFullscreenActive = !this.isFullscreenActive;
|
2022-02-22 16:59:24 +01:00
|
|
|
this.documentService.toggleFullscreen('session-container');
|
2022-03-09 15:31:21 +01:00
|
|
|
this.onFullscreenButtonClicked.emit();
|
2022-01-19 17:24:11 +01:00
|
|
|
}
|
|
|
|
|
2022-06-02 10:57:47 +02:00
|
|
|
private toggleActivitiesPanel(expandPanel: string) {
|
|
|
|
this.onActivitiesPanelButtonClicked.emit();
|
|
|
|
this.panelService.togglePanel(PanelType.ACTIVITIES, expandPanel);
|
|
|
|
}
|
|
|
|
|
2022-01-19 17:24:11 +01:00
|
|
|
protected subscribeToReconnection() {
|
|
|
|
this.session.on('reconnecting', () => {
|
2022-04-05 15:51:10 +02:00
|
|
|
if (this.panelService.isPanelOpened()) {
|
2022-04-06 12:00:42 +02:00
|
|
|
this.panelService.closePanel();
|
2022-01-19 17:24:11 +01:00
|
|
|
}
|
|
|
|
this.isConnectionLost = true;
|
|
|
|
});
|
|
|
|
this.session.on('reconnected', () => {
|
|
|
|
this.isConnectionLost = false;
|
|
|
|
});
|
|
|
|
}
|
|
|
|
protected subscribeToMenuToggling() {
|
2022-06-16 14:01:07 +02:00
|
|
|
this.panelTogglingSubscription = this.panelService.panelOpenedObs.subscribe((ev: PanelEvent) => {
|
|
|
|
this.isChatOpened = ev.opened && ev.type === PanelType.CHAT;
|
|
|
|
this.isParticipantsOpened = ev.opened && ev.type === PanelType.PARTICIPANTS;
|
|
|
|
this.isActivitiesOpened = ev.opened && ev.type === PanelType.ACTIVITIES;
|
|
|
|
if (this.isChatOpened) {
|
|
|
|
this.unreadMessages = 0;
|
2022-01-19 17:24:11 +01:00
|
|
|
}
|
2022-06-16 14:01:07 +02:00
|
|
|
this.cd.markForCheck();
|
|
|
|
});
|
2022-01-19 17:24:11 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
protected subscribeToChatMessages() {
|
|
|
|
this.chatMessagesSubscription = this.chatService.messagesObs.pipe(skip(1)).subscribe((messages) => {
|
2022-06-24 12:49:48 +02:00
|
|
|
if (!this.panelService.isChatPanelOpened()) {
|
2022-01-19 17:24:11 +01:00
|
|
|
this.unreadMessages++;
|
|
|
|
}
|
|
|
|
this.messageList = messages;
|
2022-02-24 10:20:32 +01:00
|
|
|
this.cd.markForCheck();
|
2022-01-19 17:24:11 +01:00
|
|
|
});
|
|
|
|
}
|
|
|
|
protected subscribeToUserMediaProperties() {
|
2022-03-30 11:58:35 +02:00
|
|
|
this.localParticipantSubscription = this.participantService.localParticipantObs.subscribe((p: ParticipantAbstractModel) => {
|
2022-03-23 13:45:30 +01:00
|
|
|
if (p) {
|
2022-03-10 14:12:43 +01:00
|
|
|
this.isWebcamVideoActive = p.isCameraVideoActive();
|
2022-06-16 14:01:07 +02:00
|
|
|
this.isAudioActive = p.hasAudioActive();
|
2022-03-10 14:12:43 +01:00
|
|
|
this.isScreenShareActive = p.isScreenActive();
|
2022-06-02 10:57:47 +02:00
|
|
|
this.isSessionCreator = p.getRole() === OpenViduRole.MODERATOR;
|
2022-11-04 16:24:42 +01:00
|
|
|
this.storageSrv.setAudioMuted(!this.isAudioActive);
|
|
|
|
this.storageSrv.setVideoMuted(!this.isWebcamVideoActive);
|
2022-03-10 14:12:43 +01:00
|
|
|
this.cd.markForCheck();
|
|
|
|
}
|
2022-01-19 17:24:11 +01:00
|
|
|
});
|
|
|
|
}
|
2022-03-07 15:50:27 +01:00
|
|
|
|
2022-05-20 13:34:11 +02:00
|
|
|
private subscribeToRecordingStatus() {
|
2023-02-22 13:07:08 +01:00
|
|
|
this.recordingSubscription = this.recordingService.recordingStatusObs.subscribe((ev: { info: RecordingInfo; time?: Date }) => {
|
|
|
|
this.recordingStatus = ev.info.status;
|
|
|
|
if (ev.time) {
|
|
|
|
this.recordingTime = ev.time;
|
|
|
|
}
|
|
|
|
this.cd.markForCheck();
|
|
|
|
});
|
2022-04-25 16:17:32 +02:00
|
|
|
}
|
|
|
|
|
2023-02-17 17:03:15 +01:00
|
|
|
private subscribeToBroadcastingStatus() {
|
2023-02-22 13:07:08 +01:00
|
|
|
this.broadcastingSubscription = this.broadcastingService.broadcastingStatusObs.subscribe(
|
|
|
|
(ev: { status: BroadcastingStatus; time?: Date } | undefined) => {
|
2022-12-23 16:17:04 +01:00
|
|
|
if (!!ev) {
|
2023-02-17 17:03:15 +01:00
|
|
|
this.broadcastingStatus = ev.status;
|
2022-12-23 16:17:04 +01:00
|
|
|
if (ev.time) {
|
2023-02-17 17:03:15 +01:00
|
|
|
this.broadcastingTime = ev.time;
|
2022-12-23 16:17:04 +01:00
|
|
|
}
|
|
|
|
this.cd.markForCheck();
|
|
|
|
}
|
2023-02-22 13:07:08 +01:00
|
|
|
}
|
|
|
|
);
|
2022-12-23 16:17:04 +01:00
|
|
|
}
|
|
|
|
|
2022-03-07 15:50:27 +01:00
|
|
|
private subscribeToToolbarDirectives() {
|
|
|
|
this.minimalSub = this.libService.minimalObs.subscribe((value: boolean) => {
|
|
|
|
this.isMinimal = value;
|
|
|
|
this.cd.markForCheck();
|
|
|
|
});
|
|
|
|
this.screenshareButtonSub = this.libService.screenshareButtonObs.subscribe((value: boolean) => {
|
2022-04-08 11:57:07 +02:00
|
|
|
this.showScreenshareButton = value && !this.platformService.isMobile();
|
2022-03-07 15:50:27 +01:00
|
|
|
this.cd.markForCheck();
|
|
|
|
});
|
|
|
|
this.fullscreenButtonSub = this.libService.fullscreenButtonObs.subscribe((value: boolean) => {
|
|
|
|
this.showFullscreenButton = value;
|
2022-06-02 10:57:47 +02:00
|
|
|
this.checkDisplayMoreOptions();
|
2022-03-07 15:50:27 +01:00
|
|
|
this.cd.markForCheck();
|
|
|
|
});
|
|
|
|
this.leaveButtonSub = this.libService.leaveButtonObs.subscribe((value: boolean) => {
|
|
|
|
this.showLeaveButton = value;
|
|
|
|
this.cd.markForCheck();
|
|
|
|
});
|
2022-06-02 10:57:47 +02:00
|
|
|
|
2022-06-16 14:01:07 +02:00
|
|
|
this.recordingButtonSub = this.libService.recordingButtonObs.subscribe((value: boolean) => {
|
2022-06-02 10:57:47 +02:00
|
|
|
this.showRecordingButton = value;
|
|
|
|
this.checkDisplayMoreOptions();
|
|
|
|
this.cd.markForCheck();
|
|
|
|
});
|
2022-06-16 14:01:07 +02:00
|
|
|
|
2023-02-17 17:03:15 +01:00
|
|
|
this.broadcastingButtonSub = this.libService.broadcastingButtonObs.subscribe((value: boolean) => {
|
|
|
|
this.showBroadcastingButton = value;
|
2022-12-23 16:17:04 +01:00
|
|
|
this.checkDisplayMoreOptions();
|
|
|
|
this.cd.markForCheck();
|
|
|
|
});
|
|
|
|
|
2022-06-16 14:01:07 +02:00
|
|
|
this.settingsButtonSub = this.libService.toolbarSettingsButtonObs.subscribe((value: boolean) => {
|
|
|
|
this.showSettingsButton = value;
|
|
|
|
this.checkDisplayMoreOptions();
|
|
|
|
this.cd.markForCheck();
|
|
|
|
});
|
2022-03-07 15:50:27 +01:00
|
|
|
this.chatPanelButtonSub = this.libService.chatPanelButtonObs.subscribe((value: boolean) => {
|
|
|
|
this.showChatPanelButton = value;
|
|
|
|
this.cd.markForCheck();
|
|
|
|
});
|
|
|
|
this.participantsPanelButtonSub = this.libService.participantsPanelButtonObs.subscribe((value: boolean) => {
|
|
|
|
this.showParticipantsPanelButton = value;
|
|
|
|
this.cd.markForCheck();
|
|
|
|
});
|
2022-06-02 10:57:47 +02:00
|
|
|
this.activitiesPanelButtonSub = this.libService.activitiesPanelButtonObs.subscribe((value: boolean) => {
|
|
|
|
this.showActivitiesPanelButton = value;
|
|
|
|
this.cd.markForCheck();
|
|
|
|
});
|
2022-04-25 16:17:32 +02:00
|
|
|
this.backgroundEffectsButtonSub = this.libService.backgroundEffectsButton.subscribe((value: boolean) => {
|
|
|
|
this.showBackgroundEffectsButton = value;
|
2022-06-02 10:57:47 +02:00
|
|
|
this.checkDisplayMoreOptions();
|
2022-04-25 16:17:32 +02:00
|
|
|
this.cd.markForCheck();
|
|
|
|
});
|
2022-03-07 15:50:27 +01:00
|
|
|
this.displayLogoSub = this.libService.displayLogoObs.subscribe((value: boolean) => {
|
|
|
|
this.showLogo = value;
|
|
|
|
this.cd.markForCheck();
|
|
|
|
});
|
|
|
|
this.displaySessionNameSub = this.libService.displaySessionNameObs.subscribe((value: boolean) => {
|
|
|
|
this.showSessionName = value;
|
|
|
|
this.cd.markForCheck();
|
|
|
|
});
|
2022-10-24 17:08:32 +02:00
|
|
|
this.captionsSubs = this.libService.captionsButtonObs.subscribe((value: boolean) => {
|
|
|
|
this.showCaptionsButton = value;
|
2022-07-05 12:03:35 +02:00
|
|
|
this.cd.markForCheck();
|
|
|
|
});
|
2022-03-07 15:50:27 +01:00
|
|
|
}
|
2022-06-02 10:57:47 +02:00
|
|
|
|
2022-06-14 13:22:53 +02:00
|
|
|
private subscribeToScreenSize() {
|
|
|
|
this.screenSizeSub = this.documentService.screenSizeObs.subscribe((change: MediaChange[]) => {
|
|
|
|
this.screenSize = change[0].mqAlias;
|
2022-10-14 14:46:32 +02:00
|
|
|
this.cd.markForCheck();
|
2022-06-14 13:22:53 +02:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2022-10-24 17:08:32 +02:00
|
|
|
private subscribeToCaptionsToggling() {
|
|
|
|
this.captionsSubs = this.layoutService.captionsTogglingObs.subscribe((value: boolean) => {
|
|
|
|
this.captionsEnabled = value;
|
2022-07-05 12:03:35 +02:00
|
|
|
this.cd.markForCheck();
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2022-06-02 10:57:47 +02:00
|
|
|
private checkDisplayMoreOptions() {
|
2022-06-16 14:01:07 +02:00
|
|
|
this.showMoreOptionsButton =
|
2022-12-23 16:17:04 +01:00
|
|
|
this.showFullscreenButton ||
|
|
|
|
this.showBackgroundEffectsButton ||
|
|
|
|
this.showRecordingButton ||
|
2023-02-17 17:03:15 +01:00
|
|
|
this.showBroadcastingButton ||
|
2022-12-23 16:17:04 +01:00
|
|
|
this.showSettingsButton;
|
2022-06-02 10:57:47 +02:00
|
|
|
}
|
2022-01-19 17:24:11 +01:00
|
|
|
}
|