示例#1
0
        public void RtsTest()
        {
            VideoChatForm vchatForm = VideoChatForm.GetInstance();
            RtsForm       rtsForm   = RtsForm.GetInstance();


            //当前不存在白板会话和音视频会话,才能开启新的会话
            if (rtsForm.RtsState == RtsFormState.kRtsInit && vchatForm.VchatInfo.state == VChatState.kVChatUnknow)
            {
                rtsForm.Show();
                rtsForm.SetRtsInfo("", _peerId, (NIM.NIMRts.NIMRtsChannelType.kNIMRtsChannelTypeTcp | NIM.NIMRts.NIMRtsChannelType.kNIMRtsChannelTypeVchat));
                rtsForm.RtsState = RtsFormState.kRtsInvite;
            }
            else
            {
                if (rtsForm.RtsState != RtsFormState.kRtsInit)
                {
                    rtsForm.Activate();
                }
                if (vchatForm.VchatInfo.state != VChatState.kVChatUnknow)
                {
                    vchatForm.Activate();
                }
            }
            //rtsForm.SetRtsInfo
        }
示例#2
0
 void Response(int code, string sessionId, int channelType, bool accept)
 {
     if (accept && code == (int)NIM.ResponseCode.kNIMResSuccess)
     {
         InvokeOnForm(() =>
         {
             var form = new RtsForm(sessionId);
             form.Show();
         });
     }
     else if (code != (int)NIM.ResponseCode.kNIMResSuccess)
     {
         MessageBox.Show("建立白板会话失败:" + code.ToString());
     }
 }
示例#3
0
 void OnReceiveSessionRequest(string sessionId, int channelType, string uid, string custom)
 {
     InvokeOnForm(() =>
     {
         VideoChatForm vchatForm = VideoChatForm.GetInstance();
         RtsForm rtsForm         = RtsForm.GetInstance();
         //当前不存在白板会话和音视频会话,才能开启新的会话
         if (rtsForm.RtsState == RtsFormState.kRtsInit && vchatForm.VchatInfo.state == VChatState.kVChatUnknow)
         {
             rtsForm.Show();
             rtsForm.RtsState = RtsFormState.kRtsNotify;
             rtsForm.SetRtsInfo(sessionId, uid, (NIM.NIMRts.NIMRtsChannelType)channelType);
         }
         else
         {
             NIM.RtsAPI.Ack(sessionId, (NIM.NIMRts.NIMRtsChannelType)channelType, false, null, null);
         }
     });
 }
 public void RtsTest()
 {
     NIM.NIMRts.RtsStartInfo info = new NIM.NIMRts.RtsStartInfo();
     info.ApnsText   = "123";
     info.CustomInfo = "456";
     RtsAPI.SetAckNotifyCallback((a, b, c, d) =>
     {
         this.InvokeOnMainThread(() =>
         {
             if (!c)
             {
                 MessageBox.Show("对方拒绝");
             }
             else
             {
                 RtsForm f = new RtsForm(a);
                 f.Show();
             }
         });
     });
     RtsAPI.Start((NIM.NIMRts.NIMRtsChannelType.kNIMRtsChannelTypeTcp | NIM.NIMRts.NIMRtsChannelType.kNIMRtsChannelTypeVchat), _peerId, info,
                  (code, sessionId, channelType, uid) =>
     {
         this.InvokeOnMainThread(() =>
         {
             if (code == 200)
             {
                 MessageBox.Show("邀请已发送,等待对方加入");
             }
             else
             {
                 MessageBox.Show("邀请失败:" + ((NIM.ResponseCode)code).ToString());
             }
         });
     });
 }