|
@@ -58,10 +58,17 @@ typedef NS_ENUM(NSInteger, KICKTYPE) {
|
|
|
|
|
|
@property (nonatomic, strong) SubjectImageModel *guideImageModel;
|
|
@property (nonatomic, strong) SubjectImageModel *guideImageModel;
|
|
|
|
|
|
|
|
+@property (nonatomic, assign) BOOL isSimulitionExam; // 是否模拟考试
|
|
|
|
+
|
|
@end
|
|
@end
|
|
|
|
|
|
@implementation ClassroomViewController
|
|
@implementation ClassroomViewController
|
|
|
|
|
|
|
|
+- (void)setRegistrationId:(NSString *)registrationId {
|
|
|
|
+ _registrationId = registrationId;
|
|
|
|
+ _isSimulitionExam = [registrationId containsString:@"S"] ? YES : NO;
|
|
|
|
+}
|
|
|
|
+
|
|
#pragma mark - Life cycle
|
|
#pragma mark - Life cycle
|
|
|
|
|
|
- (void)viewWillAppear:(BOOL)animated {
|
|
- (void)viewWillAppear:(BOOL)animated {
|
|
@@ -181,13 +188,23 @@ typedef NS_ENUM(NSInteger, KICKTYPE) {
|
|
[KSNormalAlertView ks_showAlertWithTitle:@"确认关闭麦克风吗?" leftTitle:@"取消" rightTitle:@"确认" cancel:^{
|
|
[KSNormalAlertView ks_showAlertWithTitle:@"确认关闭麦克风吗?" leftTitle:@"取消" rightTitle:@"确认" cancel:^{
|
|
} confirm:^{
|
|
} confirm:^{
|
|
button.selected = YES;
|
|
button.selected = YES;
|
|
- [[ClassroomService sharedService] enableDevice:NO withType:DeviceTypeMicrophone];
|
|
|
|
|
|
+ if (self.isSimulitionExam) {
|
|
|
|
+ [[RTCService sharedInstance] setMicrophoneDisable:YES];
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ [[ClassroomService sharedService] enableDevice:NO withType:DeviceTypeMicrophone];
|
|
|
|
+ }
|
|
}];
|
|
}];
|
|
|
|
|
|
}
|
|
}
|
|
else {
|
|
else {
|
|
button.selected = NO;
|
|
button.selected = NO;
|
|
- [[ClassroomService sharedService] enableDevice:YES withType:DeviceTypeMicrophone];
|
|
|
|
|
|
+ if (self.isSimulitionExam) {
|
|
|
|
+ [[RTCService sharedInstance] setMicrophoneDisable:NO];
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ [[ClassroomService sharedService] enableDevice:YES withType:DeviceTypeMicrophone];
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
@@ -197,12 +214,24 @@ typedef NS_ENUM(NSInteger, KICKTYPE) {
|
|
[KSNormalAlertView ks_showAlertWithTitle:@"确认关闭摄像头吗?" leftTitle:@"取消" rightTitle:@"确认" cancel:^{
|
|
[KSNormalAlertView ks_showAlertWithTitle:@"确认关闭摄像头吗?" leftTitle:@"取消" rightTitle:@"确认" cancel:^{
|
|
} confirm:^{
|
|
} confirm:^{
|
|
button.selected = YES;
|
|
button.selected = YES;
|
|
- [[ClassroomService sharedService] enableDevice:NO withType:DeviceTypeCamera];
|
|
|
|
|
|
+
|
|
|
|
+ if (self.isSimulitionExam) {
|
|
|
|
+ [[RTCService sharedInstance] setCameraDisable:YES];
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ [[ClassroomService sharedService] enableDevice:NO withType:DeviceTypeCamera];
|
|
|
|
+ }
|
|
}];
|
|
}];
|
|
}
|
|
}
|
|
else {
|
|
else {
|
|
button.selected = NO;
|
|
button.selected = NO;
|
|
- [[ClassroomService sharedService] enableDevice:YES withType:DeviceTypeCamera];
|
|
|
|
|
|
+
|
|
|
|
+ if (self.isSimulitionExam) {
|
|
|
|
+ [[RTCService sharedInstance] setCameraDisable:NO];
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ [[ClassroomService sharedService] enableDevice:YES withType:DeviceTypeCamera];
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
@@ -245,28 +274,7 @@ typedef NS_ENUM(NSInteger, KICKTYPE) {
|
|
|
|
|
|
// 判断是否需要退出房间
|
|
// 判断是否需要退出房间
|
|
- (void)refreshClassStatus {
|
|
- (void)refreshClassStatus {
|
|
- /*
|
|
|
|
- NSString *userType = UserDefault(UserTypeKey);
|
|
|
|
- if (![userType isEqualToString:@"1"] && self.isQuitRoom == NO) {
|
|
|
|
- NSString *formatString = @"yyyy-MM-dd HH:mm:ss";
|
|
|
|
- NSDate *endDate = [NSDate dateFromString:self.classEndTime format:formatString];
|
|
|
|
- NSTimeInterval endDuration = [[NSDate date] timeIntervalSinceDate:endDate];
|
|
|
|
- if (endDuration >= self.quitRoomTime * 60) {
|
|
|
|
- self.isQuitRoom = YES;
|
|
|
|
- // 退出房间
|
|
|
|
- [self showMessage:@"课程已结束"];
|
|
|
|
- dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
|
|
|
- // 课程结束退出房间
|
|
|
|
- SealClassLog(@"ClassEnd!");
|
|
|
|
- self.hud = [MBProgressHUD showHUDAddedTo:self.view animated:YES];
|
|
|
|
- [[LoginHelper sharedInstance] logout:^{
|
|
|
|
- } error:^(RongRTCCode code) {
|
|
|
|
- [self.hud hideAnimated:YES];
|
|
|
|
- }];
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- */
|
|
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
#pragma mark ------ 退出RTC房间并重新加入
|
|
#pragma mark ------ 退出RTC房间并重新加入
|
|
@@ -705,6 +713,7 @@ typedef NS_ENUM(NSInteger, KICKTYPE) {
|
|
}
|
|
}
|
|
_videoListView = [[ClassVideoListView alloc] initWithFrame:CGRectMake(width + iPhoneXSafeTopMargin + 5, 10, kScreenWidth - (width + 10 + iPhoneXSafeTopMargin) - iPhoneXSafeBottomMargin, height)];
|
|
_videoListView = [[ClassVideoListView alloc] initWithFrame:CGRectMake(width + iPhoneXSafeTopMargin + 5, 10, kScreenWidth - (width + 10 + iPhoneXSafeTopMargin) - iPhoneXSafeBottomMargin, height)];
|
|
_videoListView.delegate = self;
|
|
_videoListView.delegate = self;
|
|
|
|
+ _videoListView.isSimulitionExam = self.isSimulitionExam;
|
|
}
|
|
}
|
|
return _videoListView;
|
|
return _videoListView;
|
|
}
|
|
}
|