Howto get my own user id?

Hi, I’m still deciding between using Electron or C#, but question remains the same.

Once I join the meeting, I can list all the participants. But how can I know which participant is me? Currently I’m checking the user name, but that’s not a good solution IMO.

Thanks,
Sam

Hi Sam,

Thanks for the post. It seems like you are selecting SDKs for Windows platform. To get your own user info, it is the same for both C# wrapper and Electron SDK on Windows, use the GetUserByUserID() and pass 0 as the userID to get your own user info(https://zoom.github.io/zoom-sdk-windows/class_i_meeting_participants_controller.html#afa0887b5e66feb3204338a3260129989).

Hope this helps. Thanks!

Hmm, I think I tried this on the Electron app for MacOS and that it didn’t work. Will try it with the C# SDK which I’m currently using.

Ok. It works:

var me = participantsController.GetUserByUserID(0);
Console.WriteLine("I am user id: " + me.GetUserID() + ", name: " + me.GetUserNameW());
Console.WriteLine("Muting myself. ");
videoController.MuteVideo();
audioController.MuteAudio(me.GetUserID(), true);

I think I tried muting myself with userId = 0, but that didn’t work off course:

audioController.MuteAudio(0, true);

HI @sam.decrock,

calling GetUserByUserID(0) works, but beware of this.

Another option is to get the list of participant Ids and call GetUserByUserID on each, then looking for the “IsMyself” property.

1 Like

Thanks for the heads up. I’m skipping my own id anyway when looping over the participants list.

Using IsMyself is easier though, thanks @bragma !

@bragma Thanks for helping out!

Hi @sam.decrock, yes, as bragma mentioned, you may use the isMySelf to check whether the current information belongs to yourself:

Hope this helps. Thanks!