setScreenShareEnabled

suspend fun setScreenShareEnabled(enabled: Boolean, screenCaptureParams: ScreenCaptureParams? = null): Boolean

If set to enabled, creates and publishes a screenshare video track.

If set to disabled, unpublishes the screenshare video track.

This will use capture and publish default options from Room.

For screenshare audio, a ScreenAudioCapturer can be used.

If a screen capture track is created but enabling fails or is cancelled, the capture is stopped and released, and ScreenCaptureParams.onStop is invoked.

Return

true if the change was successful, or false if it failed.

Parameters

screenCaptureParams

When enabling the screenshare, this must be provided with ScreenCaptureParams.mediaProjectionPermissionResultData containing resultData returned from launching MediaProjectionManager.createScreenCaptureIntent().

See also

Throws

if attempting to enable screenshare without screenCaptureParams