예제 #1
0
        /// <summary>
        /// 设置配置信息
        /// </summary>
        /// <param name="appKey">游密官方分配的APP唯一标识,在www.youme.im注册后可以自助获取</param>
        /// <param name="secretKey">游密官方分配的接入密钥,和appkey配对使用,在www.youme.im注册后可以自助获取</param>
        /// <param name="config">SDK配置对象,可以通过该对象的参数设置SDK的可选参数,比如服务器区域、日志级别</param> <summary>
        /// <param name="initCallBack">初始化结果回调</param>
        ///
        public void Initialize(string appKey, string secretKey, TalkConfig config, Action <InitEvent> initCallBack)
        {
            YouMeErrorCode errorCode;

            _config = config;
            talkManager.initCallBack = initCallBack;
            if (config != null)
            {
                if (!string.IsNullOrEmpty(config.ExtServerZone))
                {
                    errorCode = YouMeVoiceAPI.GetInstance().Init(appKey, secretKey, YOUME_RTC_SERVER_REGION.RTC_EXT_SERVER, config
                                                                 .ExtServerZone);
                }
                else
                {
                    errorCode = YouMeVoiceAPI.GetInstance().Init(appKey, secretKey, config.ServerZone, "");
                }
            }
            else
            {
                errorCode = YouMeVoiceAPI.GetInstance().Init(appKey, secretKey, YOUME_RTC_SERVER_REGION.RTC_DEFAULT_SERVER, "");
            }
            if (errorCode != YouMeErrorCode.YOUME_SUCCESS && initCallBack != null)
            {
                talkManager.initCallBack = null;
                initCallBack(new InitEvent(errorCode));
            }
        }
예제 #2
0
        TalkConfig PlusConfigToTalkConfig(TalkPlusConfig conf)
        {
            var talkConf = new TalkConfig();

            talkConf.AllowMultiChannel = conf.AllowMultiChannel;
            talkConf.ExtServerZone     = conf.ExtServerZone;
            talkConf.LogLevel          = conf.LogLevel;
            talkConf.ServerZone        = (YOUME_RTC_SERVER_REGION)conf.ServerZone;
            return(talkConf);
        }