IsDirectShareInProgress return false while direct sharing

I’m trying to check if user is in direct sharing.

I set isdirectsharedesktop to true in JoinMeeting, then calling IsDirectShareInProgress after meeting status is 3 and result is 0, it always return “false”.
I’m pretty sure I’m in direct sharing mode and even calling IsDirectShareInProgress 20secs after inmeeting but got the same result.
I thought it will return true if I’m direct sharing my desktop.

I have also tried IsDisplayingShareViewOrVideo but this always return “true” no matter I’m sharing screen or not.

Please suggest if I’m using the wrong method or I misunderstand these methods.
Sorry if similar question has already been asked or it’s a really basic problem…
Thank you very much.

Hi duochang,

Thanks for the post. Direct share is a little bit different from the sharing screen, direct share means start sharing right after the meeting has started.

Below is a brief guide to start direct sharing on with Windows SDK:
Step 1: Set isDirectShareDesktop to be true in the start or join meeting parameter
Step 2: Based on your scenario, configure the hDirectShareAppWnd

  • To Share an app: 1. Use the system API to retrieve the window handle of the corresponding app, and assign it to hDirectShareAppWnd.
    • To share a monitor
  1. Set hDirectShareAppWnd to NULL
  2. Use the system API EnumDisplayMonitors() to get the ID of the monitor that you would like to share.
  3. Use the interface IMeetingConfiguration.SetDirectShareMonitorID() and pass the monitor ID to tell SDK the monitor you would like to share.
    Step 3: Start or join a meeting

The concept is the same on both Windows SDK and Electron SDK on Windows, hope this helps.

Thanks!

@carson.zoom

Dear Carson,

Thank you for your quick reply but it’s not actually what I need.
Sorry I think I make it ambiguous…
What I need is checking whether user is direct sharing the screen or not.
Wanna find a method which give me the sharing status: sharing or not sharing.

My scenario:

  1. start the app
  2. auto enter a meeting number
  3. auto direct share the screen
  4. shut down the app

These 4 steps works good but if user open the app again and get into the same meeting after shut down,user is unable to share the screen as seems to be regarded as never left the meeting. Therefore; I want to detect if the user is sharing the screen/share screen successful, if it’s not, I’ll call method leave meeting and relaunch the app and user shall able to share the screen.

Looking forward to your reply and appreciate your patient!

Hi duochang,

Thanks for the reply and for providing the details. When you say “Shut down the app”, do you mean the user left the meeting without a normal process? Such as using the system command to kill the meeting app while the user is still in the meeting?

To detect whether there is anyone is sharing or not, you may use the callback onSharingStatus and the status list can be found here: https://github.com/zoom/zoom-sdk-electron/blob/37353b270c4a9f3d0d33db915708aa76dac36726/lib/node_add_on/win/h/meeting_service_components/meeting_sharing_interface.h#L15

Hope this helps. Thanks!

Dear @carson.zoom,

Really appreciate your help!
Yes, I mean user left the meeting without a normal process with system command killing the meeting app while still in meeting & sharing.
I found if user restart the app within 5 mins, user is unable to share the desktop again, seems similar like below issue.
Please suggest if zoom-sdk-electron have the same issue as zoom-sdk-web.
I’m wondering if I can detect sharing status and stop previous sharing before user start to share the desktop.
Thank you!

Hi duochang,

Thanks for the reply. When a user leaves a meeting by pressing the “leave” button or calling the leave method, we will tell the server that this user is leaving. When the user leaves the meeting without a normal process(such as using system command), then the server will not know immediately that the user has left. It will take some time for the server to identify the real situation and update the status. This behavior is the same across all SDKs.

Hope this helps. Thanks!

1 Like