2022-12-23 16:17:04 +01:00
|
|
|
import { AfterViewInit, Directive, ElementRef, Input, OnDestroy } from '@angular/core';
|
2024-08-26 13:02:48 +02:00
|
|
|
import { OpenViduComponentsConfigService } from '../../services/config/directive-config.service';
|
2022-06-02 10:57:47 +02:00
|
|
|
|
|
|
|
/**
|
2022-12-14 13:07:47 +01:00
|
|
|
* The **recordingActivity** directive allows show/hide the recording activity in {@link ActivitiesPanelComponent}.
|
2022-06-02 10:57:47 +02:00
|
|
|
*
|
|
|
|
* Default: `true`
|
|
|
|
*
|
|
|
|
* It can be used in the parent element {@link VideoconferenceComponent} specifying the name of the `activitiesPanel` component:
|
|
|
|
*
|
|
|
|
* @example
|
|
|
|
* <ov-videoconference [activitiesPanelRecordingActivity]="false"></ov-videoconference>
|
|
|
|
*
|
|
|
|
* \
|
|
|
|
* And it also can be used in the {@link ActivitiesPanelComponent}.
|
|
|
|
* @example
|
2022-12-14 13:07:47 +01:00
|
|
|
* <ov-activities-panel *ovActivitiesPanel [recordingActivity]="false"></ov-activities-panel>
|
2022-06-02 10:57:47 +02:00
|
|
|
*/
|
2022-12-14 13:07:47 +01:00
|
|
|
@Directive({
|
2022-06-02 10:57:47 +02:00
|
|
|
selector: 'ov-videoconference[activitiesPanelRecordingActivity], ov-activities-panel[recordingActivity]'
|
|
|
|
})
|
|
|
|
export class ActivitiesPanelRecordingActivityDirective implements AfterViewInit, OnDestroy {
|
|
|
|
@Input() set activitiesPanelRecordingActivity(value: boolean) {
|
|
|
|
this.recordingActivityValue = value;
|
|
|
|
this.update(this.recordingActivityValue);
|
|
|
|
}
|
2022-12-14 13:07:47 +01:00
|
|
|
@Input() set recordingActivity(value: boolean) {
|
2022-06-02 10:57:47 +02:00
|
|
|
this.recordingActivityValue = value;
|
|
|
|
this.update(this.recordingActivityValue);
|
|
|
|
}
|
|
|
|
|
|
|
|
recordingActivityValue: boolean = true;
|
|
|
|
|
2024-07-02 19:19:05 +02:00
|
|
|
constructor(public elementRef: ElementRef, private libService: OpenViduComponentsConfigService) {}
|
2022-06-02 10:57:47 +02:00
|
|
|
|
|
|
|
ngAfterViewInit() {
|
|
|
|
this.update(this.recordingActivityValue);
|
|
|
|
}
|
|
|
|
ngOnDestroy(): void {
|
|
|
|
this.clear();
|
|
|
|
}
|
|
|
|
clear() {
|
|
|
|
this.recordingActivityValue = true;
|
|
|
|
this.update(true);
|
|
|
|
}
|
|
|
|
|
|
|
|
update(value: boolean) {
|
2024-07-02 19:19:05 +02:00
|
|
|
if (this.libService.showRecordingActivity() !== value) {
|
|
|
|
this.libService.setRecordingActivity(value);
|
2022-06-02 10:57:47 +02:00
|
|
|
}
|
|
|
|
}
|
2022-12-23 16:17:04 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2023-02-17 17:03:15 +01:00
|
|
|
* The **broadcastingActivity** directive allows show/hide the broadcasting activity in {@link ActivitiesPanelComponent}.
|
2022-12-23 16:17:04 +01:00
|
|
|
*
|
|
|
|
* Default: `true`
|
|
|
|
*
|
|
|
|
* It can be used in the parent element {@link VideoconferenceComponent} specifying the name of the `activitiesPanel` component:
|
|
|
|
*
|
|
|
|
* @example
|
2023-02-17 17:03:15 +01:00
|
|
|
* <ov-videoconference [activitiesPanelBroadcastingActivity]="false"></ov-videoconference>
|
2022-12-23 16:17:04 +01:00
|
|
|
*
|
|
|
|
* \
|
|
|
|
* And it also can be used in the {@link ActivitiesPanelComponent}.
|
|
|
|
* @example
|
2023-02-17 17:03:15 +01:00
|
|
|
* <ov-activities-panel *ovActivitiesPanel [broadcastingActivity]="false"></ov-activities-panel>
|
2022-12-23 16:17:04 +01:00
|
|
|
*/
|
|
|
|
@Directive({
|
2023-02-17 17:03:15 +01:00
|
|
|
selector: 'ov-videoconference[activitiesPanelBroadcastingActivity], ov-activities-panel[broadcastingActivity]'
|
2022-12-23 16:17:04 +01:00
|
|
|
})
|
2023-02-17 17:03:15 +01:00
|
|
|
export class ActivitiesPanelBroadcastingActivityDirective implements AfterViewInit, OnDestroy {
|
|
|
|
@Input() set activitiesPanelBroadcastingActivity(value: boolean) {
|
|
|
|
this.broadcastingActivityValue = value;
|
|
|
|
this.update(this.broadcastingActivityValue);
|
2022-12-23 16:17:04 +01:00
|
|
|
}
|
2023-02-17 17:03:15 +01:00
|
|
|
@Input() set broadcastingActivity(value: boolean) {
|
|
|
|
this.broadcastingActivityValue = value;
|
|
|
|
this.update(this.broadcastingActivityValue);
|
2022-12-23 16:17:04 +01:00
|
|
|
}
|
|
|
|
|
2023-02-17 17:03:15 +01:00
|
|
|
broadcastingActivityValue: boolean = true;
|
2022-12-23 16:17:04 +01:00
|
|
|
|
2024-07-02 19:19:05 +02:00
|
|
|
constructor(public elementRef: ElementRef, private libService: OpenViduComponentsConfigService) {}
|
2022-12-23 16:17:04 +01:00
|
|
|
|
|
|
|
ngAfterViewInit() {
|
2023-02-17 17:03:15 +01:00
|
|
|
this.update(this.broadcastingActivityValue);
|
2022-12-23 16:17:04 +01:00
|
|
|
}
|
|
|
|
ngOnDestroy(): void {
|
|
|
|
this.clear();
|
|
|
|
}
|
|
|
|
clear() {
|
2023-02-17 17:03:15 +01:00
|
|
|
this.broadcastingActivityValue = true;
|
2022-12-23 16:17:04 +01:00
|
|
|
this.update(true);
|
|
|
|
}
|
|
|
|
|
|
|
|
update(value: boolean) {
|
2024-07-02 19:19:05 +02:00
|
|
|
if (this.libService.showBroadcastingActivity() !== value) {
|
|
|
|
this.libService.setBroadcastingActivity(value);
|
2022-12-23 16:17:04 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|