From 1d49017f41a506f6ba4738caab060dd62fc9dcf7 Mon Sep 17 00:00:00 2001 From: Carlos Santos <4a.santos@gmail.com> Date: Mon, 8 Sep 2025 12:23:31 +0200 Subject: [PATCH] ov-components: refactor screen share options for improved functionality and clarity --- .../src/lib/models/participant.model.ts | 12 +----------- .../lib/services/participant/participant.service.ts | 7 ++++--- 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/openvidu-components-angular/projects/openvidu-components-angular/src/lib/models/participant.model.ts b/openvidu-components-angular/projects/openvidu-components-angular/src/lib/models/participant.model.ts index 9cfdd1e9..c920b009 100644 --- a/openvidu-components-angular/projects/openvidu-components-angular/src/lib/models/participant.model.ts +++ b/openvidu-components-angular/projects/openvidu-components-angular/src/lib/models/participant.model.ts @@ -378,19 +378,10 @@ export class ParticipantModel { */ setScreenShareEnabled( enabled: boolean, - options?: ScreenShareCaptureOptions, + options: ScreenShareCaptureOptions, publishOptions?: TrackPublishOptions ): Promise { if (this.participant instanceof LocalParticipant) { - if (!options) { - options = { - audio: false, - resolution: VideoPresets.h1080.resolution, - suppressLocalAudioPlayback: true, - selfBrowserSurface: 'include', - surfaceSwitching: 'include' - }; - } return this.participant.setScreenShareEnabled(enabled, options, publishOptions); } return Promise.reject("Remote participant can't enable screen share"); @@ -507,7 +498,6 @@ export class ParticipantModel { } } - /** * Sets all video track elements from a specific source to pinned or unpinned given a boolean value * @param source The source of the track to be pinned or unpinned (e.g., 'camera', 'screenShare'). diff --git a/openvidu-components-angular/projects/openvidu-components-angular/src/lib/services/participant/participant.service.ts b/openvidu-components-angular/projects/openvidu-components-angular/src/lib/services/participant/participant.service.ts index 65ed7b2b..0e3d0106 100644 --- a/openvidu-components-angular/projects/openvidu-components-angular/src/lib/services/participant/participant.service.ts +++ b/openvidu-components-angular/projects/openvidu-components-angular/src/lib/services/participant/participant.service.ts @@ -548,10 +548,11 @@ export class ParticipantService { }, systemAudio: 'include', // Include system audio as an option resolution: VideoPresets.h1080.resolution, - contentHint: 'detail', // Optimized for detailed content, adjust based on use case - suppressLocalAudioPlayback: true, + contentHint: 'text', // Optimized for detailed content, adjust based on use case + suppressLocalAudioPlayback: true, // Prevent echo by not playing local audio selfBrowserSurface: 'exclude', // Avoid self capture to prevent mirror effect - surfaceSwitching: 'include' // Allow users to switch shared tab dynamically + surfaceSwitching: 'include', // Allow users to switch shared tab dynamically + preferCurrentTab: false // Do not force current tab to be selected }; } }