From 413b74eb37fa6b9e7ae38b22e8d777a74bd7a972 Mon Sep 17 00:00:00 2001 From: Davin <591807572@qq.com> Date: 星期三, 21 六月 2023 15:09:03 +0800 Subject: [PATCH] feature 门锁历史记录UI调整 --- EZSDK/EZSDK/EZ/UIViewControllers/EZLivePlayViewController.m | 113 +++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 110 insertions(+), 3 deletions(-) diff --git a/EZSDK/EZSDK/EZ/UIViewControllers/EZLivePlayViewController.m b/EZSDK/EZSDK/EZ/UIViewControllers/EZLivePlayViewController.m index c77fe02..35c1a4c 100644 --- a/EZSDK/EZSDK/EZ/UIViewControllers/EZLivePlayViewController.m +++ b/EZSDK/EZSDK/EZ/UIViewControllers/EZLivePlayViewController.m @@ -24,6 +24,7 @@ #import "MBProgressHUD.h" #import <EZOpenSDKFramework/EZPMPlayPrivateTokenInfo.h> #import "HDLEZAlertInputView.h" +#import "HDLEZOPButton.h" #define MinimumZoomScale 1.0 #define MaximumZoomScale 4.0 @@ -89,6 +90,7 @@ @property (nonatomic, strong) EZCameraInfo *cameraInfo; @property (weak, nonatomic) IBOutlet UILabel *streamTypeLabel; @property (weak, nonatomic) IBOutlet UIScrollView *scrollView; +@property (weak, nonatomic) IBOutlet NSLayoutConstraint *scrollViewTopMargin; @property (weak, nonatomic) IBOutlet UILabel *zoomSizeLabel; @property (weak, nonatomic) IBOutlet NSLayoutConstraint *scrollViewWHRatio; // 婊氬姩瑙嗗浘瀹介珮姣� @property (nonatomic, strong) HDLEZButton *unlockButton;//寮�閿佹寜閽� @@ -96,6 +98,13 @@ @property (nonatomic, copy) NSString *streamToken; @property (nonatomic, strong) UIView *doorPlayerView;//闂ㄩ攣鎾斁view + +// 鍛煎彨瑙嗗浘鐩稿叧鎺т欢 +@property (weak, nonatomic) IBOutlet UIView *videoCallOutView; // 鍛煎彨寮规 +@property (weak, nonatomic) IBOutlet UILabel *callOutAlertLabel; // 鎻愮ず璇█ +@property (weak, nonatomic) IBOutlet HDLEZOPButton *hangUpButton; // 鎸傛柇鎸夐挳 +@property (weak, nonatomic) IBOutlet HDLEZOPButton *ignoreButton; // 蹇界暐鎸夐挳 +@property (weak, nonatomic) IBOutlet HDLEZOPButton *answerButton; // 鎺ュ惉鎸夐挳 @end @@ -333,6 +342,8 @@ self.captureButton.enabled = NO; self.localRecordButton.enabled = NO; self.streamPlayBtn.hidden = YES; + self.isShowAlert = YES; + NSLog(@"#####鍒濆鍖栨柟娉曞睍绀�"); if (_url) { @@ -464,6 +475,17 @@ // [self.controlButton setImage:[UIImage imageNamed:@"hdl_ez_ic_unlock"] forState:UIControlStateNormal]; // [self.controlButton setTitle:NSLocalizedString(@"device_open", @"寮�闂�") forState:UIControlStateNormal]; } + + self.callOutAlertLabel.text = HDLEZLocallizedString(@"device_callout_alert_message"); + [self.hangUpButton setTitle:HDLEZLocallizedString(@"device_callout_hang_up") forState:UIControlStateNormal]; + self.hangUpButton.imagePosition = HDLEZOPButtonImagePositionTop; + self.hangUpButton.spacingBetweenImageAndTitle = 12.; + [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.imagePosition = HDLEZOPButtonImagePositionTop; + self.answerButton.spacingBetweenImageAndTitle = 12.; } /*寮�閿� @@ -536,7 +558,7 @@ //} - (UIInterfaceOrientationMask)supportedInterfaceOrientations { if (@available(iOS 16.0, *)) { - if (_landscape) { + if (_landscape && !self.isVideoDoorLock) { //妯睆 return UIInterfaceOrientationMaskLandscape; } else { @@ -551,6 +573,7 @@ - (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration { + if (self.isVideoDoorLock) return; self.navigationController.navigationBarHidden = NO; self.toolBar.hidden = NO; self.largeBackButton.hidden = YES; @@ -863,8 +886,28 @@ [self largeBack:self.largeBackButton]; return; } - NSLog(@"######杩涘叆妯睆锛�"); _landscape = YES; + if (self.isVideoDoorLock) { + self.navigationController.navigationBarHidden = YES; + self.localRecrodContraint.constant = 50; + self.toolBar.hidden = NO; + self.largeTitleLabel.hidden = NO; + self.largeBackButton.hidden = YES; + self.bottomView.hidden = YES; + self.videoCallOutView.hidden = YES; + + [self.scrollView setTranslatesAutoresizingMaskIntoConstraints:NO]; + [self.toolBar setTranslatesAutoresizingMaskIntoConstraints:NO]; + [NSLayoutConstraint deactivateConstraints:@[self.scrollViewTopMargin, self.scrollViewWHRatio]]; + 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.scrollViewWHRatio = [NSLayoutConstraint constraintWithItem:self.scrollView attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:self.scrollView attribute:NSLayoutAttributeHeight multiplier:HDLEZ_APP_SCREEN_WIDTH/(HDLEZ_APP_SCREEN_HEIGHT - 37.) constant:0]; + [NSLayoutConstraint activateConstraints:@[self.scrollViewTopMargin, self.scrollViewWHRatio]]; + dispatch_async(dispatch_get_main_queue(), ^{ + [self.scrollView layoutIfNeeded]; + [self.toolBar layoutIfNeeded]; + }); + return; + } if (@available(iOS 16.0, *)) { if (self.navigationController) { dispatch_async(dispatch_get_main_queue(), ^{ @@ -890,8 +933,28 @@ - (IBAction)largeBack:(id)sender { - NSLog(@"######鏀跺洖妯睆锛�"); _landscape = NO; + if (self.isVideoDoorLock) { + self.navigationController.navigationBarHidden = NO; + self.toolBar.hidden = NO; + self.largeBackButton.hidden = YES; + self.bottomView.hidden = NO; + self.largeTitleLabel.hidden = YES; + self.localRecrodContraint.constant = 10; + self.videoCallOutView.hidden = !self.isShowAlert; + + [self.scrollView setTranslatesAutoresizingMaskIntoConstraints:NO]; + [self.toolBar setTranslatesAutoresizingMaskIntoConstraints:NO]; + [NSLayoutConstraint deactivateConstraints:@[self.scrollViewTopMargin,self.scrollViewWHRatio]]; + self.scrollViewTopMargin = [NSLayoutConstraint constraintWithItem:self.scrollView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.topLayoutGuide attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0]; + self.scrollViewWHRatio = [NSLayoutConstraint constraintWithItem:self.scrollView attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:self.scrollView attribute:NSLayoutAttributeHeight multiplier:16/9. constant:0]; + [NSLayoutConstraint activateConstraints:@[self.scrollViewTopMargin,self.scrollViewWHRatio]]; + dispatch_async(dispatch_get_main_queue(), ^{ + [self.scrollView layoutIfNeeded]; + [self.toolBar layoutIfNeeded]; + }); + return; + } if (@available(iOS 16.0, *)) { if (self.navigationController) { dispatch_async(dispatch_get_main_queue(), ^{ @@ -1292,6 +1355,38 @@ _isPressed = !_isPressed; } +- (IBAction)clickCalloutHangupAction:(id)sender { + [UIView dd_showMessage:@"鎸傛柇寮�鍙戜腑..."]; + self.isShowAlert = NO; +} + +- (IBAction)clickCalloutIgnoreAction:(id)sender { + [UIView dd_showMessage:@"蹇界暐寮�鍙戜腑..."]; + self.isShowAlert = NO; +} + +- (IBAction)clickCalloutAnswerAction:(id)sender { + [UIView dd_showMessage:@"鎺ュ惉寮�鍙戜腑..."]; + self.isShowAlert = NO; + [self talkButtonClicked:self.talkButton]; +} + + +#pragma mark - Publish Methods +/// 灞曠ず鍛煎彨寮规 +- (void)showCallOutAlertView { + self.videoCallOutView.hidden = NO; + [UIView dd_showMessage:@"灞曠ず鍛煎彨寮规"]; + NSLog(@"灞曠ず鍛煎彨寮规"); +} + +/// 闅愯棌鍛煎彨寮规 +- (void)hiddenCallOutAlertView { + self.videoCallOutView.hidden = YES; + [UIView dd_showMessage:@"闅愯棌鍛煎彨寮规"]; + NSLog(@"闅愯棌鍛煎彨寮规"); +} + #pragma mark - Private Methods - (void) checkMicPermissionResult:(void(^)(BOOL enable)) retCb @@ -1547,6 +1642,18 @@ } } +#pragma Setter +- (void)setIsShowAlert:(BOOL)isShowAlert { + _isShowAlert = isShowAlert; + if (isShowAlert) { + NSLog(@"#####set鏂规硶灞曠ず"); + [self showCallOutAlertView]; + } else { + NSLog(@"#####set鏂规硶闅愯棌"); + [self hiddenCallOutAlertView]; + } +} + - (BOOL)prefersHomeIndicatorAutoHidden { return YES; } -- Gitblit v1.8.0