| | |
| | | return _doorPlayerView; |
| | | } |
| | | |
| | | - (void)viewWillAppear:(BOOL)animated { |
| | | [super viewWillAppear:animated]; |
| | | if (self.navigationController) { |
| | | self.navigationController.navigationBar.hidden = NO; |
| | | [self.navigationController setNavigationBarHidden:NO]; |
| | | } |
| | | } |
| | | |
| | | - (void)viewDidAppear:(BOOL)animated { |
| | | [super viewDidAppear:animated]; |
| | | self.navigationController.navigationBar.hidden = NO;//2021-02-01 |
| | |
| | | [self.ignoreButton setTitle:HDLEZLocallizedString(@"device_callout_ignore") forState:UIControlStateNormal]; |
| | | self.ignoreButton.imagePosition = HDLEZOPButtonImagePositionTop; |
| | | self.ignoreButton.spacingBetweenImageAndTitle = 12.; |
| | | [self.answerButton setTitle:HDLEZLocallizedString(@"device_callout_answer") forState:UIControlStateNormal]; |
| | | [self.answerButton setTitle:HDLEZLocallizedString(@"device_callout_answered") forState:UIControlStateNormal]; |
| | | self.answerButton.imagePosition = HDLEZOPButtonImagePositionTop; |
| | | self.answerButton.spacingBetweenImageAndTitle = 12.; |
| | | |
| | |
| | | [self.fullSceneToolView configPlayStatus:YES soundOn:YES videoLevel:_cameraInfo.videoLevel toolOperation:^(HDLEZVideoFullSceneOperation operationType) { |
| | | [weakSelf doorLockFullSceneOperation:operationType]; |
| | | }]; |
| | | |
| | | // 挂断弹框 |
| | | if (_isShowAlert) { |
| | | [self showCallOutAlertView]; |
| | | } else { |
| | | [self hiddenCallOutAlertView]; |
| | | } |
| | | } |
| | | |
| | | /*开锁 |
| | | */ |
| | | -(void)unlockDoor{ |
| | | if (![self isSupportOneKeyUnlockDoor]) { // 不支持一键开锁 |
| | | [UIView dd_showMessage:@"该设备不支持一键开锁"]; |
| | | return; |
| | | } |
| | | [HDLEZAlertInputView showInputAlertWithtitle:HDLEZLocallizedString(@"device_please_input_door_password") cancleTitle:HDLEZLocallizedString(@"device_temp_cancle") sureTitle:HDLEZLocallizedString(@"device_temp_sure") keyboardType:UIKeyboardTypeASCIICapableNumberPad cancleBlock:^{ |
| | | |
| | | } sureBlock:^(NSString * _Nonnull content) { |
| | |
| | | self.streamToken=tokenInfo.token; |
| | | |
| | | if (!_unlockButton.isEnabled) { |
| | | [_unlockButton setImage:[UIImage imageNamed:@"hdl_ez_ic_unlock"] forState:UIControlStateNormal]; |
| | | if ([self isSupportOneKeyUnlockDoor]) { // 支持一键开锁 |
| | | [_unlockButton setImage:[UIImage imageNamed:@"hdl_ez_ic_unlock"] forState:UIControlStateNormal]; |
| | | } else { |
| | | [_unlockButton setImage:[UIImage imageNamed:@"hdl_ez_ic_unlock_disable"] forState:UIControlStateNormal]; |
| | | } |
| | | _unlockButton.enabled=YES; |
| | | } |
| | | } |
| | |
| | | [self.scrollView setTranslatesAutoresizingMaskIntoConstraints:NO]; |
| | | [self.playerView setTranslatesAutoresizingMaskIntoConstraints:NO]; |
| | | [NSLayoutConstraint deactivateConstraints:@[self.scrollViewTopMargin, self.scrollViewWHRatio, self.playerViewWHRatio, self.playerViewBottomMargin]]; |
| | | self.scrollViewTopMargin = [NSLayoutConstraint constraintWithItem:self.scrollView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.topLayoutGuide attribute:NSLayoutAttributeBottom multiplier:1.0 constant:-HDLEZ_APP_STATUS_BAR_HEIGHT]; |
| | | self.scrollViewTopMargin = [NSLayoutConstraint constraintWithItem:self.scrollView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.topLayoutGuide attribute:NSLayoutAttributeBottom multiplier:1.0 constant:-[self hdlEZStatusBarHeight]]; |
| | | self.scrollViewWHRatio = [NSLayoutConstraint constraintWithItem:self.scrollView attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:self.scrollView attribute:NSLayoutAttributeHeight multiplier:HDLEZ_APP_SCREEN_WIDTH/HDLEZ_APP_SCREEN_HEIGHT constant:0]; |
| | | |
| | | self.playerViewWHRatio = [NSLayoutConstraint constraintWithItem:self.playerView attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:self.playerView attribute:NSLayoutAttributeHeight multiplier:self.doorPlayerAspectRatio constant:0]; |
| | |
| | | - (IBAction)clickCalloutHangupAction:(id)sender { |
| | | self.isShowAlert = NO; |
| | | [self closeTalkView:self.talkCloseButton]; |
| | | if (self.msgId && self.msgId.length > 0) { |
| | | [[EZHttpUtil sharedManager] updateAnswerStatusWithMsgId:self.msgId answerStatus:@"no_answer" completion:^(ResponseData * _Nonnull responseData) { |
| | | HDLEZLog(@"###########挂断####:%@", [responseData yy_modelToJSONString]); |
| | | }]; |
| | | } |
| | | [self.navigationController popViewControllerAnimated:YES]; |
| | | } |
| | | |
| | | - (IBAction)clickCalloutIgnoreAction:(id)sender { |
| | |
| | | self.isShowAlert = NO; |
| | | self.isAnswering = YES; |
| | | [self talkButtonClicked:self.talkButton]; |
| | | if (self.msgId && self.msgId.length > 0) { |
| | | [[EZHttpUtil sharedManager] updateAnswerStatusWithMsgId:self.msgId answerStatus:@"answer" completion:^(ResponseData * _Nonnull responseData) { |
| | | HDLEZLog(@"###########接听####:%@", [responseData yy_modelToJSONString]); |
| | | }]; |
| | | } |
| | | [self.navigationController popViewControllerAnimated:YES]; |
| | | } |
| | | |
| | | |
| | |
| | | #pragma Setter |
| | | - (void)setIsShowAlert:(BOOL)isShowAlert { |
| | | _isShowAlert = isShowAlert; |
| | | if (isShowAlert) { |
| | | if (_isShowAlert) { |
| | | [self showCallOutAlertView]; |
| | | } else { |
| | | [self hiddenCallOutAlertView]; |
| | |
| | | return YES; |
| | | } |
| | | |
| | | - (CGFloat)hdlEZStatusBarHeight { |
| | | if (@available(iOS 13.0, *)) { |
| | | NSSet *set = [UIApplication sharedApplication].connectedScenes; |
| | | UIWindowScene *windowScene = [set anyObject]; |
| | | UIStatusBarManager *statusBarManager = windowScene.statusBarManager; |
| | | return statusBarManager.statusBarFrame.size.height; |
| | | } else { |
| | | return [UIApplication sharedApplication].statusBarFrame.size.height; |
| | | } |
| | | } |
| | | |
| | | /// 是否支持一键开锁 |
| | | - (BOOL)isSupportOneKeyUnlockDoor { |
| | | BOOL isSupport = YES; |
| | | if (self.deviceInfo && self.deviceInfo.deviceType && ([self.deviceInfo.deviceType containsString:@"LT20VC"] || [self.deviceInfo.deviceType containsString:@"LT20VC"])) { |
| | | isSupport = NO; |
| | | } |
| | | return isSupport; |
| | | } |
| | | |
| | | @end |