Steven 2 سال پیش
والد
کامیت
1e22c103b1

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


+ 7 - 7
KulexiuForTeacher/KulexiuForTeacher.xcworkspace/xcuserdata/wangzhi.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

@@ -8,7 +8,7 @@
          BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
          <BreakpointContent
             uuid = "8E15E6EC-907C-474C-82BE-2DD74BFF9FBE"
-            shouldBeEnabled = "Yes"
+            shouldBeEnabled = "No"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             filePath = "KulexiuForTeacher/Module/Live/View/LiveSeatApplyCell.m"
@@ -62,8 +62,8 @@
             filePath = "KulexiuForTeacher/Module/Live/Controller/LiveRoomViewController.m"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "1632"
-            endingLineNumber = "1632"
+            startingLineNumber = "1643"
+            endingLineNumber = "1643"
             landmarkName = "-quitRoomBackPreView:"
             landmarkType = "7">
          </BreakpointContent>
@@ -71,16 +71,16 @@
       <BreakpointProxy
          BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
          <BreakpointContent
-            uuid = "EA9FEA48-4616-4094-BBE4-66F574A0FB75"
+            uuid = "FC07B169-B1EA-4CFD-8784-548D164D062C"
             shouldBeEnabled = "Yes"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             filePath = "KulexiuForTeacher/Module/Live/Controller/LiveRoomViewController.m"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "510"
-            endingLineNumber = "510"
-            landmarkName = "-setupUI"
+            startingLineNumber = "1647"
+            endingLineNumber = "1647"
+            landmarkName = "-quitRoomBackPreView:"
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>

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

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

+ 14 - 3
KulexiuForTeacher/KulexiuForTeacher/Module/Live/Controller/LiveRoomViewController.m

@@ -153,6 +153,8 @@ typedef NS_ENUM(NSInteger, LIVEPAGE) {
 
 @property (nonatomic, copy) LiveRoomBackAction callback;
 
+@property (nonatomic, assign) BOOL needPublishStream;
+
 @end
 
 
@@ -496,8 +498,13 @@ typedef NS_ENUM(NSInteger, LIVEPAGE) {
 
 - (void)appBecomeActive {
     if (self.isEnterBackground && self.pageType == LIVEPAGE_LIVE && self.isOtherLogin == NO) {
-        // 开启推流
-        [self startPublishStream];
+        if ([USER_MANAGER checkIMConnected]) {
+            // 开启推流
+            [self startPublishStream];
+        }
+        else {
+            self.needPublishStream = YES;
+        }
     }
     self.isEnterBackground = NO;
 }
@@ -653,6 +660,9 @@ typedef NS_ENUM(NSInteger, LIVEPAGE) {
                 
             }];
         }
+        if (self.needPublishStream) {
+            [self startPublishStream];
+        }
     });
 }
 
@@ -1003,7 +1013,7 @@ typedef NS_ENUM(NSInteger, LIVEPAGE) {
     MJWeakSelf;
     [self.room.localUser publishDefaultLiveStreams:^(BOOL isSuccess, RCRTCCode code, RCRTCLiveInfo * _Nullable liveInfo) {
         if (code == RCRTCCodeSuccess) {
-            
+            weakSelf.needPublishStream = NO;
         }
         else {
             [weakSelf MBPShow:@"视频流发布失败"];
@@ -1602,6 +1612,7 @@ typedef NS_ENUM(NSInteger, LIVEPAGE) {
     }];
 }
 - (void)pauseLiveActionBack:(BOOL)backPreView {
+    self.needPublishStream = NO;
     KSRCPauseLiveMessage *pauseMsg = [[KSRCPauseLiveMessage alloc] init];
     MJWeakSelf;
     [self sendMessage:pauseMsg displayMessage:NO callback:^(BOOL success) {