mirror of https://github.com/OpenVidu/openvidu.git
ov-components: refactor screen share options for improved functionality and clarity
parent
03962d21df
commit
1d49017f41
|
@ -378,19 +378,10 @@ export class ParticipantModel {
|
||||||
*/
|
*/
|
||||||
setScreenShareEnabled(
|
setScreenShareEnabled(
|
||||||
enabled: boolean,
|
enabled: boolean,
|
||||||
options?: ScreenShareCaptureOptions,
|
options: ScreenShareCaptureOptions,
|
||||||
publishOptions?: TrackPublishOptions
|
publishOptions?: TrackPublishOptions
|
||||||
): Promise<LocalTrackPublication | undefined> {
|
): Promise<LocalTrackPublication | undefined> {
|
||||||
if (this.participant instanceof LocalParticipant) {
|
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 this.participant.setScreenShareEnabled(enabled, options, publishOptions);
|
||||||
}
|
}
|
||||||
return Promise.reject("Remote participant can't enable screen share");
|
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
|
* 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').
|
* @param source The source of the track to be pinned or unpinned (e.g., 'camera', 'screenShare').
|
||||||
|
|
|
@ -548,10 +548,11 @@ export class ParticipantService {
|
||||||
},
|
},
|
||||||
systemAudio: 'include', // Include system audio as an option
|
systemAudio: 'include', // Include system audio as an option
|
||||||
resolution: VideoPresets.h1080.resolution,
|
resolution: VideoPresets.h1080.resolution,
|
||||||
contentHint: 'detail', // Optimized for detailed content, adjust based on use case
|
contentHint: 'text', // Optimized for detailed content, adjust based on use case
|
||||||
suppressLocalAudioPlayback: true,
|
suppressLocalAudioPlayback: true, // Prevent echo by not playing local audio
|
||||||
selfBrowserSurface: 'exclude', // Avoid self capture to prevent mirror effect
|
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
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue