The screen sharing function allows a host to share their screen during a live event. The host can select a specific app or window on their device and share it while media streaming.
This function is especially useful for showing demonstrations, presentations or any other application that requires sharing the host's screen.
A host can start screen share by calling
startScreenShare() as shown below. When the host starts sharing the screen, a dialog box will appear to ask the host to grant permissions to share the selected app or window. The host's video view will lay on top of the shared screen and the host can choose where to place their own video view.
The host can stop screen share by calling
stopScreenShare() as shown below. When screen share ends, the video stream will switch back to the host's video view.
The host can set the screen share options by calling
setScreenShareOptions() as shown below. This method can be called either before or during the screen sharing.