While screen sharing using component view in our react application screen size changes.
CODE:
const getZoomViewSizes = () => {
if (width > 980) {
return { width: 752, height: 424 };
} else if (width > 688) {
return { width: 560, height: 316 };
}
return { width: 358, height: 201 };
};
function startMeeting(signature) {
setShowJoinMeeting(false);
const client = ZoomMtgEmbedded.createClient();
const meetingSDKElement = document.getElementById(‘meetingSDKElement’);
const joinConfig = {
signature: signature,
sdkKey: config.zoom.SDK_KEY,
meetingNumber: meeting_id,
password: meeting_pwd,
userName: kimo.name,
};
if (kimo.email) {
joinConfig['userEmail'] = kimo.email;
}
client
.init({
zoomAppRoot: meetingSDKElement,
language: 'en-US',
patchJsMedia: true,
customize: {
video: {
viewSizes: { default: getZoomViewSizes() },
isResizable: true,
},
},
})
.then(() => {
client
.join(joinConfig)
.then(() => {
console.log('joined successfully');
})
.catch((error) => {
console.log(error);
});
})
.catch((error) => {
console.log(error);
});
}