| | |
| | | NSString * LCSdkToken; |
| | | NSString * LCHostApi; |
| | | |
| | | |
| | | NSString * cancelStr; |
| | | NSString * tipMsgStr; |
| | | |
| | | CGFloat Height66; |
| | | bool isShowErrorAlert; |
| | | // int _openDoorTimeout; |
| | |
| | | if (self.titleName&&self.titleName.length!=0) { |
| | | self.titleUILabel.text=self.titleName; |
| | | } |
| | | |
| | | [NSNotificationCenter.defaultCenter addObserver:self |
| | | selector:@selector(registrationUpdate:) |
| | | name:@"LinphoneRegistrationUpdate" |
| | | object:nil]; |
| | | } |
| | | |
| | | |
| | | - (void)registrationUpdate:(NSNotification *)notif { |
| | | int state = [[notif.userInfo objectForKey:@"state"] intValue]; |
| | | if(state==11){//挂断了 |
| | | NSLog(@"挂断或出错了"); |
| | | [self showUIAlertViewWithBack:@"监视结束"]; |
| | | |
| | | } |
| | | } |
| | | |
| | | -(void)initLlanguage{ |
| | | NSString *languageName = [[[NSUserDefaults standardUserDefaults] objectForKey:@"AppleLanguages"] objectAtIndex:0]; |
| | |
| | | unlockStr = @"开锁"; |
| | | endOfMonitoringStr = @"监视结束"; |
| | | unlockSuccessfullyStr = @"开锁成功"; |
| | | cancelStr = @"取消"; |
| | | tipMsgStr = @"确定开锁吗?"; |
| | | |
| | | }else{ |
| | | tipStr = @"Prompt"; |
| | |
| | | unlockStr = @"Unlock"; |
| | | endOfMonitoringStr = @"End of monitoring"; |
| | | unlockSuccessfullyStr = @"Unlock successfully"; |
| | | cancelStr = @"Cancel"; |
| | | tipMsgStr = @"Are you sure to unlock?"; |
| | | } |
| | | |
| | | |
| | |
| | | [_unlockTextBtn setTitleColor:TextColor forState:UIControlStateNormal]; |
| | | //开锁 |
| | | if(self.hdlLinphoneCallDelegate != NULL){ |
| | | [self.hdlLinphoneCallDelegate onUnlockAction]; |
| | | UIAlertController *alertController = [UIAlertController alertControllerWithTitle:tipStr message:tipMsgStr preferredStyle:UIAlertControllerStyleAlert]; |
| | | |
| | | // 添加取消按钮 |
| | | UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:cancelStr style:UIAlertActionStyleCancel handler:nil]; |
| | | [alertController addAction:cancelAction]; |
| | | |
| | | // 添加确认按钮 |
| | | WEAKSELF_AT |
| | | UIAlertAction *confirmAction = [UIAlertAction actionWithTitle:okStr style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { |
| | | |
| | | [weakSelf_AT.hdlLinphoneCallDelegate onUnlockAction]; |
| | | }]; |
| | | [alertController addAction:confirmAction]; |
| | | |
| | | // 获取当前视图控制器 |
| | | UIViewController *currentViewController = [UIApplication sharedApplication].keyWindow.rootViewController; |
| | | |
| | | // 显示弹窗 |
| | | [currentViewController presentViewController:alertController animated:YES completion:nil]; |
| | | |
| | | } |
| | | |
| | | } |
| | |
| | | /** 开启倒计时 */ |
| | | - (void)startOpenDoorCountdown { |
| | | |
| | | if (_openDoorTimeout > 20) { |
| | | if (_openDoorTimeout > 10) { |
| | | return; |
| | | } |
| | | |
| | |
| | | |
| | | dispatch_source_set_event_handler(_openDoorTimer, ^{ |
| | | WEAKSELF_AT |
| | | if(weakSelf_AT.openDoorTimeout >= 20 ){// 计时结束 |
| | | if(weakSelf_AT.openDoorTimeout >= 10 ){// 计时结束 |
| | | // 关闭定时器 |
| | | dispatch_source_cancel(weakSelf_AT.openDoorTimer); |
| | | |
| | |
| | | 暂停播放 |
| | | */ |
| | | - (void)stopPlay { |
| | | |
| | | [HDLLinphoneManager.instance endCall]; |
| | | |
| | | |
| | | } |
| | | |
| | | - (void)startPlay { |