Ejemplo n.º 1
0
        private static void OnSessionInviteNotify(long channel_id, string uid, int mode, long time,string custom_info)
        {
            if (GetInstance().channel_id != 0 && channel_id != GetInstance().channel_id)
            {
                NIM.NIMVChatInfo info = new NIM.NIMVChatInfo();
                NIM.VChatAPI.CalleeAck(channel_id, false, info);
            }
            else
            {
                MainForm.VideoChatForm vform = MainForm.VideoChatForm.GetInstance();
                MainForm.VideoChatInfo vchat_info = vform.VchatInfo;
                if (vchat_info.state == MainForm.VChatState.kVChatUnknow)
                {
                    vchat_info.channel_id = channel_id;
                    vchat_info.uid = uid;
                    vchat_info.state = MainForm.VChatState.kVChatNotify;
                    vform.VchatInfo = vchat_info;
                    Action a = () =>
                    {
                        vform.Show();
                    };
                    _ownerFriendsListForm.BeginInvoke(a);
                }
                else
                {
                    NIM.NIMVChatInfo info = new NIM.NIMVChatInfo();
                    NIM.VChatAPI.CalleeAck(channel_id, false, info);
                }

            }

        }
Ejemplo n.º 2
0
 private void button2_Click(object sender, EventArgs e)
 {
     MainForm.VideoChatForm vchat_form = MainForm.VideoChatForm.GetInstance();
     if (vchat_form.VchatInfo.state == MainForm.VChatState.kVChatUnknow)
     {
         MainForm.VideoChatInfo vchat_info = vchat_form.VchatInfo;
         vchat_info.state     = MainForm.VChatState.kVChatInvite;
         vchat_info.uid       = _peerId;
         vchat_info.chat_mode = NIMVideoChatMode.kNIMVideoChatModeVideo;
         vchat_form.VchatInfo = vchat_info;
         vchat_form.Show();
     }
     else
     {
         vchat_form.Activate();
     }
 }
Ejemplo n.º 3
0
 private static void OnSessionConnectNotify(long channel_id, int code, string record_file, string video_record_file)
 {
     if (code == 200)
     {
         Action a = () =>
         {
             if (NIMDemo.Helper.VChatHelper.CurrentVChatType == NIMDemo.Helper.VChatType.kP2P)
             {
                 MainForm.VideoChatForm vform = MainForm.VideoChatForm.GetInstance();
                 vform.Show();
             }
         };
         _ownerFriendsListForm.Invoke(a);
         StartDevices();
     }
     else
     {
         NIM.VChatAPI.End();
     }
 }
Ejemplo n.º 4
0
 private static void OnSessionConnectNotify(long channel_id, int code, string record_file, string video_record_file, long chat_time, ulong chat_rx, ulong chat_tx)
 {
     DemoTrace.WriteLine("Session Connect channel_id:" + channel_id.ToString() +
                         " code:" + code.ToString() + " record_file:" + record_file + " video_record_file" + video_record_file +
                         "chat_time:" + chat_time.ToString() + "chat_rx:" + chat_rx.ToString() + "chat_tx" + chat_tx.ToString());
     if (code == 200)
     {
         Action a = () =>
         {
             if (NIMDemo.Helper.VChatHelper.CurrentVChatType == NIMDemo.Helper.VChatType.kP2P)
             {
                 MainForm.VideoChatForm vform = MainForm.VideoChatForm.GetInstance();
                 vform.Show();
             }
         };
         _ownerFriendsListForm.Invoke(a);
         StartDevices();
     }
     else
     {
         NIM.VChatAPI.End();
     }
 }