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)); } }
public void JoinTalkChannel(Channel channel, Action <ChannelEvent> joinChannelCallback, YouMeUserRole role = YouMeUserRole.YOUME_USER_TALKER_FREE) { talk.JoinChannel(channel, joinChannelCallback, role); }