示例#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 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);
         }
     });
 }