Przeglądaj źródła

异常情况处理

Steven 2 lat temu
rodzic
commit
ab29f77d77

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


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

@@ -62,8 +62,8 @@
             filePath = "KulexiuForTeacher/Module/Live/Controller/LiveRoomViewController.m"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "1632"
-            endingLineNumber = "1632"
+            startingLineNumber = "1677"
+            endingLineNumber = "1677"
             landmarkName = "-pauseLiveActionBack:"
             landmarkType = "7">
          </BreakpointContent>
@@ -71,32 +71,32 @@
       <BreakpointProxy
          BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
          <BreakpointContent
-            uuid = "EA9FEA48-4616-4094-BBE4-66F574A0FB75"
+            uuid = "C592A0B5-5A2D-4522-B37F-74ED2CE1BF52"
             shouldBeEnabled = "Yes"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
-            filePath = "KulexiuForTeacher/Module/Live/Controller/LiveRoomViewController.m"
+            filePath = "KulexiuForTeacher/Module/Mine/LiveList/View/UnderwayLiveCell.m"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "510"
-            endingLineNumber = "510"
-            landmarkName = "-appBecomeActive"
+            startingLineNumber = "50"
+            endingLineNumber = "50"
+            landmarkName = "-configWithSource:callback:"
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
       <BreakpointProxy
          BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
          <BreakpointContent
-            uuid = "C592A0B5-5A2D-4522-B37F-74ED2CE1BF52"
-            shouldBeEnabled = "Yes"
+            uuid = "5F8E49BA-F9D6-4A0E-90C8-17214395803C"
+            shouldBeEnabled = "No"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
-            filePath = "KulexiuForTeacher/Module/Mine/LiveList/View/UnderwayLiveCell.m"
+            filePath = "KulexiuForTeacher/Module/Live/Controller/LiveRoomViewController.m"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "50"
-            endingLineNumber = "50"
-            landmarkName = "-configWithSource:callback:"
+            startingLineNumber = "1415"
+            endingLineNumber = "1415"
+            landmarkName = "-sendMessage:displayMessage:callback:"
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>

+ 1 - 1
KulexiuForTeacher/KulexiuForTeacher/Module/Live/Controller/CreateLiveViewController.m

@@ -44,7 +44,7 @@
 - (void)configUI {
     self.bodyView = [CreateLiveBodyView shareInstance];
     [self.scrollView addSubview:self.bodyView];
-    CGFloat height = kScreenHeight -kNaviBarHeight - iPhoneXSafeBottomMargin;
+    CGFloat height = kScreenHeight -kNaviBarHeight - iPhoneXSafeBottomMargin > 750 ? kScreenHeight -kNaviBarHeight - iPhoneXSafeBottomMargin : 750;
     [self.bodyView mas_makeConstraints:^(MASConstraintMaker *make) {
         make.top.mas_equalTo(self.scrollView.mas_top);
         make.left.right.mas_equalTo(self.view);

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

@@ -764,12 +764,42 @@ typedef NS_ENUM(NSInteger, LIVEPAGE) {
         
         self.seatContainer.seatMemberArray = [NSMutableArray arrayWithArray:seatArray];
         [self.seatContainer refreshSeatUI];
+        [self refreshSeatApplyList];
+        
     }
     else {
         [self removeSeatContainer];
     }
 }
 
+
+- (void)refreshSeatApplyList {
+    // 查询不在列表的成员
+    NSMutableArray *requestArray = [NSMutableArray array];
+    NSMutableArray *memberArray = [self.seatContainer.seatMemberArray mutableCopy];
+    NSMutableArray *seatApplyArray = [self.seatApplyArray mutableCopy];
+    for (NSString *userId in memberArray) {
+        BOOL containUser = NO;
+        for (LiveSeatMember *member in seatApplyArray) {
+            if ([member.userId isEqualToString:userId]) {
+                containUser = YES;
+                NSLog(@"---- continue --");
+                continue;
+            }
+        }
+        if (containUser == NO) {
+            LiveSeatMember *member = [[LiveSeatMember alloc] init];
+            member.isConnected = YES;
+            member.userId = userId;
+            [requestArray addObject:member];
+        }
+    }
+    if (requestArray.count) {
+        self.seatApplyArray = [NSMutableArray arrayWithArray:requestArray];
+        [self refreshSeatApplyView];
+    }
+}
+
 - (void)removeSeatContainer {
     if ([self.livePageView.subviews containsObject:self.seatContainer]) {
         [self.seatContainer removeFromSuperview];
@@ -981,7 +1011,7 @@ typedef NS_ENUM(NSInteger, LIVEPAGE) {
             if (code == RCRTCCodeSignalServerNotConnect || code == RCRTCCodeParameterError || code == RCRTCCodeNotInRTCRoom || code == RCRTCCodeRTCTokenIsNull || code == RCRTCCodeHttpTimeoutError || code == RCRTCCodeHttpError || code == RCRTCCodeVoIPNotAvailable) {
                 NSLog(@"%@",[NSString stringWithFormat:@"加入失败 code %ld",code]);
                 [strongSelf MBPShow:@"加入直播间失败"];
-//                [strongSelf.navigationController dismissViewControllerAnimated:YES completion:nil];
+                //                [strongSelf.navigationController dismissViewControllerAnimated:YES completion:nil];
             }
             else {
                 [strongSelf notiferJoinSuccessToServiceCallback:^{
@@ -991,7 +1021,9 @@ typedef NS_ENUM(NSInteger, LIVEPAGE) {
                     strongSelf.room = room;
                     strongSelf.room.delegate = self;
                 }
- // 订阅流数据
+                // 订阅流数据
+                [strongSelf renderSeatView];
+                
                 [strongSelf countMemberCount];
                 // 发布本地视频流
                 if (strongSelf.isPauseLive == NO && strongSelf.isEnterBackground == NO) {
@@ -1021,6 +1053,7 @@ typedef NS_ENUM(NSInteger, LIVEPAGE) {
     [self.room.localUser publishDefaultLiveStreams:^(BOOL isSuccess, RCRTCCode code, RCRTCLiveInfo * _Nullable liveInfo) {
         if (code == RCRTCCodeSuccess) {
             weakSelf.needPublishStream = NO;
+            [weakSelf renderSeatView];
         }
         else {
             [weakSelf MBPShow:@"视频流发布失败"];
@@ -1036,6 +1069,7 @@ typedef NS_ENUM(NSInteger, LIVEPAGE) {
     _room = nil;
     MJWeakSelf;
     [[RCRTCEngine sharedInstance] leaveRoom:^(BOOL isSuccess, RCRTCCode code) {
+        NSLog(@"----- leave code -----%zd",code);
         dispatch_main_async_safe(^{
             [weakSelf sendLeaveMessageCallback:^(BOOL success) {
                 callback(success);
@@ -1301,7 +1335,18 @@ typedef NS_ENUM(NSInteger, LIVEPAGE) {
 
 - (void)refreshSeatApplyView {
     if (self.seatApplyArray.count) {
-        [self showSeatTips:self.seatApplyArray.count];
+        NSInteger count = 0;
+        for (LiveSeatMember *obj in self.seatApplyArray) {
+            if (obj.isConnected == NO) {
+                count++;
+            }
+        }
+        if (count > 0) {
+            [self showSeatTips:count];
+        }
+        else {
+            [self hideSeatTips];
+        }
     }
     else {
         [self hideSeatTips];

+ 5 - 1
KulexiuForTeacher/KulexiuForTeacher/Module/Live/LiveRoomMessage/KSDownSeatAllMessage.m

@@ -12,7 +12,9 @@
 
 - (NSData *)encode {
     NSMutableDictionary *multableDict = [NSMutableDictionary dictionary];
-    
+    if (self.senderUserInfo) {
+        [multableDict setObject:[self encodeUserInfo:self.senderUserInfo] forKey:@"user"];
+    }
     return [NSJSONSerialization dataWithJSONObject:multableDict options:kNilOptions error:nil];
 }
 
@@ -21,6 +23,8 @@
     NSDictionary *dictionary = [NSJSONSerialization JSONObjectWithData:data options:kNilOptions error:nil];
     NSDictionary *json = [[NSDictionary alloc] initWithDictionary:dictionary];
     if (json == nil) return;
+    NSDictionary *userinfoDic = dictionary[@"user"];
+    [self decodeUserInfo:userinfoDic];
 }
 
 

+ 5 - 1
KulexiuForTeacher/KulexiuForTeacher/Module/Live/LiveRoomMessage/KSRejectAllSeatMessage.m

@@ -12,7 +12,9 @@
 
 - (NSData *)encode {
     NSMutableDictionary *multableDict = [NSMutableDictionary dictionary];
-    
+    if (self.senderUserInfo) {
+        [multableDict setObject:[self encodeUserInfo:self.senderUserInfo] forKey:@"user"];
+    }
     return [NSJSONSerialization dataWithJSONObject:multableDict options:kNilOptions error:nil];
 }
 
@@ -21,6 +23,8 @@
     NSDictionary *dictionary = [NSJSONSerialization JSONObjectWithData:data options:kNilOptions error:nil];
     NSDictionary *json = [[NSDictionary alloc] initWithDictionary:dictionary];
     if (json == nil) return;
+    NSDictionary *userinfoDic = dictionary[@"user"];
+    [self decodeUserInfo:userinfoDic];
 }
 
 

+ 2 - 2
KulexiuForTeacher/KulexiuForTeacher/Module/Live/View/CreateLiveBodyView.xib

@@ -11,7 +11,7 @@
         <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
         <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
         <view contentMode="scaleToFill" id="iN0-l3-epB" customClass="CreateLiveBodyView">
-            <rect key="frame" x="0.0" y="0.0" width="414" height="755"/>
+            <rect key="frame" x="0.0" y="0.0" width="414" height="750"/>
             <autoresizingMask key="autoresizingMask"/>
             <subviews>
                 <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="IUC-2g-F8n">
@@ -116,7 +116,7 @@
                     </userDefinedRuntimeAttributes>
                 </view>
                 <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="NVl-Up-QMs">
-                    <rect key="frame" x="28" y="668" width="358" height="44"/>
+                    <rect key="frame" x="28" y="663" width="358" height="44"/>
                     <color key="backgroundColor" red="0.1764705882" green="0.78039215689999997" blue="0.66666666669999997" alpha="1" colorSpace="calibratedRGB"/>
                     <constraints>
                         <constraint firstAttribute="height" constant="44" id="HUl-sw-SN4"/>

+ 17 - 0
KulexiuForTeacher/KulexiuForTeacher/Module/Live/View/SeatListView/LiveMemberSeatCell.m

@@ -51,6 +51,23 @@
         [self.approveButton setTitle:@"下麦" forState:UIControlStateNormal];
         self.seatStatus.text = @"连麦中";
     }
+    if ([NSString isEmptyString:member.name]) {
+        [KSNetworkingManager imUserFriendQueryDetail:KS_POST userId:member.userId success:^(NSDictionary * _Nonnull dic) {
+            if ([dic integerValueForKey:@"code"] == 200 && [dic boolValueForKey:@"status"]) {
+                NSDictionary *result = [dic dictionaryValueForKey:@"data"];
+                self.userName.text = [result stringValueForKey:@"friendNickname"];
+                [self.userAvatar sd_setImageWithURL:[NSURL URLWithString:[[result stringValueForKey:@"friendAvatar"] getUrlEndcodeString]] placeholderImage:[UIImage imageNamed:USERDEFAULT_LOGO]];
+                member.name = [result stringValueForKey:@"friendNickname"];
+                member.avatar = [result stringValueForKey:@"friendAvatar"];
+            }
+            else {
+                self.userName.text = @"连麦用户";
+            }
+            
+        } faliure:^(NSError * _Nonnull error) {
+            
+        }];
+    }
 }
 
 - (IBAction)sureAction:(id)sender {

+ 1 - 0
KulexiuForTeacher/KulexiuForTeacher/Module/Mine/LiveList/View/UnderwayLiveCell.m

@@ -62,6 +62,7 @@
     }
     self.liveImage.animationDuration = 1.0f;
     self.liveImage.animationImages = imageArray;
+    self.liveImage.highlightedAnimationImages = imageArray;
     self.liveImage.animationRepeatCount = 0;
     
 }