enableScreenShare

fun enableScreenShare(customTrack: CustomStreamTrack, enableAudio: Boolean)

This method can be used to enable screen sharing for the local participant using a custom stream track.

Events:

  • onStreamEnabled — emitted on all participants when the screen-share stream is enabled
  • onPresenterChanged — emitted on all participants with the presenter's participant ID

Requires a joined meeting. Called before join completes (error code 3001) or while the meeting is reconnecting (error code 3014), the call emits onError locally and releases customTrack: screen capture and the screen-share service are stopped and the track is disposed, so it cannot be reused afterwards.

Code Example:


meeting.enableScreenShare(customScreenTrack, true)

Parameters

customTrack

the CustomStreamTrack to use as the screen share source

enableAudio

true to share audio along with the screen, false otherwise