|  | @@ -59,6 +59,7 @@ import com.cooleshow.student.bean.LiveRoomInfoBean;
 | 
	
		
			
				|  |  |  import com.cooleshow.student.contract.LiveRoomContract;
 | 
	
		
			
				|  |  |  import com.cooleshow.student.databinding.ActivityLiveroomLayoutBinding;
 | 
	
		
			
				|  |  |  import com.cooleshow.student.presenter.live.LiveRoomPresenter;
 | 
	
		
			
				|  |  | +import com.rong.io.live.bean.User;
 | 
	
		
			
				|  |  |  import com.rong.io.live.helper.LiveMemberHelper;
 | 
	
		
			
				|  |  |  import com.rong.io.live.helper.LiveMessageHelper;
 | 
	
		
			
				|  |  |  import com.rong.io.live.helper.LiveRTCEngineInitHelper;
 | 
	
	
		
			
				|  | @@ -113,6 +114,7 @@ import io.rong.imkit.IMCenter;
 | 
	
		
			
				|  |  |  import io.rong.imlib.IRongCoreCallback;
 | 
	
		
			
				|  |  |  import io.rong.imlib.IRongCoreEnum;
 | 
	
		
			
				|  |  |  import io.rong.imlib.RongIMClient;
 | 
	
		
			
				|  |  | +import io.rong.imlib.model.Conversation;
 | 
	
		
			
				|  |  |  import io.rong.imlib.model.Message;
 | 
	
		
			
				|  |  |  import io.rong.imlib.model.MessageContent;
 | 
	
		
			
				|  |  |  import io.rong.imlib.model.UserInfo;
 | 
	
	
		
			
				|  | @@ -444,12 +446,15 @@ public class LiveRoomActivity extends BaseMVPActivity<ActivityLiveroomLayoutBind
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |          if (id == R.id.iv_mic) {
 | 
	
		
			
				|  |  |              //连麦
 | 
	
		
			
				|  |  | -            if (checkMicMode()) {
 | 
	
		
			
				|  |  | -                return;
 | 
	
		
			
				|  |  | -            }
 | 
	
		
			
				|  |  | -            if (connectStatusIsPaused) {
 | 
	
		
			
				|  |  | -                //连接状态异常,暂停连麦
 | 
	
		
			
				|  |  | -                return;
 | 
	
		
			
				|  |  | +            if (!isOnMic()) {
 | 
	
		
			
				|  |  | +                //非连麦中才判断模式
 | 
	
		
			
				|  |  | +                if (checkMicMode()) {
 | 
	
		
			
				|  |  | +                    return;
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  | +                if (connectStatusIsPaused) {
 | 
	
		
			
				|  |  | +                    //连接状态异常,暂停连麦
 | 
	
		
			
				|  |  | +                    return;
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |              showMicManagerDialog();
 | 
	
		
			
				|  |  |              return;
 | 
	
	
		
			
				|  | @@ -514,6 +519,7 @@ public class LiveRoomActivity extends BaseMVPActivity<ActivityLiveroomLayoutBind
 | 
	
		
			
				|  |  |                      //申请连麦
 | 
	
		
			
				|  |  |                      handleMicEvent();
 | 
	
		
			
				|  |  |                      mMicManagerDialog.setMicStatus(LiveRoomMsgConstants.MIC_STATUS_CONNECTING);
 | 
	
		
			
				|  |  | +                    mMicManagerDialog.dismiss();
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |                  @Override
 | 
	
	
		
			
				|  | @@ -566,10 +572,12 @@ public class LiveRoomActivity extends BaseMVPActivity<ActivityLiveroomLayoutBind
 | 
	
		
			
				|  |  |          if (viewId == R.id.tv_music_sheet) {
 | 
	
		
			
				|  |  |              params = "music";
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  | -        ARouter.getInstance()
 | 
	
		
			
				|  |  | -                .build(RouterPath.WebCenter.ACTIVITY_HTML)
 | 
	
		
			
				|  |  | -                .withString(WebConstants.WEB_URL, WebConstants.STUDENT_TEACHER_HOME + mRoomInfoBean.speakerId + "&tabs=" + params)
 | 
	
		
			
				|  |  | -                .navigation();
 | 
	
		
			
				|  |  | +        if (mRoomInfoBean != null) {
 | 
	
		
			
				|  |  | +            ARouter.getInstance()
 | 
	
		
			
				|  |  | +                    .build(RouterPath.WebCenter.ACTIVITY_HTML)
 | 
	
		
			
				|  |  | +                    .withString(WebConstants.WEB_URL, WebConstants.STUDENT_TEACHER_HOME + mRoomInfoBean.speakerId + "&tabs=" + params)
 | 
	
		
			
				|  |  | +                    .navigation();
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -1276,6 +1284,25 @@ public class LiveRoomActivity extends BaseMVPActivity<ActivityLiveroomLayoutBind
 | 
	
		
			
				|  |  |          if (isOnApplyMic()) {
 | 
	
		
			
				|  |  |              updateMicIcon(LiveRoomMsgConstants.MIC_STATUS_NORMAL);
 | 
	
		
			
				|  |  |              ToastUtil.getInstance().show(LiveRoomActivity.this, getString(R.string.create_refuse_seat_tip));
 | 
	
		
			
				|  |  | +            buildResponseMessage();
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    /**
 | 
	
		
			
				|  |  | +     * 因全部拒绝连麦消息没有携带id相关参数,所以本地造一个拒绝连麦的消息插入到消息列表
 | 
	
		
			
				|  |  | +     */
 | 
	
		
			
				|  |  | +    private void buildResponseMessage() {
 | 
	
		
			
				|  |  | +        if (mRoomInfoBean != null) {
 | 
	
		
			
				|  |  | +            String userId = UserHelper.getUserId();
 | 
	
		
			
				|  |  | +            RCUserSeatResponseMessage responseMessage = new RCUserSeatResponseMessage();
 | 
	
		
			
				|  |  | +            responseMessage.setType(LiveRoomMsgConstants.MIC_RESPONSE_DISAGREE);
 | 
	
		
			
				|  |  | +            responseMessage.setTeacherId(mRoomInfoBean.speakerId);
 | 
	
		
			
				|  |  | +            responseMessage.setTeacherName(mRoomInfoBean.speakerName);
 | 
	
		
			
				|  |  | +            responseMessage.setAudienceId(UserHelper.getUserId());
 | 
	
		
			
				|  |  | +            responseMessage.setAudienceName(UserHelper.getUserName());
 | 
	
		
			
				|  |  | +            Message message = Message.obtain(userId, Conversation.ConversationType.CHATROOM, responseMessage);
 | 
	
		
			
				|  |  | +            message.setObjectName(LiveRoomMsgConstants.TAG_CHAT_ROOM_SEAT_RESPONSE);
 | 
	
		
			
				|  |  | +            addMessageContent(message, false);
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -1956,6 +1983,28 @@ public class LiveRoomActivity extends BaseMVPActivity<ActivityLiveroomLayoutBind
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +    //老师重新加入房间重置一下连麦状态,假如是连麦中的状态
 | 
	
		
			
				|  |  | +    private void resetMicStatus(RCChatJoinRoomMessage joinRoomMessage) {
 | 
	
		
			
				|  |  | +        if (!isOnApplyMic()) {
 | 
	
		
			
				|  |  | +            return;
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        String joinUserId = joinRoomMessage.getUserId();
 | 
	
		
			
				|  |  | +        if (TextUtils.isEmpty(joinUserId)) {
 | 
	
		
			
				|  |  | +            if (joinRoomMessage.getUserInfo() != null) {
 | 
	
		
			
				|  |  | +                joinUserId = joinRoomMessage.getUserInfo().getUserId();
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        Log.i("pq","joinUserId:"+joinUserId);
 | 
	
		
			
				|  |  | +        if (!TextUtils.isEmpty(joinUserId) && mRoomInfoBean != null) {
 | 
	
		
			
				|  |  | +            if (TextUtils.equals(joinUserId, mRoomInfoBean.speakerId)) {
 | 
	
		
			
				|  |  | +                //老师加入直播,重置连麦申请中状态
 | 
	
		
			
				|  |  | +                if (isOnApplyMic()) {
 | 
	
		
			
				|  |  | +                    updateMicIcon(LiveRoomMsgConstants.MIC_STATUS_NORMAL);
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |      /**
 | 
	
		
			
				|  |  |       * 显示弹幕消息
 | 
	
		
			
				|  |  |       */
 |