From 3e4be5ed4d2c0395dd60e392baf86c59762059b1 Mon Sep 17 00:00:00 2001
From: Davin <591807572@qq.com>
Date: 星期五, 30 六月 2023 10:14:50 +0800
Subject: [PATCH] feature 猫眼全屏布局调整 && UI细节适配

---
 EZSDK/EZSDK/EZ/UIViewControllers/EZLivePlayViewController.m |  211 +++++++++++++++++++++++++++++++++++++++++-----------
 1 files changed, 167 insertions(+), 44 deletions(-)

diff --git a/EZSDK/EZSDK/EZ/UIViewControllers/EZLivePlayViewController.m b/EZSDK/EZSDK/EZ/UIViewControllers/EZLivePlayViewController.m
index 35c1a4c..9db3569 100644
--- a/EZSDK/EZSDK/EZ/UIViewControllers/EZLivePlayViewController.m
+++ b/EZSDK/EZSDK/EZ/UIViewControllers/EZLivePlayViewController.m
@@ -25,6 +25,7 @@
 #import <EZOpenSDKFramework/EZPMPlayPrivateTokenInfo.h>
 #import "HDLEZAlertInputView.h"
 #import "HDLEZOPButton.h"
+#import "HDLEZVideoDoorToolView.h"
 #define MinimumZoomScale 1.0
 #define MaximumZoomScale 4.0
 
@@ -38,6 +39,7 @@
 
 @property (nonatomic) BOOL isOpenSound;
 @property (nonatomic) BOOL isPlaying;
+@property (nonatomic) BOOL isAnswering;     // 姝e湪鎺ュ惉涓�
 @property (nonatomic, strong) NSTimer *recordTimer;
 @property (nonatomic) NSTimeInterval seconds;
 @property (nonatomic, strong) CALayer *orangeLayer;
@@ -49,6 +51,9 @@
 @property (nonatomic, strong) HIKLoadView *loadingView;
 @property (nonatomic, weak) IBOutlet UIButton *playerPlayButton;
 @property (nonatomic, weak) IBOutlet UIView *playerView;
+@property (weak, nonatomic) IBOutlet NSLayoutConstraint *playerViewWHRatio;
+@property (weak, nonatomic) IBOutlet NSLayoutConstraint *playerViewBottomMargin;
+
 @property (nonatomic, weak) IBOutlet UIView *toolBar;
 @property (nonatomic, weak) IBOutlet UIView *bottomView;
 @property (nonatomic, weak) IBOutlet UIButton *controlButton;
@@ -56,12 +61,16 @@
 @property (nonatomic, weak) IBOutlet UIButton *captureButton;
 @property (nonatomic, weak) IBOutlet UIButton *localRecordButton;
 @property (nonatomic, weak) IBOutlet UIButton *playButton;
+@property (weak, nonatomic) IBOutlet NSLayoutConstraint *playBtnLeftMargin;
 @property (weak, nonatomic) IBOutlet UIButton *streamPlayBtn;
 @property (nonatomic, weak) IBOutlet UIButton *voiceButton;
 @property (nonatomic, weak) IBOutlet UIButton *qualityButton;
 @property (nonatomic, weak) IBOutlet UIButton *emptyButton;
+@property (weak, nonatomic) IBOutlet NSLayoutConstraint *emptyBtnLeftMargin;
 @property (nonatomic, weak) IBOutlet UIButton *largeButton;
+@property (weak, nonatomic) IBOutlet NSLayoutConstraint *largeBtnRightMargin;
 @property (nonatomic, weak) IBOutlet UIButton *largeBackButton;
+@property (weak, nonatomic) IBOutlet NSLayoutConstraint *largeBackBtnLeftMargin;
 @property (nonatomic, weak) IBOutlet UIView *ptzView;
 @property (nonatomic, weak) IBOutlet UIButton *ptzCloseButton;
 @property (nonatomic, weak) IBOutlet UIButton *ptzControlButton;
@@ -98,6 +107,7 @@
 @property (nonatomic, copy) NSString *streamToken;
 
 @property (nonatomic, strong) UIView *doorPlayerView;//闂ㄩ攣鎾斁view
+@property (nonatomic, assign) CGFloat doorPlayerAspectRatio;   // 闂ㄩ攣鎾斁瑙嗗浘瀹介珮姣�
 
 // 鍛煎彨瑙嗗浘鐩稿叧鎺т欢
 @property (weak, nonatomic) IBOutlet UIView *videoCallOutView;      // 鍛煎彨寮规
@@ -105,6 +115,8 @@
 @property (weak, nonatomic) IBOutlet HDLEZOPButton *hangUpButton;        // 鎸傛柇鎸夐挳
 @property (weak, nonatomic) IBOutlet HDLEZOPButton *ignoreButton;        // 蹇界暐鎸夐挳
 @property (weak, nonatomic) IBOutlet HDLEZOPButton *answerButton;        // 鎺ュ惉鎸夐挳
+
+@property (strong, nonatomic) HDLEZVideoDoorToolView *fullSceneToolView; // 鍏ㄥ睆宸ュ叿瑙嗗浘
 
 @end
 
@@ -125,6 +137,9 @@
     self.isStartingTalk = NO;
     self.ptzView.hidden = YES;
     self.talkView.hidden = YES;
+    self.isAnswering = NO;
+    self.videoCallOutView.hidden = YES;
+    self.doorPlayerAspectRatio = HDLEZ_APP_SCREEN_WIDTH / HDLEZ_APP_SCREEN_HEIGHT;
     _landscape = NO;
     
     if (!self.deviceInfo) {//濡傛灉娌℃湁浼燿eviceInfo,闇�涓诲姩鑾峰彇
@@ -281,15 +296,16 @@
     //缁撴潫鏈湴褰曞儚
     if(self.localRecordButton.selected)
     {
+        __weak __typeof(self)weakSelf = self;
         [_player stopLocalRecordExt:^(BOOL ret) {
             
             NSLog(@"%d", ret);
             
-            [_recordTimer invalidate];
-            _recordTimer = nil;
-            self.localRecordLabel.hidden = YES;
-            [self saveRecordToPhotosAlbum:_filePath];
-            _filePath = nil;
+            [weakSelf.recordTimer invalidate];
+            weakSelf.recordTimer = nil;
+            weakSelf.localRecordLabel.hidden = YES;
+            [weakSelf saveRecordToPhotosAlbum:weakSelf.filePath];
+            weakSelf.filePath = nil;
         }];
     }
     
@@ -342,8 +358,7 @@
     self.captureButton.enabled = NO;
     self.localRecordButton.enabled = NO;
     self.streamPlayBtn.hidden = YES;
-    self.isShowAlert = YES;
-    NSLog(@"#####鍒濆鍖栨柟娉曞睍绀�");
+//    self.isShowAlert = YES; 
     
     if (_url)
     {
@@ -376,6 +391,7 @@
     }
     if (_cameraInfo.cameraNo == 0 || [self.deviceInfo.deviceType containsString:@"CAS"]) { //涓嶆敮鎸佹竻鏅板害鍒囨崲
         self.qualityButton.hidden = YES;
+        [self.fullSceneToolView supportVideoLevelChange:NO];
     }
 
     if (self.deviceInfo.cameraInfo.count > 1) {
@@ -391,8 +407,9 @@
     if (!_url)
     {
         //鎶撳浘鎺ュ彛婕旂ず浠g爜
+        __weak __typeof(self)weakSelf = self;
         [EZOPENSDK captureCamera:_cameraInfo.deviceSerial cameraNo:_cameraInfo.cameraNo completion:^(NSString *url, NSError *error) {
-            NSLog(@"[%@] capture cameraNo is [%d] url is %@, error is %@", _cameraInfo.deviceSerial, (int)_cameraInfo.cameraNo, url, error);
+            NSLog(@"[%@] capture cameraNo is [%d] url is %@, error is %@", weakSelf.cameraInfo.deviceSerial, (int)weakSelf.cameraInfo.cameraNo, url, error);
         }];
     }
 #endif
@@ -486,6 +503,14 @@
     [self.answerButton setTitle:HDLEZLocallizedString(@"device_callout_answer") forState:UIControlStateNormal];
     self.answerButton.imagePosition = HDLEZOPButtonImagePositionTop;
     self.answerButton.spacingBetweenImageAndTitle = 12.;
+    
+    // 闂ㄩ攣鍏ㄥ睆鐘舵�佷笅宸ュ叿鏍�
+    [self.view addSubview:self.fullSceneToolView];
+    __weak __typeof(self)weakSelf = self;
+    [self.fullSceneToolView ringRingRing:YES];  // 榛樿鏄剧ず鎸傛柇鎸夐挳
+    [self.fullSceneToolView configPlayStatus:YES soundOn:YES videoLevel:_cameraInfo.videoLevel toolOperation:^(HDLEZVideoFullSceneOperation operationType) {
+        [weakSelf doorLockFullSceneOperation:operationType];
+    }];
 }
 
 /*寮�閿�
@@ -583,12 +608,22 @@
     
     [self.scrollView setTranslatesAutoresizingMaskIntoConstraints:NO];
     [self.toolBar setTranslatesAutoresizingMaskIntoConstraints:NO];
-    [NSLayoutConstraint deactivateConstraints:@[self.scrollViewWHRatio]];
+    [self.playButton setTranslatesAutoresizingMaskIntoConstraints:NO];
+    [self.emptyButton setTranslatesAutoresizingMaskIntoConstraints:NO];
+    [self.largeButton setTranslatesAutoresizingMaskIntoConstraints:NO];
+//    [self.largeBackButton setTranslatesAutoresizingMaskIntoConstraints:NO];
+    [NSLayoutConstraint deactivateConstraints:@[self.scrollViewWHRatio, self.playBtnLeftMargin, self.emptyBtnLeftMargin, self.largeBtnRightMargin]];
     self.scrollViewWHRatio = [NSLayoutConstraint constraintWithItem:self.scrollView attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:self.scrollView attribute:NSLayoutAttributeHeight multiplier:16/9. constant:0];
-    [NSLayoutConstraint activateConstraints:@[self.scrollViewWHRatio]];
+    self.playBtnLeftMargin = [NSLayoutConstraint constraintWithItem:self.playButton attribute:NSLayoutAttributeLeading relatedBy:NSLayoutRelationEqual toItem:self.toolBar attribute:NSLayoutAttributeLeading multiplier:1 constant:0];
+    self.emptyBtnLeftMargin = [NSLayoutConstraint constraintWithItem:self.emptyButton attribute:NSLayoutAttributeLeading relatedBy:NSLayoutRelationEqual toItem:self.qualityButton attribute:NSLayoutAttributeTrailing multiplier:1 constant:0];
+    self.largeBtnRightMargin = [NSLayoutConstraint constraintWithItem:self.toolBar attribute:NSLayoutAttributeTrailing relatedBy:NSLayoutRelationEqual toItem:self.largeButton attribute:NSLayoutAttributeTrailing multiplier:1 constant:0];
+    [NSLayoutConstraint activateConstraints:@[self.scrollViewWHRatio, self.playBtnLeftMargin, self.emptyBtnLeftMargin, self.largeBtnRightMargin]];
     dispatch_async(dispatch_get_main_queue(), ^{
         [self.scrollView layoutIfNeeded];
         [self.toolBar layoutIfNeeded];
+        [self.playButton layoutIfNeeded];
+        [self.emptyButton layoutIfNeeded];
+        [self.largeButton layoutIfNeeded];
     });
     
     if(toInterfaceOrientation == UIInterfaceOrientationLandscapeLeft ||
@@ -603,16 +638,25 @@
         
         CGFloat tureScreenW = HDLEZ_APP_SCREEN_WIDTH > HDLEZ_APP_SCREEN_HEIGHT ? HDLEZ_APP_SCREEN_HEIGHT : HDLEZ_APP_SCREEN_WIDTH;
         CGFloat tureScreenH = HDLEZ_APP_SCREEN_WIDTH < HDLEZ_APP_SCREEN_HEIGHT ? HDLEZ_APP_SCREEN_HEIGHT : HDLEZ_APP_SCREEN_WIDTH;
-
+        CGFloat marginSpace = 64;
         
         [self.scrollView setTranslatesAutoresizingMaskIntoConstraints:NO];
         [self.toolBar setTranslatesAutoresizingMaskIntoConstraints:NO];
-        [NSLayoutConstraint deactivateConstraints:@[self.scrollViewWHRatio]];
+        [self.playButton setTranslatesAutoresizingMaskIntoConstraints:NO];
+        [self.emptyButton setTranslatesAutoresizingMaskIntoConstraints:NO];
+        [self.largeButton setTranslatesAutoresizingMaskIntoConstraints:NO];
+        [NSLayoutConstraint deactivateConstraints:@[self.scrollViewWHRatio, self.playBtnLeftMargin, self.emptyBtnLeftMargin, self.largeBtnRightMargin]];
         self.scrollViewWHRatio = [NSLayoutConstraint constraintWithItem:self.scrollView attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:self.scrollView attribute:NSLayoutAttributeHeight multiplier:tureScreenH/(tureScreenW - 37) constant:0];
-        [NSLayoutConstraint activateConstraints:@[self.scrollViewWHRatio]];
+        self.playBtnLeftMargin = [NSLayoutConstraint constraintWithItem:self.playButton attribute:NSLayoutAttributeLeading relatedBy:NSLayoutRelationEqual toItem:self.toolBar attribute:NSLayoutAttributeLeading multiplier:1 constant:marginSpace];
+        self.emptyBtnLeftMargin = [NSLayoutConstraint constraintWithItem:self.emptyButton attribute:NSLayoutAttributeLeading relatedBy:NSLayoutRelationEqual toItem:self.qualityButton attribute:NSLayoutAttributeTrailing multiplier:1 constant:(tureScreenH - tureScreenW - 2 * marginSpace)];
+        self.largeBtnRightMargin = [NSLayoutConstraint constraintWithItem:self.toolBar attribute:NSLayoutAttributeTrailing relatedBy:NSLayoutRelationEqual toItem:self.largeButton attribute:NSLayoutAttributeTrailing multiplier:1 constant:marginSpace];
+        [NSLayoutConstraint activateConstraints:@[self.scrollViewWHRatio, self.playBtnLeftMargin, self.emptyBtnLeftMargin, self.largeBtnRightMargin]];
         dispatch_async(dispatch_get_main_queue(), ^{
             [self.scrollView layoutIfNeeded];
             [self.toolBar layoutIfNeeded];
+            [self.playButton layoutIfNeeded];
+            [self.emptyButton layoutIfNeeded];
+            [self.largeButton layoutIfNeeded];
         });
     }
 }
@@ -677,12 +721,13 @@
  *  @param width  瀹藉害
  */
 - (void)player:(EZPlayer *)player didReceivedDisplayHeight:(NSInteger)height displayWidth:(NSInteger)width{
-//    HDLEZLog(@"鐢婚潰闀匡細%ld锛屽锛�%ld",(long)height,(long)width);
+    NSLog(@"鐢婚潰闀匡細%ld锛屽锛�%ld",(long)height,(long)width);
     CGFloat playerVH=self.playerView.frame.size.height;
 //    HDLEZLog(@"楂橈細%ld",(long)playerVH);
     CGFloat ratio=((CGFloat)width)/((CGFloat)height);
-//    HDLEZLog(@"姣斾緥锛�%f",ratio);
-    CGFloat playerVW=playerVH*ratio;
+    NSLog(@"姣斾緥锛�%f",ratio);
+//    CGFloat playerVW=playerVH*ratio;
+    self.doorPlayerAspectRatio = ratio;
 //    HDLEZLog(@"瀹斤細%ld",(long)playerVW);
     [self.doorPlayerView mas_updateConstraints:^(MASConstraintMaker *make) {
         make.width.mas_equalTo(_doorPlayerView.mas_height).multipliedBy(ratio);
@@ -882,6 +927,8 @@
 
 - (IBAction)large:(id)sender
 {
+    if (!self.isPlaying)return; // 鏈挱鏀剧姝㈠叏灞忥紝
+    self.videoCallOutView.hidden = YES;
     if (_landscape == YES) {
         [self largeBack:self.largeBackButton];
         return;
@@ -890,22 +937,29 @@
     if (self.isVideoDoorLock) {
         self.navigationController.navigationBarHidden = YES;
         self.localRecrodContraint.constant = 50;
-        self.toolBar.hidden = NO;
-        self.largeTitleLabel.hidden = NO;
+        self.toolBar.hidden = YES;
+        self.largeTitleLabel.hidden = YES;
         self.largeBackButton.hidden = YES;
         self.bottomView.hidden = YES;
-        self.videoCallOutView.hidden = YES;
+        self.scrollView.backgroundColor = [UIColor blackColor];
                 
         [self.scrollView setTranslatesAutoresizingMaskIntoConstraints:NO];
-        [self.toolBar setTranslatesAutoresizingMaskIntoConstraints:NO];
-        [NSLayoutConstraint deactivateConstraints:@[self.scrollViewTopMargin, self.scrollViewWHRatio]];
+        [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.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]];
+        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];
+        CGFloat playerBottomMargin = HDLEZ_APP_SCREEN_HEIGHT - (HDLEZ_APP_SCREEN_WIDTH / self.doorPlayerAspectRatio);
+        NSLog(@"########鎾斁闂撮殭锛�%lf", playerBottomMargin);
+        self.playerViewBottomMargin = [NSLayoutConstraint constraintWithItem:self.scrollView attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self.playerView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:playerBottomMargin];
+        [NSLayoutConstraint activateConstraints:@[self.scrollViewTopMargin, self.scrollViewWHRatio, self.playerViewWHRatio, self.playerViewBottomMargin]];
         dispatch_async(dispatch_get_main_queue(), ^{
             [self.scrollView layoutIfNeeded];
-            [self.toolBar layoutIfNeeded];
+            [self.playerView layoutIfNeeded];
         });
+        self.fullSceneToolView.hidden = NO;
+        [self.view bringSubviewToFront:self.fullSceneToolView];
         return;
     }
     if (@available(iOS 16.0, *)) {
@@ -942,17 +996,22 @@
         self.largeTitleLabel.hidden = YES;
         self.localRecrodContraint.constant = 10;
         self.videoCallOutView.hidden = !self.isShowAlert;
+        self.scrollView.backgroundColor = [UIColor clearColor];
         
         [self.scrollView setTranslatesAutoresizingMaskIntoConstraints:NO];
-        [self.toolBar setTranslatesAutoresizingMaskIntoConstraints:NO];
-        [NSLayoutConstraint deactivateConstraints:@[self.scrollViewTopMargin,self.scrollViewWHRatio]];
+        [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: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]];
+        
+        self.playerViewWHRatio = [NSLayoutConstraint constraintWithItem:self.playerView attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:self.playerView attribute:NSLayoutAttributeHeight multiplier:16/9. constant:0];
+        self.playerViewBottomMargin = [NSLayoutConstraint constraintWithItem:self.scrollView attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self.playerView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0];
+        [NSLayoutConstraint activateConstraints:@[self.scrollViewTopMargin,self.scrollViewWHRatio, self.playerViewWHRatio, self.playerViewBottomMargin]];
         dispatch_async(dispatch_get_main_queue(), ^{
             [self.scrollView layoutIfNeeded];
-            [self.toolBar layoutIfNeeded];
+            [self.playerView layoutIfNeeded];
         });
+        self.fullSceneToolView.hidden = YES;
         return;
     }
     if (@available(iOS 16.0, *)) {
@@ -1041,6 +1100,7 @@
         [self.voiceButton setImage:[UIImage imageNamed:@"preview_voice_btn"] forState:UIControlStateNormal];
     }
     _isOpenSound = !_isOpenSound;
+    [self.fullSceneToolView soundOn:_isOpenSound];
 }
 
 - (IBAction)playButtonClicked:(id)sender
@@ -1069,6 +1129,11 @@
         [self.loadingView startSquareClcokwiseAnimation];
     }
     _isPlaying = !_isPlaying;
+    [self.fullSceneToolView playStatus:_isPlaying];
+}
+
+- (SEL)extracted {
+    return @selector(hideQualityView);
 }
 
 - (IBAction)qualityButtonClicked:(id)sender
@@ -1081,7 +1146,7 @@
     {
         self.qualityView.hidden = NO;
         //鍋滅暀5s浠ュ悗闅愯棌瑙嗛璐ㄩ噺View.
-        [self performSelector:@selector(hideQualityView) withObject:nil afterDelay:5.0f];
+        [self performSelector:[self extracted] withObject:nil afterDelay:5.0f];
     }
     self.qualityButton.selected = !self.qualityButton.selected;
 }
@@ -1134,14 +1199,17 @@
                       if (sender == weakSelf.highButton)
                       {
                           [weakSelf.qualityButton setTitle:NSLocalizedString(@"device_quality_high", @"楂樻竻") forState:UIControlStateNormal];
+                          [self.fullSceneToolView videoLevel:2];
                       }
                       else if (sender == weakSelf.middleButton)
                       {
                           [weakSelf.qualityButton setTitle:NSLocalizedString(@"device_quality_median", @"鍧囪 ") forState:UIControlStateNormal];
+                          [self.fullSceneToolView videoLevel:1];
                       }
                       else
                       {
                           [weakSelf.qualityButton setTitle:NSLocalizedString(@"device_quality_low", @"娴佺晠") forState:UIControlStateNormal];
+                          [self.fullSceneToolView videoLevel:0];
                       }
                       if (result)
                       {
@@ -1261,6 +1329,7 @@
                          self.speakImageView.alpha = 0;
                          self.talkView.hidden = YES;
                      }];
+    self.isAnswering = NO;
 }
 
 - (IBAction)localButtonClicked:(id)sender
@@ -1268,15 +1337,16 @@
     //缁撴潫鏈湴褰曞儚
     if(self.localRecordButton.selected)
     {
+        __weak __typeof(self)weakSelf = self;
         [_player stopLocalRecordExt:^(BOOL ret) {
             
             NSLog(@"%d", ret);
             
-            [_recordTimer invalidate];
-            _recordTimer = nil;
-            self.localRecordLabel.hidden = YES;
-            [self saveRecordToPhotosAlbum:_filePath];
-            _filePath = nil;
+            [weakSelf.recordTimer invalidate];
+            weakSelf.recordTimer = nil;
+            weakSelf.localRecordLabel.hidden = YES;
+            [weakSelf saveRecordToPhotosAlbum:weakSelf.filePath];
+            weakSelf.filePath = nil;
         }];
     }
     else
@@ -1356,18 +1426,19 @@
 }
 
 - (IBAction)clickCalloutHangupAction:(id)sender {
-    [UIView dd_showMessage:@"鎸傛柇寮�鍙戜腑..."];
     self.isShowAlert = NO;
+    [self closeTalkView:self.talkCloseButton];
 }
 
 - (IBAction)clickCalloutIgnoreAction:(id)sender {
-    [UIView dd_showMessage:@"蹇界暐寮�鍙戜腑..."];
+//    [UIView dd_showMessage:@"蹇界暐寮�鍙戜腑..."];
     self.isShowAlert = NO;
+    self.isAnswering = NO;
 }
 
 - (IBAction)clickCalloutAnswerAction:(id)sender {
-    [UIView dd_showMessage:@"鎺ュ惉寮�鍙戜腑..."];
     self.isShowAlert = NO;
+    self.isAnswering = YES;
     [self talkButtonClicked:self.talkButton];
 }
 
@@ -1376,15 +1447,11 @@
 /// 灞曠ず鍛煎彨寮规
 - (void)showCallOutAlertView {
     self.videoCallOutView.hidden = NO;
-    [UIView dd_showMessage:@"灞曠ず鍛煎彨寮规"];
-    NSLog(@"灞曠ず鍛煎彨寮规");
 }
 
 /// 闅愯棌鍛煎彨寮规
 - (void)hiddenCallOutAlertView {
     self.videoCallOutView.hidden = YES;
-    [UIView dd_showMessage:@"闅愯棌鍛煎彨寮规"];
-    NSLog(@"闅愯棌鍛煎彨寮规");
 }
 
 #pragma mark - Private Methods
@@ -1505,7 +1572,7 @@
             [view removeFromSuperview];
         }
     }
-    CGFloat averageWidth = [UIScreen mainScreen].bounds.size.width/5.0;
+//    CGFloat averageWidth = [UIScreen mainScreen].bounds.size.width/5.0;
     UIImageView *lineImageView1 = [UIView dd_instanceVerticalLine:20 color:[UIColor grayColor]];
 //    lineImageView1.frame = CGRectMake(averageWidth, 7, lineImageView1.frame.size.width, lineImageView1.frame.size.height);
     [self.toolBar addSubview:lineImageView1];
@@ -1642,18 +1709,74 @@
     }
 }
 
+#pragma mark - PrivateMethod (闂ㄩ攣鍏ㄥ睆鏃剁殑涓�绯诲垪鎿嶄綔)
+- (void)doorLockFullSceneOperation:(HDLEZVideoFullSceneOperation)operation {
+    switch (operation) {
+        case HDLEZVideoFullSceneOperationOfHangUp: {    // 鎸傛柇
+            [self largeBack:self.largeButton];
+            [self closeTalkView:self.talkCloseButton];
+            [self hiddenCallOutAlertView];
+            [self.navigationController popViewControllerAnimated:YES];
+        }
+            break;
+        case HDLEZVideoFullSceneOperationOfPlay: {  // 鎾斁
+            [self playButtonClicked:self.playButton];
+        }
+            break;
+        case HDLEZVideoFullSceneOperationOfPause: { // 鏆傚仠
+            [self playButtonClicked:self.playButton];
+        }
+            break;
+        case HDLEZVideoFullSceneOperationOfSound: { // 寮�鍚煶閲�
+            [_player openSound];
+            NSLog(@"#######寮�鍚煶閲�");
+        }
+            break;
+        case HDLEZVideoFullSceneOperationOfSoundOff: {  // 闈欓煶
+            [_player closeSound];
+            NSLog(@"#######闈欓煶");
+        }
+            break;
+        case HDLEZVideoFullSceneOperationOfSmooth: {    // 娴佺晠
+            [self qualitySelectedClicked:self.lowButton];
+        }
+            break;
+        case HDLEZVideoFullSceneOperationOfBalance: {   // 鍧囪 
+            [self qualitySelectedClicked:self.middleButton];
+        }
+            break;
+        case HDLEZVideoFullSceneOperationOfHDFull: {    // 楂樻竻
+            [self qualitySelectedClicked:self.highButton];
+        }
+            break;
+        case HDLEZVideoFullSceneOperationOfExitFull: {  // 閫�鍑哄叏灞�
+            [self largeBack:self.largeButton];
+        }
+            break;
+        default:
+            break;
+    }
+}
+
 #pragma Setter
 - (void)setIsShowAlert:(BOOL)isShowAlert {
     _isShowAlert = isShowAlert;
     if (isShowAlert) {
-        NSLog(@"#####set鏂规硶灞曠ず");
         [self showCallOutAlertView];
     } else {
-        NSLog(@"#####set鏂规硶闅愯棌");
         [self hiddenCallOutAlertView];
     }
 }
 
+#pragma mark - Getter
+- (HDLEZVideoDoorToolView *)fullSceneToolView {
+    if (!_fullSceneToolView) {
+        _fullSceneToolView = [[HDLEZVideoDoorToolView alloc] initWithFrame:CGRectMake(0, HDLEZ_APP_SCREEN_HEIGHT - 280, HDLEZ_APP_SCREEN_WIDTH, 280)];
+        _fullSceneToolView.hidden = YES;
+    }
+    return _fullSceneToolView;
+}
+
 - (BOOL)prefersHomeIndicatorAutoHidden {
     return YES;
 }

--
Gitblit v1.8.0