Selaa lähdekoodia

优化代码判断

Pq 2 vuotta sitten
vanhempi
commit
949372ffa3

+ 4 - 0
student/src/main/java/com/cooleshow/student/presenter/live/LiveRoomPresenter.java

@@ -493,6 +493,10 @@ public class LiveRoomPresenter extends BasePresenter<LiveRoomContract.view> impl
      */
     public void exitMic() {
         // 开始切换为观众身份
+        RCRTCRoom room = RCRTCEngine.getInstance().getRoom();
+        if (room == null || room.getLocalUser() == null) {
+            return;
+        }
         RCRTCEngine.getInstance().getRoom().getLocalUser().switchToAudience(new IRCRTCSwitchRoleCallback() {
 
             /**

+ 1 - 0
student/src/main/java/com/cooleshow/student/ui/live/LiveRoomActivity.java

@@ -1108,6 +1108,7 @@ public class LiveRoomActivity extends BaseMVPActivity<ActivityLiveroomLayoutBind
     public void showEmptyStatusView() {
         //显示老师不在线view
         showRestView();
+        refreshAudio(null,null);
     }
 
     @Override