| | |
| | | #import <AVFoundation/AVFoundation.h> |
| | | #import <Photos/Photos.h> |
| | | #import <AudioToolbox/AudioToolbox.h> |
| | | #import "LCKit.h" |
| | | #import "LCUtlis.h" |
| | | #import "LCApiKit.h" |
| | | #import <LCOpenSDKDynamic/LCOpenSDKDynamic.h> |
| | | |
| | | @interface LCOnIntercomViewController ()<LCOpenSDK_EventListener, LCOpenSDK_TalkerListener> |
| | | |
| | |
| | | //开始反呼 |
| | | [self StartReverseCall]; |
| | | [self ShowCalltimeBtn:callingStr]; |
| | | //暂时不支持开锁功能 |
| | | [self setUnlock:NO]; |
| | | // //暂时不支持开锁功能 |
| | | // [self setUnlock:NO]; |
| | | //注册开锁成功监听 |
| | | [self addOpenSuccessAction]; |
| | | |
| | | // Do any additional setup after loading the view. |
| | | } |
| | | |
| | |
| | | |
| | | -(void)unlockAction{ |
| | | [_unlockImgBtn setImage:[UIImage imageNamed:@"ic_esvideo_on_unlock_unselect"] forState:UIControlStateNormal]; |
| | | // //开锁 |
| | | // if(_es){ |
| | | // [_es openTheDoorWithRoomid:_mESRoomID]; |
| | | // } |
| | | |
| | | //开锁 |
| | | if(self.mLCCallDelegate != NULL){ |
| | | [self.mLCCallDelegate onUnlockAction]; |
| | | } |
| | | } |
| | | |
| | | #pragma 挂断和开锁 |
| | |
| | | //挂断按钮事件 |
| | | -(void)hangUpAction{ |
| | | //1.回调事件 |
| | | if(self.mESCallDelegate != NULL){ |
| | | if(self.mLCCallDelegate != NULL){ |
| | | if(isAnswer){ |
| | | //如果之前已经接听了,回调是挂断 |
| | | [self.mESCallDelegate onHangUpAction:_callTimeout]; |
| | | [self.mLCCallDelegate onHangUpAction:_callTimeout]; |
| | | }else{ |
| | | //如果之前没接听了,回调是拒接 |
| | | [self.mESCallDelegate onRejectCallAction]; |
| | | [self.mLCCallDelegate onRejectCallAction]; |
| | | } |
| | | } |
| | | //2.页面关闭 |
| | |
| | | [self startCountdown]; |
| | | isAnswer = YES; |
| | | |
| | | if(self.mESCallDelegate != NULL){ |
| | | [self.mESCallDelegate onAnswerAction]; |
| | | if(self.mLCCallDelegate != NULL){ |
| | | [self.mLCCallDelegate onAnswerAction]; |
| | | } |
| | | |
| | | } |
| | |
| | | _openDoorTimeout = 0; |
| | | [self startOpenDoorCountdown]; |
| | | [self showUIAlertView:unlockSuccessfullyStr]; |
| | | // 开锁成功回调 |
| | | if(self.mESCallDelegate != NULL){ |
| | | [self.mESCallDelegate onUnlockAction]; |
| | | } |
| | | |
| | | } |
| | | |
| | | -(void)setUnlock:(BOOL)ISEnable{ |
| | |
| | | if (!error) { |
| | | message = saveToTheAlbumsStr; |
| | | // 截图成功回调 |
| | | if(self.mESCallDelegate != NULL){ |
| | | [self.mESCallDelegate onScreenshotSuccessfulAction:image]; |
| | | if(self.mLCCallDelegate != NULL){ |
| | | [self.mLCCallDelegate onScreenshotSuccessfulAction:image]; |
| | | } |
| | | } |
| | | else |
| | |
| | | //} |
| | | |
| | | |
| | | /// |
| | | - (void)addOpenSuccessAction { |
| | | |
| | | [[NSNotificationCenter defaultCenter] removeObserver:self |
| | | name:LCCallDelegateOpenDoorSuccess |
| | | object:nil]; |
| | | |
| | | [[NSNotificationCenter defaultCenter] addObserver:self |
| | | selector:@selector(setOpenDoorSuccess) |
| | | name:LCCallDelegateOpenDoorSuccess |
| | | object:nil]; |
| | | } |
| | | |
| | | - (void)removeOpenSuccessAction { |
| | | |
| | | [[NSNotificationCenter defaultCenter] removeObserver:self |
| | | name:LCCallDelegateOpenDoorSuccess |
| | | object:nil]; |
| | | } |
| | | |
| | | @end |
| | | |