View screen shares from other participants during a call. The Android SDK can receive and display screen shares initiated from web clients.
The Android Calls SDK does not support initiating screen sharing. Screen sharing can only be started from web clients. Android participants can view shared screens.
How It Works
When a web participant starts screen sharing:
- The SDK receives the screen share stream
- The call layout automatically adjusts to display the shared screen prominently
- Android participants can view the shared content
Listen for Screen Share Events
Monitor when participants start or stop screen sharing:
val callSession = CallSession.getInstance()
callSession.addParticipantEventListener(this, object : ParticipantEventListener() {
override fun onParticipantStartedScreenShare(participant: Participant) {
Log.d(TAG, "${participant.name} started screen sharing")
// Layout automatically adjusts to show shared screen
}
override fun onParticipantStoppedScreenShare(participant: Participant) {
Log.d(TAG, "${participant.name} stopped screen sharing")
// Layout returns to normal view
}
// Other callbacks...
override fun onParticipantJoined(participant: Participant) {}
override fun onParticipantLeft(participant: Participant) {}
override fun onParticipantListChanged(participants: List<Participant>) {}
override fun onParticipantAudioMuted(participant: Participant) {}
override fun onParticipantAudioUnmuted(participant: Participant) {}
override fun onParticipantVideoPaused(participant: Participant) {}
override fun onParticipantVideoResumed(participant: Participant) {}
override fun onParticipantStartedRecording(participant: Participant) {}
override fun onParticipantStoppedRecording(participant: Participant) {}
override fun onParticipantHandRaised(participant: Participant) {}
override fun onParticipantHandLowered(participant: Participant) {}
override fun onDominantSpeakerChanged(participant: Participant) {}
})
CallSession callSession = CallSession.getInstance();
callSession.addParticipantEventListener(this, new ParticipantEventListener() {
@Override
public void onParticipantStartedScreenShare(Participant participant) {
Log.d(TAG, participant.getName() + " started screen sharing");
// Layout automatically adjusts to show shared screen
}
@Override
public void onParticipantStoppedScreenShare(Participant participant) {
Log.d(TAG, participant.getName() + " stopped screen sharing");
// Layout returns to normal view
}
// Other callbacks...
});
Check Screen Share Status
Use the isPresenting property on the Participant object to check if someone is sharing their screen:
callSession.addParticipantEventListener(this, object : ParticipantEventListener() {
override fun onParticipantListChanged(participants: List<Participant>) {
val presenter = participants.find { it.isPresenting }
if (presenter != null) {
Log.d(TAG, "${presenter.name} is currently sharing their screen")
}
}
})
callSession.addParticipantEventListener(this, new ParticipantEventListener() {
@Override
public void onParticipantListChanged(List<Participant> participants) {
for (Participant p : participants) {
if (p.isPresenting()) {
Log.d(TAG, p.getName() + " is currently sharing their screen");
break;
}
}
}
});