Steven 2 éve
szülő
commit
757d051484

BIN
KulexiuForStudent/KulexiuForStudent.xcworkspace/xcuserdata/wangzhi.xcuserdatad/UserInterfaceState.xcuserstate


+ 29 - 61
KulexiuForStudent/KulexiuForStudent.xcworkspace/xcuserdata/wangzhi.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

@@ -126,8 +126,8 @@
             filePath = "KulexiuForStudent/Module/Live/Controller/LiveVideoRoomViewController.m"
             filePath = "KulexiuForStudent/Module/Live/Controller/LiveVideoRoomViewController.m"
             startingColumnNumber = "9223372036854775807"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "687"
-            endingLineNumber = "687"
+            startingLineNumber = "713"
+            endingLineNumber = "713"
             landmarkName = "-updateVideoViewContainer"
             landmarkName = "-updateVideoViewContainer"
             landmarkType = "7">
             landmarkType = "7">
          </BreakpointContent>
          </BreakpointContent>
@@ -494,8 +494,8 @@
             filePath = "KulexiuForStudent/Module/Live/Controller/LiveVideoRoomViewController.m"
             filePath = "KulexiuForStudent/Module/Live/Controller/LiveVideoRoomViewController.m"
             startingColumnNumber = "9223372036854775807"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "1318"
-            endingLineNumber = "1318"
+            startingLineNumber = "1346"
+            endingLineNumber = "1346"
             landmarkName = "-didReceiveMessageNotification:"
             landmarkName = "-didReceiveMessageNotification:"
             landmarkType = "7">
             landmarkType = "7">
             <Locations>
             <Locations>
@@ -558,8 +558,8 @@
             filePath = "KulexiuForStudent/Module/Live/Controller/LiveVideoRoomViewController.m"
             filePath = "KulexiuForStudent/Module/Live/Controller/LiveVideoRoomViewController.m"
             startingColumnNumber = "9223372036854775807"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "1422"
-            endingLineNumber = "1422"
+            startingLineNumber = "1451"
+            endingLineNumber = "1451"
             landmarkName = "-didReceiveMessageNotification:"
             landmarkName = "-didReceiveMessageNotification:"
             landmarkType = "7">
             landmarkType = "7">
             <Locations>
             <Locations>
@@ -599,22 +599,6 @@
       <BreakpointProxy
       <BreakpointProxy
          BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
          BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
          <BreakpointContent
          <BreakpointContent
-            uuid = "303FBC4E-6683-4D6A-932A-23F06B6B0830"
-            shouldBeEnabled = "Yes"
-            ignoreCount = "0"
-            continueAfterRunningActions = "No"
-            filePath = "KulexiuForStudent/Module/Live/View/KSChatroomTextCell.m"
-            startingColumnNumber = "9223372036854775807"
-            endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "74"
-            endingLineNumber = "74"
-            landmarkName = "-updateUI:"
-            landmarkType = "7">
-         </BreakpointContent>
-      </BreakpointProxy>
-      <BreakpointProxy
-         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
-         <BreakpointContent
             uuid = "2EBF0C0D-BC6A-44E0-8B45-75E85CFC0D6E"
             uuid = "2EBF0C0D-BC6A-44E0-8B45-75E85CFC0D6E"
             shouldBeEnabled = "Yes"
             shouldBeEnabled = "Yes"
             ignoreCount = "0"
             ignoreCount = "0"
@@ -631,38 +615,6 @@
       <BreakpointProxy
       <BreakpointProxy
          BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
          BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
          <BreakpointContent
          <BreakpointContent
-            uuid = "4DE6FF37-60FE-4565-AF84-05AD05738752"
-            shouldBeEnabled = "Yes"
-            ignoreCount = "0"
-            continueAfterRunningActions = "No"
-            filePath = "KulexiuForStudent/Module/Live/View/KSChatroomTextCell.m"
-            startingColumnNumber = "9223372036854775807"
-            endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "69"
-            endingLineNumber = "69"
-            landmarkName = "-updateUI:"
-            landmarkType = "7">
-         </BreakpointContent>
-      </BreakpointProxy>
-      <BreakpointProxy
-         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
-         <BreakpointContent
-            uuid = "235E0E64-63AA-4FBA-A6E2-F2B922AE8D75"
-            shouldBeEnabled = "Yes"
-            ignoreCount = "0"
-            continueAfterRunningActions = "No"
-            filePath = "KulexiuForStudent/Module/Live/View/KSChatroomTextCell.m"
-            startingColumnNumber = "9223372036854775807"
-            endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "62"
-            endingLineNumber = "62"
-            landmarkName = "-setDataModel:createrId:"
-            landmarkType = "7">
-         </BreakpointContent>
-      </BreakpointProxy>
-      <BreakpointProxy
-         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
-         <BreakpointContent
             uuid = "94A12614-714B-4C8E-91EE-4B41E2838320"
             uuid = "94A12614-714B-4C8E-91EE-4B41E2838320"
             shouldBeEnabled = "No"
             shouldBeEnabled = "No"
             ignoreCount = "0"
             ignoreCount = "0"
@@ -670,8 +622,8 @@
             filePath = "KulexiuForStudent/Module/Live/Controller/LiveVideoRoomViewController.m"
             filePath = "KulexiuForStudent/Module/Live/Controller/LiveVideoRoomViewController.m"
             startingColumnNumber = "9223372036854775807"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "1414"
-            endingLineNumber = "1414"
+            startingLineNumber = "1443"
+            endingLineNumber = "1443"
             landmarkName = "-didReceiveMessageNotification:"
             landmarkName = "-didReceiveMessageNotification:"
             landmarkType = "7">
             landmarkType = "7">
             <Locations>
             <Locations>
@@ -712,14 +664,14 @@
          BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
          BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
          <BreakpointContent
          <BreakpointContent
             uuid = "C6CEC3A8-2EB0-4A76-9DA2-62B4E4B95D74"
             uuid = "C6CEC3A8-2EB0-4A76-9DA2-62B4E4B95D74"
-            shouldBeEnabled = "Yes"
+            shouldBeEnabled = "No"
             ignoreCount = "0"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             continueAfterRunningActions = "No"
             filePath = "KulexiuForStudent/Module/Live/Controller/LiveVideoRoomViewController.m"
             filePath = "KulexiuForStudent/Module/Live/Controller/LiveVideoRoomViewController.m"
             startingColumnNumber = "9223372036854775807"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "1099"
-            endingLineNumber = "1099"
+            startingLineNumber = "1127"
+            endingLineNumber = "1127"
             landmarkName = "-insertMessage:userInfo:"
             landmarkName = "-insertMessage:userInfo:"
             landmarkType = "7">
             landmarkType = "7">
          </BreakpointContent>
          </BreakpointContent>
@@ -734,11 +686,27 @@
             filePath = "KulexiuForStudent/Module/Live/Controller/LiveVideoRoomViewController.m"
             filePath = "KulexiuForStudent/Module/Live/Controller/LiveVideoRoomViewController.m"
             startingColumnNumber = "9223372036854775807"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "1508"
-            endingLineNumber = "1508"
+            startingLineNumber = "1537"
+            endingLineNumber = "1537"
             landmarkName = "-appendAndDisplayMessage:"
             landmarkName = "-appendAndDisplayMessage:"
             landmarkType = "7">
             landmarkType = "7">
          </BreakpointContent>
          </BreakpointContent>
       </BreakpointProxy>
       </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            uuid = "35B47182-A220-447C-A8E7-1AF8DAED450A"
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "KulexiuForStudent/Module/Live/Controller/LiveVideoRoomViewController.m"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "1053"
+            endingLineNumber = "1053"
+            landmarkName = "-joinLiveRoom"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
    </Breakpoints>
    </Breakpoints>
 </Bucket>
 </Bucket>

+ 1 - 0
KulexiuForStudent/KulexiuForStudent/Common/Base/RCConnectionManager.m

@@ -60,6 +60,7 @@
     if (status == ConnectionStatus_Connected) { // RTC会自动断线重连 此处多余
     if (status == ConnectionStatus_Connected) { // RTC会自动断线重连 此处多余
         self.isConnected = YES;
         self.isConnected = YES;
         NSLog(@"connect im success");
         NSLog(@"connect im success");
+        [[NSNotificationCenter defaultCenter] postNotificationName:@"RongIMConnected" object:nil];
     }
     }
     else if (status == ConnectionStatus_KICKED_OFFLINE_BY_OTHER_CLIENT) { // 账号被挤掉
     else if (status == ConnectionStatus_KICKED_OFFLINE_BY_OTHER_CLIENT) { // 账号被挤掉
         
         

+ 36 - 7
KulexiuForStudent/KulexiuForStudent/Module/Live/Controller/LiveVideoRoomViewController.m

@@ -236,7 +236,13 @@ static int clickPraiseBtnTimes  = 0;
 }
 }
 
 
 - (void)joinRTCRoom {
 - (void)joinRTCRoom {
-    [self setRoleType];
+    // 如果当前加入了房间 只刷新或者退出
+    if (self.room && self.liveRoleType == RCRTCLiveRoleTypeBroadcaster) {
+        [self connectHostWithStatus:NO];
+    }
+    else {
+        [self setRoleType];
+    }
 }
 }
 
 
 - (void)judgeAutoClose {
 - (void)judgeAutoClose {
@@ -582,12 +588,23 @@ static int clickPraiseBtnTimes  = 0;
             });
             });
             
             
         } onFailed:^(RCRTCCode code) {
         } onFailed:^(RCRTCCode code) {
+            
             NSLog(@"------- up error code %ld", code);
             NSLog(@"------- up error code %ld", code);
             weakSelf.isTransferRole = NO;
             weakSelf.isTransferRole = NO;
             dispatch_main_async_safe(^{
             dispatch_main_async_safe(^{
-                // 失败
-                [weakSelf MBPShow:@"上麦失败"];
-                weakSelf.micStatus = MICSTATUS_NOMAL;
+                if (code == RCRTCCodeSwitchRoleSameRoleError) {
+                    weakSelf.liveRoleType = RCRTCLiveRoleTypeBroadcaster;
+                    // 失败
+                    weakSelf.micStatus = MICSTATUS_CONNECTING;
+                    // 刷新麦位状态
+                    [weakSelf renderSeatView];
+                }
+                else {
+                    // 失败
+                    [weakSelf MBPShow:@"上麦失败"];
+                    weakSelf.micStatus = MICSTATUS_NOMAL;
+                    [weakSelf renderSeatView];
+                }
             });
             });
             
             
         } onKicked:^{
         } onKicked:^{
@@ -631,9 +648,18 @@ static int clickPraiseBtnTimes  = 0;
             weakSelf.isTransferRole = NO;
             weakSelf.isTransferRole = NO;
             NSLog(@"------- down error code %ld", code);
             NSLog(@"------- down error code %ld", code);
             dispatch_main_async_safe(^{
             dispatch_main_async_safe(^{
-                // 失败
-                [weakSelf MBPShow:@"下麦失败"];
-                weakSelf.micStatus = MICSTATUS_CONNECTING;
+                if (code == RCRTCCodeSwitchRoleSameRoleError) {
+                    weakSelf.liveRoleType = RCRTCLiveRoleTypeAudience;
+                    weakSelf.micStatus = MICSTATUS_NOMAL;
+                    [weakSelf renderSeatView];
+                }
+                else {
+                    // 失败
+                    [weakSelf MBPShow:@"下麦失败"];
+                    weakSelf.micStatus = MICSTATUS_CONNECTING;
+                }
+                // 刷新麦位状态
+                [weakSelf renderSeatView];
             });
             });
             
             
         } onKicked:^{
         } onKicked:^{
@@ -1015,6 +1041,8 @@ static int clickPraiseBtnTimes  = 0;
 
 
 #pragma mark ---- RTC
 #pragma mark ---- RTC
 - (void)joinLiveRoom {
 - (void)joinLiveRoom {
+//    self.liveRoleType = RCRTCLiveRoleTypeAudience;
+//    self.micStatus = MICSTATUS_NOMAL;
     // 1.配置房间
     // 1.配置房间
     RCRTCRoomConfig *config = [[RCRTCRoomConfig alloc] init];
     RCRTCRoomConfig *config = [[RCRTCRoomConfig alloc] init];
     config.roomType = RCRTCRoomTypeLive;
     config.roomType = RCRTCRoomTypeLive;
@@ -1319,6 +1347,7 @@ static int clickPraiseBtnTimes  = 0;
                     if (seatControlMessage.seatBan) { // 禁止连麦
                     if (seatControlMessage.seatBan) { // 禁止连麦
                         __blockSelf.enableSeat = NO;
                         __blockSelf.enableSeat = NO;
                         __blockSelf.micStatus = MICSTATUS_NOMAL;
                         __blockSelf.micStatus = MICSTATUS_NOMAL;
+                        
                     }
                     }
                     else { // 开启连麦
                     else { // 开启连麦
                         __blockSelf.enableSeat = YES;
                         __blockSelf.enableSeat = YES;