|
@@ -116,6 +116,8 @@
|
|
|
// Do any additional setup after loading the view.
|
|
|
[self configAudioSession];
|
|
|
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(appEnterBackground) name:@"appEnterBackground" object:nil];
|
|
|
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(appEnterForeground) name:@"appBecomeActive" object:nil];
|
|
|
+
|
|
|
}
|
|
|
|
|
|
- (void)connectSocketService {
|
|
@@ -193,6 +195,14 @@
|
|
|
[self handerAudioInterruption];
|
|
|
}
|
|
|
|
|
|
+- (void)appEnterForeground {
|
|
|
+ if (self.isCameraOpen) {
|
|
|
+ if ([self.videoRecordManager getSessionStatusisActive] == NO) {
|
|
|
+ [self.videoRecordManager configSessiondisplayInView:self.viewContainer];
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
- (void)initWebView {
|
|
|
[self.view addSubview:self.navView];
|
|
|
CGFloat topHeight = kNaviBarHeight;
|
|
@@ -442,18 +452,19 @@
|
|
|
NSMutableDictionary *sendParm = [NSMutableDictionary dictionaryWithDictionary:parm];
|
|
|
NSMutableDictionary *contentParm = [NSMutableDictionary dictionaryWithDictionary:[sendParm dictionaryValueForKey:@"content"]];
|
|
|
if (self.videoRecordManager) {
|
|
|
+ MJWeakSelf;
|
|
|
[self.videoRecordManager uploadRecordVideoSuccess:^(NSString * _Nonnull videoUrl) {
|
|
|
[contentParm setValue:@"success" forKey:@"type"];
|
|
|
[contentParm setValue:videoUrl forKey:@"filePath"];
|
|
|
[contentParm setValue:@"上传成功" forKey:@"message"];
|
|
|
[sendParm setValue:contentParm forKey:@"content"];
|
|
|
|
|
|
- [self postMessage:sendParm];
|
|
|
+ [weakSelf postMessage:sendParm];
|
|
|
} failure:^(NSString * _Nonnull desc) {
|
|
|
[contentParm setValue:@"error" forKey:@"type"];
|
|
|
[contentParm setValue:desc forKey:@"message"];
|
|
|
[sendParm setValue:contentParm forKey:@"content"];
|
|
|
- [self postMessage:sendParm];
|
|
|
+ [weakSelf postMessage:sendParm];
|
|
|
}];
|
|
|
}
|
|
|
}
|
|
@@ -718,7 +729,7 @@
|
|
|
}
|
|
|
|
|
|
} faliure:^(NSError * _Nonnull error) {
|
|
|
- faliure();
|
|
|
+
|
|
|
}];
|
|
|
}
|
|
|
|
|
@@ -876,7 +887,7 @@
|
|
|
}
|
|
|
|
|
|
#pragma mark-------- KSAQRecordManagerDelegate
|
|
|
-- (void)audioRecordInterruption {
|
|
|
+- (void)recordInterruption {
|
|
|
NSDictionary *postParm = @{@"api" : @"cancelEvaluating",
|
|
|
@"content" : @{@"reson":@"录制错误,请重试"}
|
|
|
};
|