private void Application_Startup(object sender, StartupEventArgs e) { //init sdk { ZOOM_SDK_DOTNET_WRAP.InitParam param = new ZOOM_SDK_DOTNET_WRAP.InitParam(); param.web_domain = "https://jworg.zoom.us"; ZOOM_SDK_DOTNET_WRAP.SDKError err = CZoomSDKeDotNetWrap.Instance.Initialize(param); if (SDKError.SDKERR_SUCCESS == err) { Console.WriteLine("SDK loaded"); var key = ConfigurationManager.AppSettings["zoomkey"]; var secret = ConfigurationManager.AppSettings["zoomsecret"]; var authparams = new AuthParam() { appKey = key, appSecret = secret }; ZOOM_SDK_DOTNET_WRAP.SDKError autherr = CZoomSDKeDotNetWrap.Instance.GetAuthServiceWrap().SDKAuth(authparams); if (autherr == SDKError.SDKERR_SUCCESS) { Console.WriteLine("APi auth success"); } } else//error handle.todo { Console.WriteLine(err); Console.WriteLine("Sdk loading failed"); } } }
private void button_join_api_Click(object sender, RoutedEventArgs e) { RegisterCallBack(); ZOOM_SDK_DOTNET_WRAP.JoinParam param = new ZOOM_SDK_DOTNET_WRAP.JoinParam(); param.userType = ZOOM_SDK_DOTNET_WRAP.SDKUserType.SDK_UT_WITHOUT_LOGIN; ZOOM_SDK_DOTNET_WRAP.JoinParam4WithoutLogin join_api_param = new ZOOM_SDK_DOTNET_WRAP.JoinParam4WithoutLogin(); join_api_param.meetingNumber = 4186893292; join_api_param.userName = textBox_username_api.Text; param.withoutloginJoin = join_api_param; ZOOM_SDK_DOTNET_WRAP.SDKError err = ZOOM_SDK_DOTNET_WRAP.CZoomSDKeDotNetWrap.Instance.GetMeetingServiceWrap().Join(param); if (ZOOM_SDK_DOTNET_WRAP.SDKError.SDKERR_SUCCESS == err) { Hide(); var res = ZOOM_SDK_DOTNET_WRAP.CZoomSDKeDotNetWrap.Instance.GetAudioRawDataChannelWrap().Start(RawDataMemoryMode.RawDataMemoryMode_Stack, new TestReceiver()); Console.WriteLine($"Raw data channel start with {res}"); CZoomSDKeDotNetWrap.Instance.GetMeetingServiceWrap().GetMeetingAudioController() .Add_CB_onUserActiveAudioChange((list) => { if (list == null || list.Length == 0) { return; } var users = list.Select(userId => CZoomSDKeDotNetWrap.Instance.GetMeetingServiceWrap().GetMeetingParticipantsController().GetUserByUserID(userId)); var usernames = users.Select(u => u.GetUserNameW()); Console.WriteLine($"Active speakers: {string.Join(" ", usernames)}"); }); } else//error handle { } }
private void Application_Startup(object sender, StartupEventArgs e) { //init sdk { ZOOM_SDK_DOTNET_WRAP.InitParam param = new ZOOM_SDK_DOTNET_WRAP.InitParam(); param.web_domain = "https://zoom.us"; ZOOM_SDK_DOTNET_WRAP.SDKError err = ZOOM_SDK_DOTNET_WRAP.CZoomSDKeDotNetWrap.Instance.Initialize(param); if (ZOOM_SDK_DOTNET_WRAP.SDKError.SDKERR_SUCCESS == err) { //register callbacks CZoomSDKeDotNetWrap.Instance.GetAuthServiceWrap().Add_CB_onAuthenticationReturn(onAuthenticationReturn); CZoomSDKeDotNetWrap.Instance.GetAuthServiceWrap().Add_CB_onLoginRet(onLoginRet); CZoomSDKeDotNetWrap.Instance.GetAuthServiceWrap().Add_CB_onLogout(onLogout); AuthParam authParam = new AuthParam { appKey = ConfigurationManager.AppSettings.Get("appKey"), appSecret = ConfigurationManager.AppSettings.Get("appSecret") }; var sdkError = ZOOM_SDK_DOTNET_WRAP.CZoomSDKeDotNetWrap.Instance.GetAuthServiceWrap().SDKAuth(authParam); if (sdkError != SDKError.SDKERR_SUCCESS) { MessageBox.Show("Failed to connect: " + sdkError.ToString()); Current.Shutdown(); } } else { MessageBox.Show("Failed to initialise: " + err.ToString()); Current.Shutdown(); } } }
private void btn_ShareFromeHome_Click(object sender, RoutedEventArgs e) { if (!shared) { //ZOOM_SDK_DOTNET_WRAP.SDKError err = ZOOM_SDK_DOTNET_WRAP.CZoomSDKeDotNetWrap.Instance.GetMeetingServiceWrap().GetMeetingShareController().ShowShareOptionDialog(); ZOOM_SDK_DOTNET_WRAP.SDKError err = ZOOM_SDK_DOTNET_WRAP.CZoomSDKeDotNetWrap.Instance.GetMeetingServiceWrap().GetMeetingShareController().StartAirPlayShare(); } }
private void button_join_api_Click(object sender, RoutedEventArgs e) { if (textBox_DisplayName.Text.Length == 0) { MessageBox.Show("Please fill in a display name", "Error", MessageBoxButton.OK, MessageBoxImage.Warning); return; } if (settings.Participants.Count > 1) { this.userName = $"{textBox_DisplayName.Text} x {settings.Participants.Count}"; } else { this.userName = $"{textBox_DisplayName.Text}"; } ZOOM_SDK_DOTNET_WRAP.JoinParam param = new ZOOM_SDK_DOTNET_WRAP.JoinParam(); param.userType = ZOOM_SDK_DOTNET_WRAP.SDKUserType.SDK_UT_WITHOUT_LOGIN; ZOOM_SDK_DOTNET_WRAP.JoinParam4WithoutLogin join_api_param = new ZOOM_SDK_DOTNET_WRAP.JoinParam4WithoutLogin(); join_api_param.meetingNumber = UInt64.Parse(textBox_meetingnumber_api.Text); join_api_param.userName = this.userName; join_api_param.isAudioOff = true; join_api_param.isVideoOff = true; param.withoutloginJoin = join_api_param; ZOOM_SDK_DOTNET_WRAP.SDKError err = ZOOM_SDK_DOTNET_WRAP.CZoomSDKeDotNetWrap.Instance.GetMeetingServiceWrap().Join(param); if (ZOOM_SDK_DOTNET_WRAP.SDKError.SDKERR_SUCCESS == err) { Hide(); } else//error handle { } if (SDKError.SDKERR_SUCCESS == err) { feedback.Content = $"Joining Meeting {textBox_meetingnumber_api.Text}: {err}"; Hide(); } else//error handle { feedback.Content = $"Failed to join meeting {textBox_meetingnumber_api.Text}: {err}"; Console.WriteLine(err); } }
private void Application_Startup(object sender, StartupEventArgs e) { //init sdk { ZOOM_SDK_DOTNET_WRAP.InitParam param = new ZOOM_SDK_DOTNET_WRAP.InitParam(); param.web_domain = "https://zoom.us"; ZOOM_SDK_DOTNET_WRAP.SDKError err = ZOOM_SDK_DOTNET_WRAP.CZoomSDKeDotNetWrap.Instance.Initialize(param); if (ZOOM_SDK_DOTNET_WRAP.SDKError.SDKERR_SUCCESS == err) { } else//error handle.todo { } } }
private void button_join_api_Click(object sender, RoutedEventArgs e) { RegisterCallBack(); ZOOM_SDK_DOTNET_WRAP.JoinParam param = new ZOOM_SDK_DOTNET_WRAP.JoinParam(); param.userType = ZOOM_SDK_DOTNET_WRAP.SDKUserType.SDK_UT_APIUSER; ZOOM_SDK_DOTNET_WRAP.JoinParam4APIUser join_api_param = new ZOOM_SDK_DOTNET_WRAP.JoinParam4APIUser(); join_api_param.meetingNumber = UInt64.Parse(textBox_meetingnumber_api.Text); join_api_param.userName = textBox_username_api.Text; param.apiuserJoin = join_api_param; ZOOM_SDK_DOTNET_WRAP.SDKError err = ZOOM_SDK_DOTNET_WRAP.CZoomSDKeDotNetWrap.Instance.GetMeetingServiceWrap().Join(param); if (ZOOM_SDK_DOTNET_WRAP.SDKError.SDKERR_SUCCESS == err) { Hide(); } else//error handle { } }
private void btn_JoinAndRedirShareFromeHome_Click(object sender, RoutedEventArgs e) { RegisterCallBack(); ZOOM_SDK_DOTNET_WRAP.JoinParam param = new ZOOM_SDK_DOTNET_WRAP.JoinParam(); param.userType = ZOOM_SDK_DOTNET_WRAP.SDKUserType.SDK_UT_APIUSER; ZOOM_SDK_DOTNET_WRAP.JoinParam4APIUser join_api_param = new ZOOM_SDK_DOTNET_WRAP.JoinParam4APIUser(); join_api_param.meetingNumber = UInt64.Parse(MeetingId.Text); join_api_param.userName = "******"; param.apiuserJoin = join_api_param; ZOOM_SDK_DOTNET_WRAP.SDKError err = ZOOM_SDK_DOTNET_WRAP.CZoomSDKeDotNetWrap.Instance.GetMeetingServiceWrap().Join(param); if (ZOOM_SDK_DOTNET_WRAP.SDKError.SDKERR_SUCCESS == err) { //Hide(); shared = false; } else//error handle { } }
private void button_join_api_Click(object sender, RoutedEventArgs e) { RegisterCallBack(); ZOOM_SDK_DOTNET_WRAP.JoinParam param = new ZOOM_SDK_DOTNET_WRAP.JoinParam(); param.userType = ZOOM_SDK_DOTNET_WRAP.SDKUserType.SDK_UT_WITHOUT_LOGIN; ZOOM_SDK_DOTNET_WRAP.JoinParam4WithoutLogin join_api_param = new ZOOM_SDK_DOTNET_WRAP.JoinParam4WithoutLogin(); var meetingnumber_nospaces = textBox_meetingnumber_api.Text.Replace(" ", ""); join_api_param.meetingNumber = UInt64.Parse(meetingnumber_nospaces); join_api_param.userName = textBox_username_api.Text; param.withoutloginJoin = join_api_param; ZOOM_SDK_DOTNET_WRAP.SDKError err = ZOOM_SDK_DOTNET_WRAP.CZoomSDKeDotNetWrap.Instance.GetMeetingServiceWrap().Join(param); if (ZOOM_SDK_DOTNET_WRAP.SDKError.SDKERR_SUCCESS == err) { Hide(); } else//error handle { } }
private void JoinRoom(string meetingId) { RegisterCallBack(); ZOOM_SDK_DOTNET_WRAP.JoinParam param = new ZOOM_SDK_DOTNET_WRAP.JoinParam(); param.userType = ZOOM_SDK_DOTNET_WRAP.SDKUserType.SDK_UT_WITHOUT_LOGIN; ZOOM_SDK_DOTNET_WRAP.JoinParam4WithoutLogin join_api_param = new ZOOM_SDK_DOTNET_WRAP.JoinParam4WithoutLogin(); join_api_param.meetingNumber = UInt64.Parse(meetingId); join_api_param.userName = "******"; param.withoutloginJoin = join_api_param; // Settings to disable video and audio on join and minimize screen ZOOM_SDK_DOTNET_WRAP.CZoomSDKeDotNetWrap.Instance.GetSettingServiceWrap() .GetVideoSettings().EnableAutoTurnOffVideoWhenJoinMeeting(true); ZOOM_SDK_DOTNET_WRAP.CZoomSDKeDotNetWrap.Instance.GetSettingServiceWrap() .GetAudioSettings().EnableAutoJoinAudio(true); ZOOM_SDK_DOTNET_WRAP.SDKError err = ZOOM_SDK_DOTNET_WRAP.CZoomSDKeDotNetWrap.Instance.GetMeetingServiceWrap().Join(param); if (ZOOM_SDK_DOTNET_WRAP.SDKError.SDKERR_SUCCESS == err) { _receiver = new RevAudioReceiver(); var res = ZOOM_SDK_DOTNET_WRAP.CZoomSDKeDotNetWrap.Instance.GetAudioRawDataChannelWrap().Start(RawDataMemoryMode.RawDataMemoryMode_Stack, _receiver); Console.WriteLine($"Raw data channel start with {res}"); //CZoomSDKeDotNetWrap.Instance.GetMeetingServiceWrap().GetMeetingAudioController() // .Add_CB_onUserActiveAudioChange((list) => // { // if (list == null || list.Length == 0) // { // return; // } // var users = list.Select(userId => CZoomSDKeDotNetWrap.Instance.GetMeetingServiceWrap().GetMeetingParticipantsController().GetUserByUserID(userId)); // var usernames = users.Select(u => u.GetUserNameW()); // Console.WriteLine($"Active speakers: {string.Join(" ", usernames)}"); // }); } else//error handle { } }
private void button_start_api_Click(object sender, RoutedEventArgs e) { RegisterCallBack(); ZOOM_SDK_DOTNET_WRAP.StartParam param = new ZOOM_SDK_DOTNET_WRAP.StartParam(); param.userType = ZOOM_SDK_DOTNET_WRAP.SDKUserType.SDK_UT_WITHOUT_LOGIN; ZOOM_SDK_DOTNET_WRAP.StartParam4WithoutLogin start_withoutlogin_param = new ZOOM_SDK_DOTNET_WRAP.StartParam4WithoutLogin(); start_withoutlogin_param.meetingNumber = UInt64.Parse(textBox_meetingnumber_api.Text); start_withoutlogin_param.userID = textBox_userid_api.Text; start_withoutlogin_param.userZAK = textBox_AccessToken.Text; start_withoutlogin_param.userName = "******"; start_withoutlogin_param.zoomuserType = ZOOM_SDK_DOTNET_WRAP.ZoomUserType.ZoomUserType_APIUSER; param.withoutloginStart = start_withoutlogin_param; ZOOM_SDK_DOTNET_WRAP.SDKError err = ZOOM_SDK_DOTNET_WRAP.CZoomSDKeDotNetWrap.Instance.GetMeetingServiceWrap().Start(param); if (ZOOM_SDK_DOTNET_WRAP.SDKError.SDKERR_SUCCESS == err) { Hide(); } else//error handle { } }
private void button_start_api_Click(object sender, RoutedEventArgs e) { ZOOM_SDK_DOTNET_WRAP.StartParam param = new ZOOM_SDK_DOTNET_WRAP.StartParam(); param.userType = ZOOM_SDK_DOTNET_WRAP.SDKUserType.SDK_UT_NORMALUSER; ZOOM_SDK_DOTNET_WRAP.StartParam4NormalUser start_normal_param = new ZOOM_SDK_DOTNET_WRAP.StartParam4NormalUser(); if (settings.Participants.Count > 1) { this.userName = $"{textBox_DisplayName.Text} x {settings.Participants.Count}"; } else { this.userName = $"{textBox_DisplayName.Text}"; } start_normal_param.meetingNumber = UInt64.Parse(textBox_meetingnumber_api.Text.Replace("-", "").Replace(" ", "")); start_normal_param.participantId = this.userName; start_normal_param.isAudioOff = false; start_normal_param.isVideoOff = true; start_normal_param.isDirectShareDesktop = false; param.normaluserStart = start_normal_param; ZOOM_SDK_DOTNET_WRAP.SDKError err = ZOOM_SDK_DOTNET_WRAP.CZoomSDKeDotNetWrap.Instance.GetMeetingServiceWrap().Start(param); if (SDKError.SDKERR_SUCCESS == err) { feedback.Content = $"Starting Meeting {textBox_meetingnumber_api.Text}: {err}"; Hide(); } else//error handle { feedback.Content = $"Failed to start meeting {textBox_meetingnumber_api.Text}: {err}"; Console.WriteLine(err); } }