Browse Source

网络教室优化。

Steven 1 year ago
parent
commit
a5c1515e9d

+ 4 - 4
KulexiuForTeacher/KulexiuForTeacher.xcodeproj/project.pbxproj

@@ -8558,7 +8558,7 @@
 				CLANG_ENABLE_MODULES = YES;
 				CODE_SIGN_ENTITLEMENTS = KulexiuForTeacher/KulexiuForTeacher.entitlements;
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 1.4.6;
+				CURRENT_PROJECT_VERSION = 1.4.7;
 				DEVELOPMENT_TEAM = B2AP53HHTU;
 				ENABLE_BITCODE = NO;
 				FRAMEWORK_SEARCH_PATHS = (
@@ -8604,7 +8604,7 @@
 					"$(PROJECT_DIR)/KulexiuForTeacher/Common/ThirdPart/UMSocialSDK/share/share_ios_6.10.4/SocialLibraries/QQ",
 					"$(PROJECT_DIR)/KulexiuForTeacher/Common/ThirdPart/UMSocialSDK/share/share_ios_6.10.4/UMSocialSDKPlugin",
 				);
-				MARKETING_VERSION = 1.4.6;
+				MARKETING_VERSION = 1.4.7;
 				PRODUCT_BUNDLE_IDENTIFIER = com.Colexiu.KulexiuForTeacher;
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				SWIFT_EMIT_LOC_STRINGS = YES;
@@ -8624,7 +8624,7 @@
 				CLANG_ENABLE_MODULES = YES;
 				CODE_SIGN_ENTITLEMENTS = KulexiuForTeacher/KulexiuForTeacher.entitlements;
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 1.4.6;
+				CURRENT_PROJECT_VERSION = 1.4.7;
 				DEVELOPMENT_TEAM = B2AP53HHTU;
 				ENABLE_BITCODE = NO;
 				FRAMEWORK_SEARCH_PATHS = (
@@ -8670,7 +8670,7 @@
 					"$(PROJECT_DIR)/KulexiuForTeacher/Common/ThirdPart/UMSocialSDK/share/share_ios_6.10.4/SocialLibraries/QQ",
 					"$(PROJECT_DIR)/KulexiuForTeacher/Common/ThirdPart/UMSocialSDK/share/share_ios_6.10.4/UMSocialSDKPlugin",
 				);
-				MARKETING_VERSION = 1.4.6;
+				MARKETING_VERSION = 1.4.7;
 				PRODUCT_BUNDLE_IDENTIFIER = com.Colexiu.KulexiuForTeacher;
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				SWIFT_EMIT_LOC_STRINGS = YES;

+ 8 - 8
KulexiuForTeacher/KulexiuForTeacher/Common/Base/KSAQRecordManager.m

@@ -158,10 +158,6 @@ static const int kNumberBuffers = 3;
         OSStatus status = AudioQueueStop(self.audioQueue, true);
         if (status == noErr) {
             self.isRunning = NO;
-            for (int i = 0; i < kNumberBuffers; ++i) {
-                AudioQueueBufferRef buffer = self->mBuffers[i];
-                AudioQueueFreeBuffer(self.audioQueue, buffer);
-            }
         }
     });
 }
@@ -186,6 +182,13 @@ static const int kNumberBuffers = 3;
     });
 }
 
+- (void)freeBuffer {
+    for (int i = 0; i < kNumberBuffers; ++i) {
+        AudioQueueBufferRef buffer = self->mBuffers[i];
+        AudioQueueFreeBuffer(self.audioQueue, buffer);
+    }
+}
+
 
 - (void)freeAudioQueue {
     dispatch_async(_queue, ^{
@@ -193,10 +196,7 @@ static const int kNumberBuffers = 3;
             self.isRunning = NO;
             OSStatus stopStatus = AudioQueueStop(self.audioQueue, true);
             if (stopStatus != noErr) { // error
-                for (int i = 0; i < kNumberBuffers; ++i) {
-                    AudioQueueBufferRef buffer = self->mBuffers[i];
-                    AudioQueueFreeBuffer(self.audioQueue, buffer);
-                }
+                [self freeBuffer];
             }
         }
         AudioFileClose(self.mAudioFile);

+ 1 - 1
KulexiuForTeacher/KulexiuForTeacher/Common/Base/KSAccompanyWebViewController.m

@@ -271,7 +271,7 @@
         }
         [self setupProgress];
         // 修改userAgent
-        [self setUserAgent];
+        [self loadRequest];
     }
     else {
         [self.myWebView reload];

+ 1 - 1
KulexiuForTeacher/KulexiuForTeacher/Common/Base/KSBaseWKWebViewController.h

@@ -51,7 +51,7 @@ NS_ASSUME_NONNULL_BEGIN
 
 - (void)setupProgress;
 
-- (void)setUserAgent;
+- (void)loadRequest;
 
 + (WKProcessPool*)singleWkProcessPool;
 

+ 6 - 10
KulexiuForTeacher/KulexiuForTeacher/Common/Base/KSBaseWKWebViewController.m

@@ -244,8 +244,8 @@ typedef NS_ENUM(NSInteger, CHOOSETYPE) {
             // Fallback on earlier versions
         }
         [self setupProgress];
-        // 修改userAgent
-        [self setUserAgent];
+        
+        [self loadRequest];
         
         [self.view bringSubviewToFront:self.navView];
         [self.view bringSubviewToFront:self.webBackButton];
@@ -255,14 +255,10 @@ typedef NS_ENUM(NSInteger, CHOOSETYPE) {
     }
 }
 
-- (void)setUserAgent {
-    MJWeakSelf;
-    [self.myWebView evaluateJavaScript:@"navigator.userAgent" completionHandler:^(id result, NSError *error) {
-        NSString *oldUserAgent = result;
-        NSString *newUserAgent = [NSString stringWithFormat:@"%@ %@ %@",oldUserAgent,@"COLEXIUAPPI",@"COLEXIUTEACHER"];
-        weakSelf.myWebView.customUserAgent = newUserAgent;
-        [weakSelf loadRequest];;
-    }];
+- (void)configUserAgent:(WKWebViewConfiguration *)config {
+    NSString *oldUserAgent = config.applicationNameForUserAgent;
+    NSString *newAgent = [NSString stringWithFormat:@"%@ %@ %@",oldUserAgent,@"COLEXIUAPPI",@"COLEXIUTEACHER"];
+    config.applicationNameForUserAgent = newAgent;
 }
 
 - (void)loadRequest {

+ 1 - 1
KulexiuForTeacher/KulexiuForTeacher/Common/Define/KSDomain.h

@@ -16,7 +16,7 @@
 //#define SOCKET_URL (@"wss://dev.colexiu.com/audioAnalysis")
 //#define JSPUSH_ENVIRONMENT (NO)
 //#define RCIM_KEY (@"0vnjpoad0jbdz")
-//#define SUBMIT_UUID (YES)
+//#define SUBMIT_UUID (NO)
 
 // 预生产环境
 //#define hostURL (@"https://ponline.colexiu.com")

+ 1 - 0
KulexiuForTeacher/KulexiuForTeacher/Module/Chat/View/ChatNavView.m

@@ -66,6 +66,7 @@
         self.viewLeft.constant = left;
     }];
 }
+
 - (IBAction)chatAction:(id)sender {
     if (self.isChooseChat) {
         return;

+ 6 - 2
KulexiuForTeacher/KulexiuForTeacher/Module/Classroom/Controller/NewClassRoomViewController.m

@@ -979,7 +979,7 @@
 
 - (CGRect)getWBoardFrame {
     CGRect mainVideoFrame = self.containerView.currentVideoFrame;
-    mainVideoFrame.origin.x += iPhoneXSafeTopMargin;
+    mainVideoFrame.origin.x = 0;
     mainVideoFrame.origin.y = 10;
     return mainVideoFrame;
 }
@@ -1189,7 +1189,7 @@
         _wBoardCtrl.roomId = roomId;
         _wBoardCtrl.isRatationImage = self.isRorationImage;
         _wBoardCtrl.subjectId = self.subjectId;
-        [_wBoardCtrl moveToSuperView:self.view];
+        [_wBoardCtrl moveToSuperView:self.containerView];
     }
     return _wBoardCtrl;
 }
@@ -1883,6 +1883,10 @@
                 [self.whiteboardListView reloadDataSource];
                 // 收起
                 [self.toolView hiddenToolViewWithAnimation:YES];
+                if (self.playerView.isDisplay) {
+                    [self canclePlay];
+                    [self.playerView hideView];
+                }
             });
         }
             break;

+ 0 - 1
KulexiuForTeacher/KulexiuForTeacher/Module/Classroom/View/CoursewareView/CoursewareAlertView.m

@@ -194,7 +194,6 @@
         [tableView reloadRowsAtIndexPaths:@[indexPath, [NSIndexPath indexPathForRow:self.lastChooseIndex inSection:0]] withRowAnimation:UITableViewRowAnimationNone];
         self.lastChooseIndex = indexPath.row;
     }
-    
 }
 
 #pragma mark ---- lazying