Commit b9d2543e18bc7332fccb9773356df6cae42cc4e2

Authored by 张旭
1 parent 48bbd690

区分主播端和观众端

LiveVideoCloud/Classes/Sections/InteractionSections/BottomToolView/BottomToolView.h
@@ -21,6 +21,10 @@ typedef NS_ENUM(NSInteger, BtnClickType) {//底部按钮类型 @@ -21,6 +21,10 @@ typedef NS_ENUM(NSInteger, BtnClickType) {//底部按钮类型
21 @end 21 @end
22 @interface BottomToolView : BaseView 22 @interface BottomToolView : BaseView
23 23
  24 +@property (nonatomic ,strong) UIButton * _Nullable chatBtn;
  25 +@property (nonatomic ,strong) UIButton * _Nullable privateChatBtn;
  26 +@property (nonatomic ,strong) UIButton * _Nullable giftBtn;
  27 +
24 @property (nonatomic) id <bottomBtnDeledate> delegate; 28 @property (nonatomic) id <bottomBtnDeledate> delegate;
25 29
26 @end 30 @end
LiveVideoCloud/Classes/Sections/InteractionSections/BottomToolView/BottomToolView.m
@@ -10,9 +10,6 @@ @@ -10,9 +10,6 @@
10 10
11 @interface BottomToolView () 11 @interface BottomToolView ()
12 12
13 -@property (nonatomic ,strong) UIButton * _Nullable chatBtn;  
14 -@property (nonatomic ,strong) UIButton * _Nullable privateChatBtn;  
15 -@property (nonatomic ,strong) UIButton * _Nullable giftBtn;  
16 @property (nonatomic ,strong) UIImageView * _Nullable bgView; 13 @property (nonatomic ,strong) UIImageView * _Nullable bgView;
17 14
18 @end 15 @end
@@ -24,7 +21,7 @@ @@ -24,7 +21,7 @@
24 if (self = [super initWithFrame:frame]) { 21 if (self = [super initWithFrame:frame]) {
25 [self addSubview:self.bgView]; 22 [self addSubview:self.bgView];
26 [self addSubview:self.chatBtn]; 23 [self addSubview:self.chatBtn];
27 - [self addSubview:self.privateChatBtn]; 24 +// [self addSubview:self.privateChatBtn];
28 [self addSubview:self.giftBtn]; 25 [self addSubview:self.giftBtn];
29 } 26 }
30 return self; 27 return self;
@@ -68,7 +65,7 @@ @@ -68,7 +65,7 @@
68 if (!_chatBtn) 65 if (!_chatBtn)
69 { 66 {
70 UIButton *chatBtn = [UIButton buttonWithType:UIButtonTypeCustom]; 67 UIButton *chatBtn = [UIButton buttonWithType:UIButtonTypeCustom];
71 - chatBtn.frame = CGRectMake(10, (self.height - 45)*0.5, 45, 45); 68 + chatBtn.frame = CGRectMake(30, (self.height - 45)*0.5, 45, 45);
72 [chatBtn setBackgroundImage:[UIImage imageNamed:@"LiveChatNormal"] forState:UIControlStateNormal]; 69 [chatBtn setBackgroundImage:[UIImage imageNamed:@"LiveChatNormal"] forState:UIControlStateNormal];
73 [chatBtn setBackgroundImage:[UIImage imageNamed:@"LiveChatTouch"] forState:UIControlStateHighlighted]; 70 [chatBtn setBackgroundImage:[UIImage imageNamed:@"LiveChatTouch"] forState:UIControlStateHighlighted];
74 [chatBtn addTarget:self action:@selector(chatAction) forControlEvents:UIControlEventTouchUpInside]; 71 [chatBtn addTarget:self action:@selector(chatAction) forControlEvents:UIControlEventTouchUpInside];
LiveVideoCloud/Classes/Sections/InteractionSections/LiveBaseView.m
@@ -84,6 +84,7 @@ typedef NS_ENUM(NSInteger, PopType) {//弹窗类型 @@ -84,6 +84,7 @@ typedef NS_ENUM(NSInteger, PopType) {//弹窗类型
84 [self addSubview:self.scrollView]; 84 [self addSubview:self.scrollView];
85 [self.scrollView addSubview:self.animationBaseView]; 85 [self.scrollView addSubview:self.animationBaseView];
86 [self.animationBaseView addSubview:self.bottomToolView]; 86 [self.animationBaseView addSubview:self.bottomToolView];
  87 +
87 [self.animationBaseView addSubview:self.presentView]; 88 [self.animationBaseView addSubview:self.presentView];
88 [self addSubview:self.closeBtn]; 89 [self addSubview:self.closeBtn];
89 [self addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapGestureClick:)]]; 90 [self addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapGestureClick:)]];
@@ -91,12 +92,27 @@ typedef NS_ENUM(NSInteger, PopType) {//弹窗类型 @@ -91,12 +92,27 @@ typedef NS_ENUM(NSInteger, PopType) {//弹窗类型
91 92
92 [self.animationBaseView addSubview:self.chatTableView]; 93 [self.animationBaseView addSubview:self.chatTableView];
93 [self.animationBaseView addSubview:self.topToolsView]; 94 [self.animationBaseView addSubview:self.topToolsView];
  95 +
94 [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillShow:) name:UIKeyboardWillShowNotification object:nil]; 96 [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillShow:) name:UIKeyboardWillShowNotification object:nil];
95 [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillHidden:) name:UIKeyboardWillHideNotification object:nil]; 97 [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillHidden:) name:UIKeyboardWillHideNotification object:nil];
96 } 98 }
97 return self; 99 return self;
98 } 100 }
99 101
  102 +#pragma mark - setter
  103 +- (void)setJumpType:(JumpControllerType)jumpType
  104 +{
  105 + _jumpType = jumpType;
  106 + if (self.jumpType == JumpControllerTypePush) {//观众端
  107 + self.bottomToolView.giftBtn.hidden = NO;
  108 + self.topToolsView.hidden = NO;
  109 + }else if(self.jumpType == JumpControllerTypePresent)
  110 + {//主播端
  111 + self.bottomToolView.giftBtn.hidden = YES;
  112 + self.topToolsView.hidden = YES;
  113 + }
  114 +}
  115 +
100 #pragma mark - 加入房间 116 #pragma mark - 加入房间
101 - (void)setRoomId:(NSString *)roomId 117 - (void)setRoomId:(NSString *)roomId
102 { 118 {
@@ -788,7 +804,7 @@ typedef NS_ENUM(NSInteger, PopType) {//弹窗类型 @@ -788,7 +804,7 @@ typedef NS_ENUM(NSInteger, PopType) {//弹窗类型
788 if (!_closeBtn) 804 if (!_closeBtn)
789 { 805 {
790 UIButton *closeBtn = [UIButton buttonWithType:UIButtonTypeCustom]; 806 UIButton *closeBtn = [UIButton buttonWithType:UIButtonTypeCustom];
791 - closeBtn.frame = CGRectMake(SCREEN_WIDTH - 43,SCREEN_HEIGHT - self.bottomToolView.height + (self.bottomToolView.height - 45)*0.5, 45, 45); 807 + closeBtn.frame = CGRectMake(SCREEN_WIDTH - 45,SCREEN_HEIGHT - self.bottomToolView.height + (self.bottomToolView.height - 35)*0.5, 35, 35);
792 [closeBtn setBackgroundImage:[UIImage imageNamed:@"LiveCloseNormal"] forState:UIControlStateNormal]; 808 [closeBtn setBackgroundImage:[UIImage imageNamed:@"LiveCloseNormal"] forState:UIControlStateNormal];
793 [closeBtn setBackgroundImage:[UIImage imageNamed:@"LiveCloseTouch"] forState:UIControlStateHighlighted]; 809 [closeBtn setBackgroundImage:[UIImage imageNamed:@"LiveCloseTouch"] forState:UIControlStateHighlighted];
794 _closeBtn = closeBtn; 810 _closeBtn = closeBtn;
LiveVideoCloud/UtilKits/UserTools/UserTools.m
@@ -210,7 +210,6 @@ @@ -210,7 +210,6 @@
210 NSString *host = [@"http://api.cnlive.com/open/api2/live_epg/channel/activityList4App" stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]]; 210 NSString *host = [@"http://api.cnlive.com/open/api2/live_epg/channel/activityList4App" stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
211 [[AFHTTPRequestOperationManager manager] GET:host parameters:parms success:^(AFHTTPRequestOperation *operation, id responseObject) { 211 [[AFHTTPRequestOperationManager manager] GET:host parameters:parms success:^(AFHTTPRequestOperation *operation, id responseObject) {
212 212
213 -  
214 success(operation,responseObject); 213 success(operation,responseObject);
215 214
216 } failure:^(AFHTTPRequestOperation *operation, NSError *error) { 215 } failure:^(AFHTTPRequestOperation *operation, NSError *error) {