Ejemplo n.º 1
0
        public void JoinChannel(Channel channel, Action <ChannelEvent> callback, YouMeUserRole role = YouMeUserRole.YOUME_USER_TALKER_FREE)
        {
            if (string.IsNullOrEmpty(GetUserID()))
            {
                Log.e("Need SetUserID(string userid).");
                if (callback != null)
                {
                    callback(new ChannelEvent(StatusCode.USER_ID_IS_EMPTY, ChannelEventType.JOIN_FAIL, channel.ChannelID));
                }
                return;
            }
            talkManager.AddJoinChannelCallback(channel.ChannelID, callback);
            YouMeErrorCode errorCode;

            if (_config.AllowMultiChannel)
            {
                errorCode = YouMeVoiceAPI.GetInstance().JoinChannelMultiMode(GetUserID(), channel.ChannelID);
            }
            else
            {
                errorCode = YouMeVoiceAPI.GetInstance().JoinChannelSingleMode(GetUserID(), channel.ChannelID, (int)role);
            }

            if (errorCode != YouMeErrorCode.YOUME_SUCCESS && callback != null)
            {
                talkManager.RemoveJoinChannelCallback(channel.ChannelID);
                callback(new ChannelEvent(Conv.ErrorCodeConvert(errorCode), ChannelEventType.JOIN_FAIL, channel.ChannelID));
            }
        }
Ejemplo n.º 2
0
 public void JoinTalkChannel(Channel channel, Action <ChannelEvent> joinChannelCallback, YouMeUserRole role = YouMeUserRole.YOUME_USER_TALKER_FREE)
 {
     talk.JoinChannel(channel, joinChannelCallback, role);
 }