True (default)
- False (no audio)
+ False (no audio)
Custom
- autoGainControl
- echoCancellation
- noiseSuppression
+ autoGainControl
+ echoCancellation
+ noiseSuppression
-
+
deviceId
-
+
channelCount
-
+
latency
-
+
sampleRate
-
+
sampleSize
@@ -90,20 +81,20 @@ OPTIONS
True (default)
- False (no screen)
+ False (no screen)
Custom
-
video
+
video
+
audio
+
preferCurrentTab
+
suppressLocalAudioPlayback
displaySurface
{{surface}}
-
audio
-
preferCurrentTab
-
suppressLocalAudioPlayback
contentHint
@@ -128,43 +119,59 @@ OPTIONS
{{audio}}
+
+
+
+ Default
+ Custom
+
+
+
+
diff --git a/openvidu-testapp/src/app/components/dialogs/options-dialog/options-dialog.component.ts b/openvidu-testapp/src/app/components/dialogs/options-dialog/options-dialog.component.ts
index de904d306b..d65a6750b8 100644
--- a/openvidu-testapp/src/app/components/dialogs/options-dialog/options-dialog.component.ts
+++ b/openvidu-testapp/src/app/components/dialogs/options-dialog/options-dialog.component.ts
@@ -23,6 +23,9 @@ export class OptionsDialogComponent {
shareScreen = false;
screenShareCaptureOptions?: ScreenShareCaptureOptions;
trackPublishOptions?: TrackPublishOptions;
+ allowDisablingAudio = true;
+ allowDisablingVideo = true;
+ allowDisablingScreen = true;
videoOption: true | false | 'custom';
audioOption: true | false | 'custom';
@@ -32,6 +35,7 @@ export class OptionsDialogComponent {
auxAudioCaptureOptions: AudioCaptureOptions;
auxScreenDisplaySurface: 'NONE' | 'window' | 'browser' | 'monitor';
+ customScreenShareResolution: boolean = false;
ENUMERATION_SOURCE = Object.keys(Track.Source);
@@ -44,6 +48,9 @@ export class OptionsDialogComponent {
shareScreen: boolean;
screenShareCaptureOptions?: ScreenShareCaptureOptions;
trackPublishOptions?: TrackPublishOptions;
+ allowDisablingAudio?: boolean;
+ allowDisablingVideo?: boolean;
+ allowDisablingScreen?: boolean;
}
) {
this.roomOptions = data.roomOptions;
@@ -51,32 +58,46 @@ export class OptionsDialogComponent {
this.shareScreen = data.shareScreen;
this.screenShareCaptureOptions = data.screenShareCaptureOptions;
this.trackPublishOptions = data.trackPublishOptions;
- if (typeof this.createLocalTracksOptions?.video !== 'boolean') {
- this.auxVideoCaptureOptions = this.createLocalTracksOptions!
- .video as VideoCaptureOptions;
- this.videoOption = 'custom';
- } else {
- this.videoOption = this.createLocalTracksOptions.video;
- this.auxVideoCaptureOptions = new Room().options.videoCaptureDefaults!;
- }
- if (typeof this.createLocalTracksOptions?.audio !== 'boolean') {
- this.auxAudioCaptureOptions = this.createLocalTracksOptions!
- .audio as AudioCaptureOptions;
- this.audioOption = 'custom';
- } else {
- this.audioOption = this.createLocalTracksOptions.audio;
- this.auxAudioCaptureOptions = new Room().options.audioCaptureDefaults!;
+ if (this.createLocalTracksOptions !== undefined) {
+ if (typeof this.createLocalTracksOptions.video !== 'boolean') {
+ this.auxVideoCaptureOptions = this.createLocalTracksOptions!
+ .video as VideoCaptureOptions;
+ this.videoOption = 'custom';
+ } else {
+ this.videoOption = this.createLocalTracksOptions.video;
+ this.auxVideoCaptureOptions = new Room().options.videoCaptureDefaults!;
+ }
+ if (typeof this.createLocalTracksOptions?.audio !== 'boolean') {
+ this.auxAudioCaptureOptions = this.createLocalTracksOptions!
+ .audio as AudioCaptureOptions;
+ this.audioOption = 'custom';
+ } else {
+ this.audioOption = this.createLocalTracksOptions.audio;
+ this.auxAudioCaptureOptions = new Room().options.audioCaptureDefaults!;
+ }
}
if (this.shareScreen) {
if (this.screenShareCaptureOptions == undefined) {
this.screenOption = false;
} else if (Object.keys(this.screenShareCaptureOptions).length > 0) {
this.screenOption = 'custom';
+ if (this.screenShareCaptureOptions.resolution) {
+ this.customScreenShareResolution = true;
+ }
} else {
this.screenOption = true;
this.screenShareCaptureOptions = {};
}
}
+ if (this.data.allowDisablingAudio === false) {
+ this.allowDisablingAudio = false;
+ }
+ if (this.data.allowDisablingVideo === false) {
+ this.allowDisablingVideo = false;
+ }
+ if (this.data.allowDisablingScreen === false) {
+ this.allowDisablingScreen = false;
+ }
}
returnValues() {
@@ -117,8 +138,21 @@ export class OptionsDialogComponent {
screenOptionChanged(event: MatRadioChange) {
if (event.value === 'custom' && !this.screenShareCaptureOptions) {
this.screenShareCaptureOptions = {
- video: true
+ video: true,
};
}
}
+
+ handleCustomScreenResolutionChange() {
+ if (this.customScreenShareResolution) {
+ if (!this.screenShareCaptureOptions!.resolution) {
+ this.screenShareCaptureOptions!.resolution = {
+ width: 1920,
+ height: 1080,
+ };
+ }
+ } else {
+ delete this.screenShareCaptureOptions!.resolution;
+ }
+ }
}
diff --git a/openvidu-testapp/src/app/components/dialogs/options-dialog/video-resolution/video-resolution.component.css b/openvidu-testapp/src/app/components/dialogs/options-dialog/video-resolution/video-resolution.component.css
new file mode 100644
index 0000000000..b81341681d
--- /dev/null
+++ b/openvidu-testapp/src/app/components/dialogs/options-dialog/video-resolution/video-resolution.component.css
@@ -0,0 +1,17 @@
+.resolution-div {
+ border: 1px solid #e0e0e0;
+ padding: 5px 5px 5px 5px;
+ border-radius: 5px;
+ width: fit-content;
+ margin-top: 8px;
+}
+
+.resolution-title {
+ margin-top: 2px;
+}
+
+mat-form-field {
+ font-size: 124x;
+ width: 100px;
+ margin-right: 4px;
+}
diff --git a/openvidu-testapp/src/app/components/dialogs/options-dialog/video-resolution/video-resolution.component.html b/openvidu-testapp/src/app/components/dialogs/options-dialog/video-resolution/video-resolution.component.html
new file mode 100644
index 0000000000..d33f5956df
--- /dev/null
+++ b/openvidu-testapp/src/app/components/dialogs/options-dialog/video-resolution/video-resolution.component.html
@@ -0,0 +1,19 @@
+
\ No newline at end of file
diff --git a/openvidu-testapp/src/app/components/dialogs/options-dialog/video-resolution/video-resolution.component.spec.ts b/openvidu-testapp/src/app/components/dialogs/options-dialog/video-resolution/video-resolution.component.spec.ts
new file mode 100644
index 0000000000..ceed70c9b8
--- /dev/null
+++ b/openvidu-testapp/src/app/components/dialogs/options-dialog/video-resolution/video-resolution.component.spec.ts
@@ -0,0 +1,21 @@
+import { ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { VideoResolutionComponent } from './video-resolution.component';
+
+describe('VideoResolutionComponent', () => {
+ let component: VideoResolutionComponent;
+ let fixture: ComponentFixture
;
+
+ beforeEach(() => {
+ TestBed.configureTestingModule({
+ declarations: [VideoResolutionComponent]
+ });
+ fixture = TestBed.createComponent(VideoResolutionComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/openvidu-testapp/src/app/components/dialogs/options-dialog/video-resolution/video-resolution.component.ts b/openvidu-testapp/src/app/components/dialogs/options-dialog/video-resolution/video-resolution.component.ts
new file mode 100644
index 0000000000..27f034ff7d
--- /dev/null
+++ b/openvidu-testapp/src/app/components/dialogs/options-dialog/video-resolution/video-resolution.component.ts
@@ -0,0 +1,30 @@
+import { Component, EventEmitter, Input, Output } from '@angular/core';
+
+@Component({
+ selector: 'app-video-resolution',
+ templateUrl: './video-resolution.component.html',
+ styleUrls: ['./video-resolution.component.css'],
+})
+export class VideoResolutionComponent {
+ @Input() componentId: string;
+ @Input() showTitle = true;
+ @Input() width: number;
+ @Input() height: number;
+ @Input() frameRate?: number;
+ @Input() aspectRatio?: number;
+ @Output() resolutionChanged: EventEmitter<{
+ width: number;
+ height: number;
+ frameRate?: number;
+ aspectRatio?: number;
+ }> = new EventEmitter();
+
+ emitChanges() {
+ this.resolutionChanged.emit({
+ width: this.width,
+ height: this.height,
+ frameRate: this.frameRate,
+ aspectRatio: this.aspectRatio,
+ });
+ }
+}
diff --git a/openvidu-testapp/src/app/components/openvidu-instance/openvidu-instance.component.html b/openvidu-testapp/src/app/components/openvidu-instance/openvidu-instance.component.html
index b3bc3acedc..7e2325be10 100644
--- a/openvidu-testapp/src/app/components/openvidu-instance/openvidu-instance.component.html
+++ b/openvidu-testapp/src/app/components/openvidu-instance/openvidu-instance.component.html
@@ -83,10 +83,10 @@