ChannelObserver channelObserver = new ChannelObserver() { @Override public void onJoinSuccess(String roomName, long uid, ChannelRole role, boolean muted) { Log.d("qtt_rtc", "加入频道成功 roomId:" + roomName + " uid:" + uid + " role:" + role + " "); } @Override public void onReJoinSuccess(String roomName, long uid, ChannelRole role, boolean muted) { Log.d("qtt_rtc", "加入频道成功 roomId:" + roomName + " uid:" + uid + " role:" + role + " "); } @Override public void onJoinFail(final int code, final String message) { Log.d("qtt_rtc", "加入频道失败 " + message); } @Override public void onConnectionBreak() { Log.d("qtt_rtc", "连接中断"); } @Override public void onConnectionLost() { Log.d("qtt_rtc", "连接丢失"); } @Override public void onLeave() { Log.d("qtt_rtc", "退出房间成功"); } @Override public void onError(int err, String message) { Log.d("qtt_rtc", "错误消息 " + err + " msg: " + message); } @Override public void onWarning(int warn, String message) { Log.d("qtt_rtc", "警告消息 " + err + " msg: " + message); } };
ChannelEngine channelEngine = ChannelEngine.GetChannelInstance(getApplicationContext(),"your appkey",channelObserver);
|