ov-components: refactor screen share options for improved functionality and clarity

master
Carlos Santos 2025-09-08 12:23:31 +02:00
parent 03962d21df
commit 1d49017f41
2 changed files with 5 additions and 14 deletions

View File

@ -378,19 +378,10 @@ export class ParticipantModel {
*/
setScreenShareEnabled(
enabled: boolean,
options?: ScreenShareCaptureOptions,
options: ScreenShareCaptureOptions,
publishOptions?: TrackPublishOptions
): Promise<LocalTrackPublication | undefined> {
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').

View File

@ -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
};
}
}