Skip to main content
Version: 0.0.x

Share Your Screen

Whenever any participant wants to share mobile screen, they can simply do it with VideoSDK Meeting.

For Mobile Devices a complete screen will be share.

This guide will provide an overview of how to use enable and disable Screen Share in a meeting.

  1. Enable Screen Share - By using enableScreenShare() function, a participant can publish screen stream to other participants.
  2. Disable Screen Share - By using disableScreenShare() function, a participant can stop publishing screen stream to other participants.

Enable, Disable Screen Share

const onPress = () => {
// Enabling ScreenShare
meeting?.enableScreenShare();

// Disabling ScreenShare
meeting?.disableScreenShare();
};
caution

For React Native iOS Screen Share feature, you need to follow this guide React Native iOS Screen Share

Events

Events associated with enableScreenShare():

Events associated with disableScreenShare():

function onStreamEnabled(stream) {
if(stream.kind === 'share'){
console.log("Screen Share Stream On: onStreamEnabled", stream);
}
}

function onStreamDisabled(stream) {
if(stream.kind === 'share'){
console.log("Screen Share Stream Off: onStreamDisabled", stream);
}
}

const {
displayName
...
} = useParticipant(participantId,{
onStreamEnabled,
onStreamDisabled,
...
});

function onPresenterChanged(presenterId) {
console.log(" onPresenterChanged", presenterId);
}

const {
meetingId
...
} = useMeeting({
onPresenterChanged,
...
});