I have the below code, and when I call StartSharing() after a meeting has started,
and a participant has joined, setExternalShareSource() always succeeds, but onStartSend()
is called very rarely - only around 1% of the time is the callback is called.
I am not sure what I am doing wrong.
In a different approach to test this, I called StartSharing() from the onMeetingStatusChanged callback, and when meeting status is MEETING_STATUS_INMEETING, then it works reliably - i.e. the
onStartSend() gets called. Of course, this is before any participant joined the meeting.
However I want to start the sharing only after a participant joins, and in this case it is not working reliably at all.
Please let me know if you need more details.
Thanks!
For these actions, typically you want to call them after the SDK has successfully joined the meeting, and in this case MEETING_STATUS_INMEETING lets you know that the SDK has successfully joined.
If you want to only start sharing when someone has joined, you might want to consider taking a look at onUserJoin event
You can also check the status of the SDK by directly calling GetMeetingStatus method
@chunsiong.zoom , the issue is that we need to start/stop the sharing at any random point in time while the meeting is in progress, not dependent on user join or another event.
So I am wondering if setExternalSource returns no error then why isn’t the onStartSend being called 100% of the time?
I’m doing something like this. Do note that the garbage collection has not been completed yet. Everytime you stop a sharescreen, you should destroy / deference the objects, so that the next sharescreen won’t be affected by existing objects in memory.
void attemptToStartSendingShareScreenRaw() {
virtual_share_source = new ZoomSDKShareSource(video_source);
IZoomSDKShareSourceHelper* pShareSourceHelper = GetRawdataShareSourceHelper();
if (pShareSourceHelper)
{
SDKError err = pShareSourceHelper->setExternalShareSource(virtual_share_source);
if (err != SDKERR_SUCCESS) {
printf("Error occurred: %d\n", err);
//handle error
}
else {
printf("successfully set virtual share source...\n");
}
}
}