Browse Source

1.推流页面设置页面

huangxiaodong 1 year ago
parent
commit
69cd26876f

+ 2 - 0
创维盒子/双子星云手机/CloudPlayer/View/playerSetView.h

@@ -13,6 +13,8 @@ NS_ASSUME_NONNULL_BEGIN
 @property (nonatomic,copy) void (^didClickButtonFun)(NSInteger tag);
 
 - (void)setWebRctMsgBydelayed:(NSInteger)delayedMS withPacketLoss:(NSString*)PacketLossStr withSpeed:(NSString*)speedStr withFPS:(NSString*)fpsStr;
+
+- (void)setAllSwitchFun;
 @end
 
 NS_ASSUME_NONNULL_END

+ 107 - 76
创维盒子/双子星云手机/CloudPlayer/View/playerSetView.m

@@ -57,82 +57,12 @@
     [self addSubview:blackBgView];
     
     [blackBgView mas_makeConstraints:^(MASConstraintMaker *make) {
-        make.height.mas_equalTo(202);//(256);
+        make.height.mas_equalTo(260);//(256);
         make.width.mas_equalTo(320);//(245);
         make.centerX.mas_equalTo(0.f);
         make.centerY.mas_equalTo(0.f);
     }];
     
-//    UIView *bg1View = [UIView new];
-//    bg1View.layer.cornerRadius = 12;
-//    bg1View.backgroundColor = [UIColor hwColor:@"#29313D"];
-//    [blackBgView addSubview:bg1View];
-//    
-//    [bg1View mas_makeConstraints:^(MASConstraintMaker *make) {
-//        make.height.mas_equalTo(74);
-//        make.left.mas_equalTo(12);
-//        make.right.mas_equalTo(-12);
-//        make.top.mas_equalTo(16.f);
-//    }];
-//    
-//    //底部导航栏开关
-//    _bottomNavSwitch = [[SYJUISwitch alloc] initWithFrame:CGRectMake(0, 0, 44, 22)];
-//    _bottomNavSwitch.onTintColor = HW13B2EBColor;
-//    _bottomNavSwitch.offTintColor = [UIColor hwColor:@"#E3E8F1"];
-//    [_bottomNavSwitch addTarget:self action:@selector(maskSwitchPressed:) forControlEvents:UIControlEventValueChanged];
-//    [bg1View addSubview:_bottomNavSwitch];
-//    [_bottomNavSwitch mas_makeConstraints:^(MASConstraintMaker *make) {
-//        make.left.mas_equalTo(35.f);
-//        make.top.mas_equalTo(16.f);
-//        make.width.mas_equalTo(44.f);
-//        make.height.mas_equalTo(22.f);
-//    }];
-//    
-//
-//    
-//    UILabel *navSwitchTipLabel = [[UILabel alloc] init];
-//    navSwitchTipLabel.text = NSLocalizedString(@"cloudPhone_nav_show_tip",nil);
-//    navSwitchTipLabel.textAlignment = NSTextAlignmentCenter;
-//    navSwitchTipLabel.textColor = [UIColor whiteColor];
-//    navSwitchTipLabel.font = [UIFont systemFontOfSize:10.0];
-//    [bg1View addSubview:navSwitchTipLabel];
-//    
-//    [navSwitchTipLabel mas_makeConstraints:^(MASConstraintMaker *make) {
-//        make.right.equalTo(bg1View.mas_centerX).offset(-10.f);
-//        make.left.mas_equalTo(10);
-//        make.top.equalTo(_bottomNavSwitch.mas_bottom).offset(6);
-//    }];
-//    
-//    //全面屏开关
-//    _fullScreenSwitch = [[SYJUISwitch alloc] initWithFrame:CGRectMake(0, 0, 44, 22)];
-//    _fullScreenSwitch.onTintColor = HW13B2EBColor;
-//    _fullScreenSwitch.offTintColor = [UIColor hwColor:@"#E3E8F1"];
-//    [_fullScreenSwitch addTarget:self action:@selector(maskSwitchPressed:) forControlEvents:UIControlEventValueChanged];
-//    [bg1View addSubview:_fullScreenSwitch];
-//    [_fullScreenSwitch mas_makeConstraints:^(MASConstraintMaker *make) {
-//        make.right.mas_equalTo(-35.f);
-//        make.top.mas_equalTo(16.f);
-//        make.width.mas_equalTo(44.f);
-//        make.height.mas_equalTo(22.f);
-//    }];
-//    
-//    UILabel *fullScreenTipLabel = [[UILabel alloc] init];
-//    fullScreenTipLabel.text = NSLocalizedString(@"cloudPhone_fullScreen_show_tip",nil);
-//    fullScreenTipLabel.textAlignment = NSTextAlignmentCenter;
-//    fullScreenTipLabel.textColor = [UIColor whiteColor];
-//    fullScreenTipLabel.font = [UIFont systemFontOfSize:10.0];
-//    [bg1View addSubview:fullScreenTipLabel];
-//    
-//    [fullScreenTipLabel mas_makeConstraints:^(MASConstraintMaker *make) {
-//        make.left.equalTo(bg1View.mas_centerX).offset(10.f);
-//        make.right.mas_equalTo(-10);
-//        make.top.equalTo(_bottomNavSwitch.mas_bottom).offset(6);
-//    }];
-//    
-//    KWeakSelf
-//    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.05 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
-//        [weakSelf setAllSwitchFun];
-//    });
     
     /***************************顶部按钮显示*******************************************************/
     
@@ -164,7 +94,7 @@
     
     [_delayedLabel mas_makeConstraints:^(MASConstraintMaker *make) {
         make.left.mas_equalTo(delayedTipLabel.mas_right).offset(0);
-        make.width.mas_equalTo(laberW+5);
+        //make.width.mas_equalTo(laberW+5);
         make.height.mas_equalTo(laberH);
         make.top.mas_equalTo(laberTop);
     }];
@@ -205,7 +135,7 @@
 //    speedLossTipLabel.text = NSLocalizedString(@"webrtc_msg_speed",nil);
 //    [blackBgView addSubview:speedLossTipLabel];
 //    //speedLossTipLabel.backgroundColor = [UIColor redColor];
-//    
+//
 //    [speedLossTipLabel mas_makeConstraints:^(MASConstraintMaker *make) {
 //        make.centerX.mas_equalTo(1.5*laberW -10);
 //        make.width.mas_equalTo(laberW +10 );
@@ -234,7 +164,7 @@
 //    fpsTipLabel.text = @"FPS:";
 //    [blackBgView addSubview:fpsTipLabel];
 //    //speedLossTipLabel.backgroundColor = [UIColor redColor];
-//    
+//
 //    [fpsTipLabel mas_makeConstraints:^(MASConstraintMaker *make) {
 //        make.right.mas_equalTo(- 15 - 0.5*laberW);
 //        make.width.mas_equalTo(laberW);
@@ -259,6 +189,107 @@
     
     [self setWebRctMsgBydelayed:0 withPacketLoss:@"-" withSpeed:@"-" withFPS:@"-"];
     
+    /***************************全面屏相关*******************************************************/
+    UIView *bg1View = [UIView new];
+//    bg1View.layer.cornerRadius = 12;
+//    bg1View.backgroundColor = [UIColor hwColor:@"#29313D"];
+    [blackBgView addSubview:bg1View];
+    
+    [bg1View mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.height.mas_equalTo(42);
+        make.left.mas_equalTo(12);
+        make.right.mas_equalTo(-12);
+        //make.top.mas_equalTo(16.f);
+        make.top.mas_equalTo(54.f);
+    }];
+    
+    UIView *bgBottomNavView = [UIView new];
+    bgBottomNavView.layer.cornerRadius = 8;
+    bgBottomNavView.backgroundColor = [UIColor hwColor:@"#29313D"];
+    [blackBgView addSubview:bgBottomNavView];
+    
+    [bgBottomNavView mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.bottom.mas_equalTo(bg1View.mas_bottom);
+        make.left.mas_equalTo(12);
+        make.right.equalTo(self.mas_centerX).offset(-6);
+        //make.top.mas_equalTo(16.f);
+        make.top.mas_equalTo(bg1View.mas_top);
+    }];
+    
+    UILabel *navSwitchTipLabel = [[UILabel alloc] init];
+    navSwitchTipLabel.text = NSLocalizedString(@"cloudPhone_nav_show_tip",nil);
+    //navSwitchTipLabel.textAlignment = NSTextAlignmentCenter;
+    navSwitchTipLabel.textColor = [UIColor whiteColor];
+    navSwitchTipLabel.font = [UIFont systemFontOfSize:12.0];
+    [bgBottomNavView addSubview:navSwitchTipLabel];
+    
+    [navSwitchTipLabel mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.left.mas_equalTo(15);
+        make.top.equalTo(bgBottomNavView.mas_top).offset(0);
+        make.bottom.equalTo(bgBottomNavView.mas_bottom).offset(0);
+    }];
+    
+    //底部导航栏开关
+    _bottomNavSwitch = [[SYJUISwitch alloc] initWithFrame:CGRectMake(0, 0, 44, 22)];
+    _bottomNavSwitch.onTintColor = HW13B2EBColor;
+    _bottomNavSwitch.offTintColor = [UIColor hwColor:@"#E3E8F1"];
+    [_bottomNavSwitch addTarget:self action:@selector(maskSwitchPressed:) forControlEvents:UIControlEventValueChanged];
+    [bgBottomNavView addSubview:_bottomNavSwitch];
+    [_bottomNavSwitch mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.right.mas_equalTo(-15.f);
+        make.centerY.mas_equalTo(0.f);
+        make.width.mas_equalTo(44.f);
+        make.height.mas_equalTo(22.f);
+    }];
+    
+    
+    //全面屏开关
+    UIView *bgFullScreenView = [UIView new];
+    bgFullScreenView.layer.cornerRadius = 8;
+    bgFullScreenView.backgroundColor = [UIColor hwColor:@"#29313D"];
+    [blackBgView addSubview:bgFullScreenView];
+    
+    [bgFullScreenView mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.bottom.mas_equalTo(bg1View.mas_bottom);
+        make.right.mas_equalTo(-12);
+        make.left.equalTo(self.mas_centerX).offset(6);
+        //make.top.mas_equalTo(16.f);
+        make.top.mas_equalTo(bg1View.mas_top);
+    }];
+    
+    UILabel *fullScreenTipLabel = [[UILabel alloc] init];
+    fullScreenTipLabel.text = NSLocalizedString(@"cloudPhone_fullScreen_show_tip",nil);
+    //fullScreenTipLabel.textAlignment = NSTextAlignmentCenter;
+    fullScreenTipLabel.textColor = [UIColor whiteColor];
+    fullScreenTipLabel.font = [UIFont systemFontOfSize:12.0];
+    [bgFullScreenView addSubview:fullScreenTipLabel];
+    
+    [fullScreenTipLabel mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.left.mas_equalTo(15);
+        make.top.equalTo(bgFullScreenView.mas_top).offset(0);
+        make.bottom.equalTo(bgFullScreenView.mas_bottom).offset(0);
+    }];
+    
+    _fullScreenSwitch = [[SYJUISwitch alloc] initWithFrame:CGRectMake(0, 0, 44, 22)];
+    _fullScreenSwitch.onTintColor = HW13B2EBColor;
+    _fullScreenSwitch.offTintColor = [UIColor hwColor:@"#E3E8F1"];
+    [_fullScreenSwitch addTarget:self action:@selector(maskSwitchPressed:) forControlEvents:UIControlEventValueChanged];
+    [bgFullScreenView addSubview:_fullScreenSwitch];
+    [_fullScreenSwitch mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.right.mas_equalTo(-15.f);
+        make.centerY.mas_equalTo(0.f);
+        make.width.mas_equalTo(44.f);
+        make.height.mas_equalTo(22.f);
+    }];
+    
+    
+    
+    KWeakSelf
+    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.05 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
+        [weakSelf setAllSwitchFun];
+    });
+    
+    
     /**********************************************************************************/
     UIView *bg2View = [UIView new];
     bg2View.layer.cornerRadius = 12;
@@ -269,8 +300,8 @@
         make.height.mas_equalTo(72);
         make.left.mas_equalTo(15);
         make.right.mas_equalTo(-15);
-        //make.top.equalTo(bg1View.mas_bottom).offset(12);
-        make.top.mas_equalTo(52);
+        make.top.equalTo(bg1View.mas_bottom).offset(12);
+        //make.top.mas_equalTo(52);
     }];
     
     

+ 2 - 0
创维盒子/双子星云手机/webRtc/webRtcPlayerViewController.m

@@ -340,6 +340,8 @@
             make.bottom.mas_equalTo(0.f);
         }];
         
+        [_playerSetV setAllSwitchFun];
+        
         return;
     }