enableScreenSharing method
- bool enable, {
- DesktopCapturerSource? desktopCapturerSource,
- bool useIOSBroadcasting = false,
- bool requestAudioForScreenSharing = false,
Enables/disables the Screen Sharing feature.
enable
- true
- for enabling Screen Sharing or false
- for disabling.
desktopCapturerSource
- the desktop capturer source, if it is null
the
default Window/Screen will be captured. Use only for desktop platforms.
Use ScreenSelectDialog to give the user a choice of the shared Window/Screen.
useIOSBroadcasting
- set true
if the Broadcast Upload Extension
was
added to your iOS project for implementation Screen Sharing feature, otherwise
set false
and in-app
Screen Sharing will be started. Used for iOS platform only.
See our step-by-step guide
on how to integrate the Screen Broadcasting feature into your iOS app.
requestAudioForScreenSharing
- set true
if need to request the audio
stream from your Audio input device, otherwise the Screen Sharing will be
requested without an audio
Implementation
@override
Future<void> enableScreenSharing(
bool enable, {
DesktopCapturerSource? desktopCapturerSource,
bool useIOSBroadcasting = false,
bool requestAudioForScreenSharing = false,
}) {
this.desktopCapturerSource = desktopCapturerSource;
this.useIOSBroadcasting = useIOSBroadcasting;
this.requestAudioForScreenSharing = requestAudioForScreenSharing;
return _createStream(enable).then((mediaStream) {
return replaceMediaStream(mediaStream);
});
}