|
@@ -9,6 +9,14 @@
|
|
|
#import "SYJUISwitch.h"
|
|
|
|
|
|
@interface playerSetView ()
|
|
|
+@property(nonatomic, strong)UIView* blackBgView;
|
|
|
+
|
|
|
+@property(nonatomic, strong)UIView *bg0View;//1.4.4 新加分辨率
|
|
|
+@property(nonatomic, strong) UIButton *resolution720Button;
|
|
|
+@property(nonatomic, strong) UIButton *resolution1080Button;
|
|
|
+@property(nonatomic,strong) CAGradientLayer *glayer;
|
|
|
+
|
|
|
+@property(nonatomic, strong) UIView *bg1View;
|
|
|
@property(nonatomic, strong) SYJUISwitch * bottomNavSwitch;//底部导航栏开关
|
|
|
@property(nonatomic, strong) SYJUISwitch * fullScreenSwitch;//全面屏开关
|
|
|
@property(nonatomic, strong) UIButton *TVButton;
|
|
@@ -51,13 +59,13 @@
|
|
|
make.bottom.mas_equalTo(0);
|
|
|
}];
|
|
|
|
|
|
- UIView* blackBgView = [UIView new];
|
|
|
- blackBgView.layer.cornerRadius = 20;
|
|
|
- blackBgView.backgroundColor = [UIColor hwColor:@"#202630"];
|
|
|
- [self addSubview:blackBgView];
|
|
|
+ _blackBgView = [UIView new];
|
|
|
+ _blackBgView.layer.cornerRadius = 20;
|
|
|
+ _blackBgView.backgroundColor = [UIColor hwColor:@"#202630"];
|
|
|
+ [self addSubview:_blackBgView];
|
|
|
|
|
|
- [blackBgView mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
- make.height.mas_equalTo(260);//(256);
|
|
|
+ [_blackBgView mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+ make.height.mas_equalTo(260 + 50);//(256);
|
|
|
make.width.mas_equalTo(320);//(245);
|
|
|
make.centerX.mas_equalTo(0.f);
|
|
|
make.centerY.mas_equalTo(0.f);
|
|
@@ -75,7 +83,7 @@
|
|
|
delayedTipLabel.font = [UIFont systemFontOfSize:12.0];
|
|
|
delayedTipLabel.textColor = [UIColor whiteColor];
|
|
|
delayedTipLabel.text = NSLocalizedString(@"webrtc_msg_delayed",nil);
|
|
|
- [blackBgView addSubview:delayedTipLabel];
|
|
|
+ [_blackBgView addSubview:delayedTipLabel];
|
|
|
//delayedTipLabel.backgroundColor = [UIColor redColor];
|
|
|
|
|
|
[delayedTipLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
@@ -89,7 +97,7 @@
|
|
|
_delayedLabel.font = [UIFont systemFontOfSize:12.0];
|
|
|
//_delayedLabel.textColor = [UIColor whiteColor];
|
|
|
//_delayedLabel.text = NSLocalizedString(@"webrtc_msg_delayed",nil);
|
|
|
- [blackBgView addSubview:_delayedLabel];
|
|
|
+ [_blackBgView addSubview:_delayedLabel];
|
|
|
//_delayedLabel.backgroundColor = [UIColor redColor];
|
|
|
|
|
|
[_delayedLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
@@ -148,7 +156,7 @@
|
|
|
_speedLabel.textColor = [UIColor whiteColor];
|
|
|
_speedLabel.textAlignment = NSTextAlignmentCenter;
|
|
|
//_speedLabel.text = NSLocalizedString(@"webrtc_msg_delayed",nil);
|
|
|
- [blackBgView addSubview:_speedLabel];
|
|
|
+ [_blackBgView addSubview:_speedLabel];
|
|
|
//_speedLabel.backgroundColor = [UIColor redColor];
|
|
|
|
|
|
[_speedLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
@@ -179,7 +187,7 @@
|
|
|
_fpsLabel.font = [UIFont systemFontOfSize:12.0];
|
|
|
_fpsLabel.textColor = [UIColor whiteColor];
|
|
|
//_fpsLabel.text = NSLocalizedString(@"webrtc_msg_delayed",nil);
|
|
|
- [blackBgView addSubview:_fpsLabel];
|
|
|
+ [_blackBgView addSubview:_fpsLabel];
|
|
|
//_fpsLabel.backgroundColor = [UIColor redColor];
|
|
|
|
|
|
[_fpsLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
@@ -191,31 +199,103 @@
|
|
|
|
|
|
[self setWebRctMsgBydelayed:0 withPacketLoss:@"-" withSpeed:@"-" withFPS:@"-"];
|
|
|
|
|
|
+ /***************************分辨率*******************************************************/
|
|
|
+
|
|
|
+ _bg0View = [UIView new];
|
|
|
+ _bg0View.layer.cornerRadius = 8;
|
|
|
+ _bg0View.backgroundColor = [UIColor hwColor:@"#29313D"];
|
|
|
+ [_blackBgView addSubview:_bg0View];
|
|
|
+
|
|
|
+ [_bg0View mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+ make.height.mas_equalTo(36);
|
|
|
+ make.left.mas_equalTo(12);
|
|
|
+ make.right.mas_equalTo(-12);
|
|
|
+ //make.top.mas_equalTo(16.f);
|
|
|
+ make.top.mas_equalTo(62.f);
|
|
|
+ }];
|
|
|
+
|
|
|
+ //分辨率
|
|
|
+ UILabel *resolutionTipLabel = [[UILabel alloc] init];
|
|
|
+ resolutionTipLabel.text = NSLocalizedString(@"cloudPhone_player_set_resolution",nil);
|
|
|
+ resolutionTipLabel.textColor = [UIColor whiteColor];
|
|
|
+ resolutionTipLabel.font = [UIFont systemFontOfSize:12.0];
|
|
|
+ [_bg0View addSubview:resolutionTipLabel];
|
|
|
+
|
|
|
+ [resolutionTipLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+ make.left.mas_equalTo(15);
|
|
|
+ make.top.equalTo(_bg0View.mas_top).offset(0);
|
|
|
+ make.bottom.equalTo(_bg0View.mas_bottom).offset(0);
|
|
|
+ }];
|
|
|
+
|
|
|
+ _resolution720Button = [[UIButton alloc] init];
|
|
|
+ _resolution720Button.layer.cornerRadius = 5;
|
|
|
+ _resolution720Button.backgroundColor = [UIColor hwColor:@"#D8D8D8" alpha:0.09];
|
|
|
+ [_resolution720Button setTitle:@"720*1280" forState:UIControlStateNormal];
|
|
|
+ [_resolution720Button setTitleColor:[UIColor hwColor:@"#FFFFFF"] forState:UIControlStateNormal];
|
|
|
+ _resolution720Button.titleLabel.font = [UIFont systemFontOfSize:12.0];
|
|
|
+ _resolution720Button.layer.masksToBounds = YES;
|
|
|
+ [_resolution720Button addTarget:self action:@selector(didClickResolution720ButFun) forControlEvents:UIControlEventTouchUpInside];
|
|
|
+ [_bg0View addSubview:_resolution720Button];
|
|
|
+
|
|
|
+ [_resolution720Button mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+ make.left.mas_equalTo(80);
|
|
|
+ make.width.mas_equalTo(93);
|
|
|
+ make.height.mas_equalTo(26);
|
|
|
+ make.centerY.mas_equalTo(0);
|
|
|
+ }];
|
|
|
+
|
|
|
+ _resolution1080Button = [[UIButton alloc] init];
|
|
|
+ _resolution1080Button.layer.cornerRadius = 5;
|
|
|
+ _resolution1080Button.backgroundColor = [UIColor hwColor:@"#D8D8D8" alpha:0.09];
|
|
|
+ [_resolution1080Button setTitle:@"1080*1920" forState:UIControlStateNormal];
|
|
|
+ [_resolution1080Button setTitleColor:[UIColor hwColor:@"#FFFFFF"] forState:UIControlStateNormal];
|
|
|
+ _resolution1080Button.titleLabel.font = [UIFont systemFontOfSize:12.0];
|
|
|
+ _resolution1080Button.layer.masksToBounds = YES;
|
|
|
+ [_resolution1080Button addTarget:self action:@selector(didClickResolution1080ButFun) forControlEvents:UIControlEventTouchUpInside];
|
|
|
+ [_bg0View addSubview:_resolution1080Button];
|
|
|
+
|
|
|
+ [_resolution1080Button mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+ make.right.mas_equalTo(-12);
|
|
|
+ make.width.mas_equalTo(93);
|
|
|
+ make.height.mas_equalTo(26);
|
|
|
+ make.centerY.mas_equalTo(0);
|
|
|
+ }];
|
|
|
+
|
|
|
+ // gradient
|
|
|
+ _glayer = [CAGradientLayer layer];
|
|
|
+ _glayer.frame = CGRectMake(0, 0, 93, 26);
|
|
|
+ _glayer.startPoint = CGPointMake(0, 0.5);
|
|
|
+ _glayer.endPoint = CGPointMake(0.97, 0.5);
|
|
|
+ _glayer.colors = @[(__bridge id)[UIColor hwColor:@"#0CDEFD" alpha:1.0].CGColor, (__bridge id)[UIColor hwColor:@"#058DFB" alpha:1.0].CGColor];
|
|
|
+ _glayer.locations = @[@(0), @(1.0f)];
|
|
|
+
|
|
|
+ [self firstSetResolutionFun];
|
|
|
+
|
|
|
/***************************全面屏相关*******************************************************/
|
|
|
- UIView *bg1View = [UIView new];
|
|
|
+ _bg1View = [UIView new];
|
|
|
// bg1View.layer.cornerRadius = 12;
|
|
|
// bg1View.backgroundColor = [UIColor hwColor:@"#29313D"];
|
|
|
- [blackBgView addSubview:bg1View];
|
|
|
+ [_blackBgView addSubview:_bg1View];
|
|
|
|
|
|
- [bg1View mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+ [_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);
|
|
|
+ make.top.mas_equalTo(112.f);
|
|
|
+ //make.top.mas_equalTo(54.f);
|
|
|
}];
|
|
|
|
|
|
UIView *bgBottomNavView = [UIView new];
|
|
|
bgBottomNavView.layer.cornerRadius = 8;
|
|
|
bgBottomNavView.backgroundColor = [UIColor hwColor:@"#29313D"];
|
|
|
- [blackBgView addSubview:bgBottomNavView];
|
|
|
+ [_blackBgView addSubview:bgBottomNavView];
|
|
|
|
|
|
[bgBottomNavView mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
- make.bottom.mas_equalTo(bg1View.mas_bottom);
|
|
|
+ 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);
|
|
|
+ make.top.mas_equalTo(_bg1View.mas_top);
|
|
|
}];
|
|
|
|
|
|
UILabel *navSwitchTipLabel = [[UILabel alloc] init];
|
|
@@ -249,14 +329,14 @@
|
|
|
UIView *bgFullScreenView = [UIView new];
|
|
|
bgFullScreenView.layer.cornerRadius = 8;
|
|
|
bgFullScreenView.backgroundColor = [UIColor hwColor:@"#29313D"];
|
|
|
- [blackBgView addSubview:bgFullScreenView];
|
|
|
+ [_blackBgView addSubview:bgFullScreenView];
|
|
|
|
|
|
[bgFullScreenView mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
- make.bottom.mas_equalTo(bg1View.mas_bottom);
|
|
|
+ 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);
|
|
|
+ make.top.mas_equalTo(_bg1View.mas_top);
|
|
|
}];
|
|
|
|
|
|
UILabel *fullScreenTipLabel = [[UILabel alloc] init];
|
|
@@ -296,13 +376,13 @@
|
|
|
UIView *bg2View = [UIView new];
|
|
|
bg2View.layer.cornerRadius = 12;
|
|
|
bg2View.backgroundColor = [UIColor hwColor:@"#29313D"];
|
|
|
- [blackBgView addSubview:bg2View];
|
|
|
+ [_blackBgView addSubview:bg2View];
|
|
|
|
|
|
[bg2View mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
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.equalTo(_bg1View.mas_bottom).offset(12);
|
|
|
//make.top.mas_equalTo(52);
|
|
|
}];
|
|
|
|
|
@@ -390,7 +470,7 @@
|
|
|
_exitPhoneButton.layer.cornerRadius = 12;
|
|
|
[_exitPhoneButton.titleLabel setFont:[UIFont systemFontOfSize:12.f]];
|
|
|
_exitPhoneButton.backgroundColor = [UIColor hwColor:@"#29313D"];
|
|
|
- [blackBgView addSubview:_exitPhoneButton];
|
|
|
+ [_blackBgView addSubview:_exitPhoneButton];
|
|
|
|
|
|
// if(ksharedAppDelegate.TvStatusMod.isTVShowType){
|
|
|
// _TVButton.selected = YES;
|
|
@@ -402,6 +482,8 @@
|
|
|
make.right.mas_equalTo(-12);
|
|
|
make.top.equalTo(bg2View.mas_bottom).offset(12);
|
|
|
}];
|
|
|
+
|
|
|
+ [self handleResolutionUIFun];
|
|
|
}
|
|
|
|
|
|
- (void)setAllSwitchFun
|
|
@@ -444,10 +526,11 @@
|
|
|
[[netWorkManager shareInstance] DataEmbeddingPointBy:3 withEventValue:@"Cloud_full_screen_off"];
|
|
|
}
|
|
|
|
|
|
+ [self handleResolutionUIFun];
|
|
|
[[NSNotificationCenter defaultCenter] postNotificationName:setPlayerFullScreenNotification object:nil];
|
|
|
}
|
|
|
|
|
|
- [self removeFun];
|
|
|
+ //[self removeFun];
|
|
|
}
|
|
|
|
|
|
#pragma mark 按钮事件
|
|
@@ -512,4 +595,84 @@
|
|
|
_speedLabel.text = [[NSString alloc] initWithFormat:@"%@%@",NSLocalizedString(@"webrtc_msg_speed",nil),speedStr];
|
|
|
_fpsLabel.text = [[NSString alloc] initWithFormat:@"FPS:%@",fpsStr];
|
|
|
}
|
|
|
+
|
|
|
+#pragma mark 设置分辨率
|
|
|
+- (void)firstSetResolutionFun
|
|
|
+{
|
|
|
+ NSInteger curResolution = [HWDataManager getIntegerWithKey:Const_cloudPhone_cur_resolution];
|
|
|
+ if(curResolution == 0 || curResolution == 1){
|
|
|
+ _resolution720Button.selected = YES;
|
|
|
+ [_resolution720Button.layer insertSublayer:_glayer atIndex:0];
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ _resolution1080Button.selected = YES;
|
|
|
+ [_resolution1080Button.layer insertSublayer:_glayer atIndex:0];
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+#pragma mark 是否要显示设置分辨率(全面屏要隐藏)
|
|
|
+- (void)handleResolutionUIFun
|
|
|
+{
|
|
|
+ BOOL isHide = [HWDataManager getBoolWithKey:Consn_player_full_screen_show];
|
|
|
+ if (isHide) {
|
|
|
+ [_blackBgView mas_updateConstraints:^(MASConstraintMaker *make) {
|
|
|
+ make.height.mas_equalTo(260);//(256);
|
|
|
+ }];
|
|
|
+
|
|
|
+ _bg0View.hidden = YES;
|
|
|
+
|
|
|
+ [_bg1View mas_updateConstraints:^(MASConstraintMaker *make) {
|
|
|
+ make.top.mas_equalTo(62);
|
|
|
+ }];
|
|
|
+
|
|
|
+ }
|
|
|
+ else{
|
|
|
+
|
|
|
+ [_blackBgView mas_updateConstraints:^(MASConstraintMaker *make) {
|
|
|
+ make.height.mas_equalTo(260 + 50);//(256);
|
|
|
+ }];
|
|
|
+
|
|
|
+ _bg0View.hidden = NO;
|
|
|
+
|
|
|
+ [_bg1View mas_updateConstraints:^(MASConstraintMaker *make) {
|
|
|
+ make.top.mas_equalTo(112);
|
|
|
+ }];
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+#pragma mark 点击了分辨率720
|
|
|
+- (void)didClickResolution720ButFun
|
|
|
+{
|
|
|
+ if(_resolution720Button.selected){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ _resolution1080Button.selected = NO;
|
|
|
+ _resolution720Button.selected = YES;
|
|
|
+ [_resolution720Button.layer insertSublayer:_glayer atIndex:0];
|
|
|
+
|
|
|
+ if(_didClickButtonFun){
|
|
|
+ _didClickButtonFun(1);
|
|
|
+ }
|
|
|
+
|
|
|
+ [HWDataManager setIntegerWithKey:Const_cloudPhone_cur_resolution value:1];
|
|
|
+}
|
|
|
+
|
|
|
+#pragma mark 点击了分辨率1080
|
|
|
+- (void)didClickResolution1080ButFun
|
|
|
+{
|
|
|
+ if(_resolution1080Button.selected){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ _resolution720Button.selected = NO;
|
|
|
+ _resolution1080Button.selected = YES;
|
|
|
+ [_resolution1080Button.layer insertSublayer:_glayer atIndex:0];
|
|
|
+
|
|
|
+ if(_didClickButtonFun){
|
|
|
+ _didClickButtonFun(2);
|
|
|
+ }
|
|
|
+
|
|
|
+ [HWDataManager setIntegerWithKey:Const_cloudPhone_cur_resolution value:2];
|
|
|
+}
|
|
|
+
|
|
|
@end
|