void MultiVChatForm_Load(object sender, EventArgs e)
        {
            _multiVChatFormGraphics_pb01 = pb_multivchat_01.CreateGraphics();
            _multiVChatFormGraphics_pb02 = pb_multivchat_02.CreateGraphics();
            _multiVChatFormGraphics_pb03 = pb_multivchat_03.CreateGraphics();
            _multiVChatFormGraphics_pb04 = pb_multivchat_04.CreateGraphics();


            _vchatHandlers.onSessionConnectNotify = (channel_id, code, record_addr, record_file) =>
            {
                if (code == 200)
                {
                    StartDevices();
                }
                else
                {
                    NIM.VChatAPI.End();
                }
            };


            NIM.VChatAPI.SetSessionStatusCb(_vchatHandlers);
            //注册音频接收回调
            DeviceAPI.SetAudioReceiveDataCb(AudioDataReceiveCallBack, null);
            //注册视频接收回调
            DeviceAPI.SetVideoReceiveDataCb(VideoDataReceiveCallBack, null);
            //注册视频捕获回调
            DeviceAPI.SetVideoCaptureDataCb(VideoDataCaptureCallBack, null);

            //启动设备在MultimediaHandler onSessionConnectNotify回调通知中
            // StartDevices();
            _audiosetblacklistop = new NIMVChatOptHandler(AudioSetBlackListOP);
        }
 void SetVChatCallbackNull()
 {
     //注册音频接收回调
     DeviceAPI.SetAudioReceiveDataCb(null, null);
     //注册视频接收回调
     DeviceAPI.SetVideoReceiveDataCb(null, null);
     //注册视频捕获回调
     DeviceAPI.SetVideoCaptureDataCb(null, null);
 }
        void SetVChatCallback()
        {
            //注册音频接收回调
            DeviceAPI.SetAudioReceiveDataCb(AudioDataReceiveCallBack, null);
            //注册视频接收回调
            DeviceAPI.SetVideoReceiveDataCb(VideoDataReceiveCallBack, null);
            //注册视频捕获回调
            DeviceAPI.SetVideoCaptureDataCb(VideoDataCaptureCallBack, null);

            _audiosetblacklistop = new NIMVChatOptHandler(AudioSetBlackListOP);
        }
Exemple #4
0
        /// <summary>
        /// 设置通话回调函数
        /// </summary>
        public static void InitVChatInfo()
        {
            _vchatHandlers.onSessionStartRes        = OnSessionStartRes;
            _vchatHandlers.onSessionInviteNotify    = OnSessionInviteNotify;
            _vchatHandlers.onSessionCalleeAckRes    = OnSessionCalleeAckRes;
            _vchatHandlers.onSessionCalleeAckNotify = OnSessionCalleeAckNotify;
            _vchatHandlers.onSessionControlRes      = OnSessionControlRes;
            _vchatHandlers.onSessionControlNotify   = OnSessionControlNotify;
            _vchatHandlers.onSessionConnectNotify   = OnSessionConnectNotify;
            _vchatHandlers.onSessionPeopleStatus    = OnSessionPeopleStatus;
            _vchatHandlers.onSessionNetStatus       = OnSessionNetStatus;
            _vchatHandlers.onSessionHangupRes       = OnSessionHangupRes;
            _vchatHandlers.onSessionHangupNotify    = OnSessionHangupNotify;
            //本人其他端响应通知
            _vchatHandlers.onSessionSyncAckNotify = (channel_id, code, uid, mode, accept, time, client) =>
            {
                Application.Current.Dispatcher.BeginInvoke((Action)(() =>
                {
                    if (string.IsNullOrEmpty(uid))
                    {
                        uid = targetUid;
                    }
                    MainWindowVm.HandlerSessionSyncAckNotify(channel_id, code, uid, mode, accept, time, client);
                }));
            };
            //注册音视频会话交互回调
            VChatAPI.SetSessionStatusCb(_vchatHandlers);
            //注册音频接收数据回调
            DeviceAPI.SetAudioReceiveDataCb(AudioDataRecHandler, null);
            //注册视频接收数据回调
            //DeviceAPI.SetVideoReceiveDataCb(VideoDataRecHandler, null);
            //注册视频采集数据回调
            //DeviceAPI.SetVideoCaptureDataCb(VideoDataCaptureHandler, null);

            //DeviceAPI.AddDeviceStatusCb(NIM.NIMDeviceType.kNIMDeviceTypeVideo, DeviceStatusHandler);
            SetAudioCaptureVolumn(255);
            SetAudioPlayVolumn(120);
        }
 public SettingsController(IConfiguration config, DeviceAPI deviceAPI, ILogger <SettingsController> logger)
 {
     _config    = config;
     _deviceAPI = deviceAPI;
     _logger    = logger;
 }