| | |
| | | #import <Photos/Photos.h> |
| | | #import "HDLLinphoneUtlis.h" |
| | | #import "HDLLinphoneManager.h" |
| | | |
| | | #import "HDLLinPhoneCommon.h" |
| | | //#import "HDLLinPhoneSDK-Swift.h" |
| | | //#import "LCUtlis.h" |
| | | //#import "LCApiKit.h" |
| | |
| | | @property (nonatomic,strong) dispatch_source_t openDoorTimer; |
| | | @property (nonatomic, assign) int openDoorTimeout; |
| | | |
| | | |
| | | @property (nonatomic, assign) BOOL isHangUpByRemote;//æ¯å¦å¯¹æ¹è¿ç¨ææ |
| | | /// ææ¾å¨ |
| | | //@property (nonatomic, strong) LCOpenSDK_PlayWindow *playWindow; |
| | | |
| | |
| | | |
| | | NSString * LCSdkToken; |
| | | NSString * LCHostApi; |
| | | NSString * cancelStr; |
| | | NSString * tipMsgStr; |
| | | |
| | | CGFloat Height66; |
| | | bool isShowErrorAlert; |
| | |
| | | [self initData]; |
| | | [self initESVideo]; |
| | | [self StartMonitoring]; |
| | | // [HDLLinphoneManager.instance enableMicro:false]; |
| | | [HDLLinphoneManager.instance enableMicro:false]; |
| | | |
| | | // //ææ¶ä¸æ¯æå¼éåè½ |
| | | // [self setUnlock:NO]; |
| | |
| | | int state = [[notif.userInfo objectForKey:@"state"] intValue]; |
| | | if ((state == LinphoneCallEnd || state == LinphoneCallError)){//ææäº |
| | | NSLog(@"æææåºéäº"); |
| | | [self showUIAlertViewWithBack:@"çè§ç»æ"]; |
| | | self.isHangUpByRemote=YES; |
| | | [self showUIAlertViewWithBack:endOfMonitoringStr]; |
| | | |
| | | } |
| | | } |
| | |
| | | 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?"; |
| | | } |
| | | |
| | | |
| | |
| | | -(UIView *)videoView{ |
| | | if (_videoView == Nil) { |
| | | _videoView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, GetRealWidth((210)))]; |
| | | _videoView.backgroundColor = UIColor.lightGrayColor; |
| | | // _videoView.backgroundColor = UIColor.lightGrayColor; |
| | | _videoView.backgroundColor = UIColor.blackColor; |
| | | _videoView.layer.shadowColor = [UIColor colorWithRed:0/255.0 green:0/255.0 blue:0/255.0 alpha:0.25].CGColor; |
| | | _videoView.layer.shadowOffset = CGSizeMake(0,0.5); |
| | | _videoView.layer.shadowOpacity = 1; |
| | | _videoView.layer.shadowRadius = 0; |
| | | _videoView.layer.masksToBounds=YES; |
| | | } |
| | | return _videoView; |
| | | } |
| | |
| | | [_screenshotTextBtn setTitleColor:TextColor forState:UIControlStateNormal]; |
| | | NSLog(@"æªå¾"); |
| | | //æªå¾ |
| | | // if(self.playWindow){ |
| | | // [self saveThumbImage]; |
| | | // } |
| | | [HDLLinphoneManager.instance snapShotWithView:self.videoView]; |
| | | |
| | | } |
| | |
| | | [_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; |
| | | |
| | | // æ¾ç¤ºå¼¹çª |
| | | [self presentViewController:alertController animated:YES completion:nil]; |
| | | } |
| | | |
| | | } |
| | |
| | | å¼å§çæ§ |
| | | */ |
| | | -(void)StartMonitoring{ |
| | | NSLog(@"å¼å§å¼å«ï¼@%@",self.userName); |
| | | NSLog(@"å¼å§å¼å«ï¼%@",self.userName); |
| | | [HDLLinphoneManager.instance startCall:self.userName]; |
| | | |
| | | } |
| | |
| | | [alertController addAction:[UIAlertAction actionWithTitle:okStr style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { |
| | | [self backAction]; |
| | | }]]; |
| | | |
| | | [self presentViewController:alertController animated:YES completion:nil]; |
| | | // [[HDLLinPhoneCommon rootController] presentViewController:alertController animated:YES completion:nil]; |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | - (void)viewWillAppear:(BOOL)animated { |
| | | [super viewWillAppear:animated]; |
| | | |
| | | |
| | | |
| | | } |
| | | -(void)viewWillDisappear:(BOOL)animated{ |
| | | [super viewWillDisappear:animated]; |
| | | |
| | | //1.æåSDKç¸å
³ææ¾ |
| | | [self stopPlay]; |
| | | if (!self.isHangUpByRemote) { |
| | | [self stopPlay]; |
| | | } |
| | | //2.Delegateéæ¾ |
| | | // self.mLCCallDelegate = nil; |
| | | //3.宿¶å¨éæ¾ |