瀏覽代碼

推流横屏底部导航开关

huangxiaodong 1 年之前
父節點
當前提交
52cb69b8e1
共有 1 個文件被更改,包括 49 次插入0 次删除
  1. 49 0
      创维盒子/双子星云手机/CloudPlayer/View/PlayerView.m

+ 49 - 0
创维盒子/双子星云手机/CloudPlayer/View/PlayerView.m

@@ -25,6 +25,8 @@ ShowImageViewDelegate>{
     UIButton *mueBtn;
     UIButton *homeBtn;
     UIButton *backBtn;
+    
+    NSTimer *hideBottomTimer;
 }
 
 @end
@@ -93,6 +95,9 @@ ShowImageViewDelegate>{
         make.top.mas_equalTo(0.f);
     }];
     
+    UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(didTapBeganFun)];
+    [touchCommondView addGestureRecognizer:tap];
+    
     /*播放视图*/
     showImageView = [[ShowImageView alloc] init];
     [showImageView setBackgroundColor:  [UIColor blackColor]];
@@ -481,6 +486,50 @@ static CGRect startFrame;
     /*设置视图方向*/
     showImageView.isLan = isLan;
     touchCommondView.isLan = isLan;
+    
+    [self setShowOrHideBottomButtonsFunBy:isLan];
+}
+
+- (void)setShowOrHideBottomButtonsFunBy:(BOOL)isHide
+{
+    mainBlock(^{
+        self->mueBtn.hidden = isHide;
+        self->homeBtn.hidden = isHide;
+        self->backBtn.hidden = isHide;
+    });
 }
 
+#pragma mark 点击屏幕出来
+- (void)didTapBeganFun
+{
+    if(!isLan){
+        return;
+    }
+    
+//    if(![commondStr containsString:@"\"count\":1"]){
+//        return;
+//    }
+    
+    if(mueBtn.hidden){
+        [self setShowOrHideBottomButtonsFunBy:NO];
+        
+        [hideBottomTimer invalidate];
+        hideBottomTimer = [NSTimer scheduledTimerWithTimeInterval:3 target:self selector:@selector(timerToHideBottomButtonFun) userInfo:nil repeats:YES];
+        [[NSRunLoop currentRunLoop] addTimer:hideBottomTimer forMode:NSRunLoopCommonModes];
+    }
+    else{
+        [self setShowOrHideBottomButtonsFunBy:YES];
+        [hideBottomTimer invalidate];
+    }
+}
+
+- (void)timerToHideBottomButtonFun
+{
+    [hideBottomTimer invalidate];
+    
+    if(!isLan){
+        return;
+    }
+    [self setShowOrHideBottomButtonsFunBy:YES];
+}
 @end