Commit b9d2543e18bc7332fccb9773356df6cae42cc4e2
1 parent
48bbd690
区分主播端和观众端
Showing
4 changed files
with
23 additions
and
7 deletions
LiveVideoCloud/Classes/Sections/InteractionSections/BottomToolView/BottomToolView.h
| ... | ... | @@ -21,6 +21,10 @@ typedef NS_ENUM(NSInteger, BtnClickType) {//底部按钮类型 |
| 21 | 21 | @end |
| 22 | 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 | 28 | @property (nonatomic) id <bottomBtnDeledate> delegate; |
| 25 | 29 | |
| 26 | 30 | @end | ... | ... |
LiveVideoCloud/Classes/Sections/InteractionSections/BottomToolView/BottomToolView.m
| ... | ... | @@ -10,9 +10,6 @@ |
| 10 | 10 | |
| 11 | 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 | 13 | @property (nonatomic ,strong) UIImageView * _Nullable bgView; |
| 17 | 14 | |
| 18 | 15 | @end |
| ... | ... | @@ -24,7 +21,7 @@ |
| 24 | 21 | if (self = [super initWithFrame:frame]) { |
| 25 | 22 | [self addSubview:self.bgView]; |
| 26 | 23 | [self addSubview:self.chatBtn]; |
| 27 | - [self addSubview:self.privateChatBtn]; | |
| 24 | +// [self addSubview:self.privateChatBtn]; | |
| 28 | 25 | [self addSubview:self.giftBtn]; |
| 29 | 26 | } |
| 30 | 27 | return self; |
| ... | ... | @@ -68,7 +65,7 @@ |
| 68 | 65 | if (!_chatBtn) |
| 69 | 66 | { |
| 70 | 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 | 69 | [chatBtn setBackgroundImage:[UIImage imageNamed:@"LiveChatNormal"] forState:UIControlStateNormal]; |
| 73 | 70 | [chatBtn setBackgroundImage:[UIImage imageNamed:@"LiveChatTouch"] forState:UIControlStateHighlighted]; |
| 74 | 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 | 84 | [self addSubview:self.scrollView]; |
| 85 | 85 | [self.scrollView addSubview:self.animationBaseView]; |
| 86 | 86 | [self.animationBaseView addSubview:self.bottomToolView]; |
| 87 | + | |
| 87 | 88 | [self.animationBaseView addSubview:self.presentView]; |
| 88 | 89 | [self addSubview:self.closeBtn]; |
| 89 | 90 | [self addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapGestureClick:)]]; |
| ... | ... | @@ -91,12 +92,27 @@ typedef NS_ENUM(NSInteger, PopType) {//弹窗类型 |
| 91 | 92 | |
| 92 | 93 | [self.animationBaseView addSubview:self.chatTableView]; |
| 93 | 94 | [self.animationBaseView addSubview:self.topToolsView]; |
| 95 | + | |
| 94 | 96 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillShow:) name:UIKeyboardWillShowNotification object:nil]; |
| 95 | 97 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillHidden:) name:UIKeyboardWillHideNotification object:nil]; |
| 96 | 98 | } |
| 97 | 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 | 116 | #pragma mark - 加入房间 |
| 101 | 117 | - (void)setRoomId:(NSString *)roomId |
| 102 | 118 | { |
| ... | ... | @@ -788,7 +804,7 @@ typedef NS_ENUM(NSInteger, PopType) {//弹窗类型 |
| 788 | 804 | if (!_closeBtn) |
| 789 | 805 | { |
| 790 | 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 | 808 | [closeBtn setBackgroundImage:[UIImage imageNamed:@"LiveCloseNormal"] forState:UIControlStateNormal]; |
| 793 | 809 | [closeBtn setBackgroundImage:[UIImage imageNamed:@"LiveCloseTouch"] forState:UIControlStateHighlighted]; |
| 794 | 810 | _closeBtn = closeBtn; | ... | ... |
LiveVideoCloud/UtilKits/UserTools/UserTools.m
| ... | ... | @@ -210,7 +210,6 @@ |
| 210 | 210 | NSString *host = [@"http://api.cnlive.com/open/api2/live_epg/channel/activityList4App" stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]]; |
| 211 | 211 | [[AFHTTPRequestOperationManager manager] GET:host parameters:parms success:^(AFHTTPRequestOperation *operation, id responseObject) { |
| 212 | 212 | |
| 213 | - | |
| 214 | 213 | success(operation,responseObject); |
| 215 | 214 | |
| 216 | 215 | } failure:^(AFHTTPRequestOperation *operation, NSError *error) { | ... | ... |