Skip to content

Sharing screen

DengQiming edited this page Sep 7, 2018 · 3 revisions

Spark SDK provide a function to share the whole screen of your Android mobile device in a call, including both p2p call and group call.

Start Sharing Screen

activeCall.startSharing(r -> Ln.d("startSharing result: " + r));

NOTE:

  1. If the call is not in CONNECTED status or you have already shared screen in this call, the callback of startSharing() method will receive an error.
  2. At the first time of request to share screen, Android system will popup the following alert dialog to warn user the whole screen will be captured. Once the "Don't show again" box is checked, it will no longer be shown again. share-content-warning

Stop Sharing Screen

activeCall.stopSharing(r -> Ln.d("stopSharing result: " + r));

After successfully start/stop screen sharing, the SendingSharingEvent will be sent out through CallObserver.onMediaChanged() callback, whose isSending() method will return corresponding true/false.

Whether is Sharing Screen or not

boolean isSharing = activeCall.isSendingSharing();