Commit 71d056a97f3af2e316d8ed9ab863f802653f11ed
1 parent
c33e54a2
no message
Showing
4 changed files
with
35 additions
and
2 deletions
LiveVideoCloud/AppDelegate/AppDelegate.m
| ... | ... | @@ -52,7 +52,7 @@ |
| 52 | 52 | // 20170327 20170328 |
| 53 | 53 | |
| 54 | 54 | |
| 55 | - CNLiveChatUserInfo *userInfo = [[CNLiveChatUserInfo alloc] initWithUserId:@"20170628" name:@"20170628" portrait:@"http://b.hiphotos.baidu.com/zhidao/wh%3D450%2C600/sign=f0c5c08030d3d539c16807c70fb7c566/8ad4b31c8701a18bbef9f231982f07082838feba.jpg"]; | |
| 55 | + CNLiveChatUserInfo *userInfo = [[CNLiveChatUserInfo alloc] initWithUserId:@"2017063077" name:@"阿哈市" portrait:@"http://b.hiphotos.baidu.com/zhidao/wh%3D450%2C600/sign=f0c5c08030d3d539c16807c70fb7c566/8ad4b31c8701a18bbef9f231982f07082838feba.jpg"]; | |
| 56 | 56 | |
| 57 | 57 | |
| 58 | 58 | [[CNLiveChatManager sharedCNLiveChatManager] loginServer:userInfo success:^(NSString *userId) { | ... | ... |
LiveVideoCloud/Classes/Sections/InteractionSections/LiveBaseView.h
| ... | ... | @@ -26,7 +26,7 @@ typedef NS_ENUM(NSInteger, JumpControllerType) {//跳转控制器类型 |
| 26 | 26 | |
| 27 | 27 | @property (nonatomic ,strong ) UIButton * _Nullable closeBtn; |
| 28 | 28 | @property (nonatomic) JumpControllerType jumpType; |
| 29 | -@property (nonatomic ,strong) UIViewController * _Nullable viewController; | |
| 29 | +@property (nonatomic ,weak) UIViewController * _Nullable viewController; | |
| 30 | 30 | @property (nonatomic ,strong ,readonly) PresentView * _Nullable presentView; |
| 31 | 31 | @property (nonatomic ,strong) AnimationBaseView * _Nullable animationBaseView; |
| 32 | 32 | @property (nonatomic ,copy) NSString * _Nullable roomId; |
| ... | ... | @@ -34,4 +34,6 @@ typedef NS_ENUM(NSInteger, JumpControllerType) {//跳转控制器类型 |
| 34 | 34 | + (instancetype _Nullable)liveBaseView; |
| 35 | 35 | |
| 36 | 36 | - (void)bounceBtnType:(BounceBtnType)btnType model:(userInfoModel *_Nonnull)model; |
| 37 | + | |
| 38 | +- (void)clearChatListData; | |
| 37 | 39 | @end | ... | ... |
LiveVideoCloud/Classes/Sections/InteractionSections/LiveBaseView.m
| ... | ... | @@ -195,6 +195,17 @@ typedef NS_ENUM(NSInteger, PopType) {//弹窗类型 |
| 195 | 195 | [_commentText becomeFirstResponder];//再次让textView成为第一响应者 |
| 196 | 196 | } |
| 197 | 197 | |
| 198 | +- (void)clearChatListData | |
| 199 | +{ | |
| 200 | + [self.chatMsgArray removeAllObjects]; | |
| 201 | + [self.chatTableView reloadData]; | |
| 202 | + | |
| 203 | +// self.chatTableView = nil; | |
| 204 | +// self.presentView = nil; | |
| 205 | +//// self.giftPopView = nil; | |
| 206 | +// self.barrageView = nil; | |
| 207 | +} | |
| 208 | + | |
| 198 | 209 | #pragma mark - UITextFieldDelegate |
| 199 | 210 | - (BOOL)textFieldShouldReturn:(UITextField *)textField |
| 200 | 211 | { |
| ... | ... | @@ -667,6 +678,7 @@ typedef NS_ENUM(NSInteger, PopType) {//弹窗类型 |
| 667 | 678 | _scrollView.showsHorizontalScrollIndicator = NO; |
| 668 | 679 | _scrollView.backgroundColor = [UIColor clearColor]; |
| 669 | 680 | _scrollView.delegate = self; |
| 681 | + [self addSubview:_scrollView]; | |
| 670 | 682 | } |
| 671 | 683 | return _scrollView; |
| 672 | 684 | } |
| ... | ... | @@ -676,6 +688,7 @@ typedef NS_ENUM(NSInteger, PopType) {//弹窗类型 |
| 676 | 688 | if (!_animationBaseView) |
| 677 | 689 | { |
| 678 | 690 | _animationBaseView = [[AnimationBaseView alloc] initWithFrame:CGRectMake(self.scrollView.width, 0, self.scrollView.width, self.scrollView.height)]; |
| 691 | + [self.scrollView addSubview:_animationBaseView]; | |
| 679 | 692 | } |
| 680 | 693 | return _animationBaseView; |
| 681 | 694 | } |
| ... | ... | @@ -687,6 +700,7 @@ typedef NS_ENUM(NSInteger, PopType) {//弹窗类型 |
| 687 | 700 | _presentView = [[PresentView alloc] initWithFrame:CGRectMake(0, 200, 220, 200)]; |
| 688 | 701 | _presentView.delegate = self; |
| 689 | 702 | _presentView.backgroundColor = [UIColor clearColor]; |
| 703 | + [self.animationBaseView addSubview:_presentView]; | |
| 690 | 704 | } |
| 691 | 705 | return _presentView; |
| 692 | 706 | } |
| ... | ... | @@ -711,6 +725,7 @@ typedef NS_ENUM(NSInteger, PopType) {//弹窗类型 |
| 711 | 725 | { |
| 712 | 726 | _bottomToolView = [[BottomToolView alloc] initWithFrame:CGRectMake(0, SCREEN_HEIGHT - BottomToolHeight, SCREEN_WIDTH, BottomToolHeight)]; |
| 713 | 727 | _bottomToolView.delegate = self; |
| 728 | + [self.animationBaseView addSubview:_bottomToolView]; | |
| 714 | 729 | } |
| 715 | 730 | return _bottomToolView; |
| 716 | 731 | } |
| ... | ... | @@ -720,6 +735,7 @@ typedef NS_ENUM(NSInteger, PopType) {//弹窗类型 |
| 720 | 735 | if (!_topToolsView) |
| 721 | 736 | { |
| 722 | 737 | _topToolsView = [[TopToolView alloc] initWithFrame:CGRectMake(10, 20, 100, 30) isHost:NO]; |
| 738 | + [self.animationBaseView addSubview:_topToolsView]; | |
| 723 | 739 | } |
| 724 | 740 | return _topToolsView; |
| 725 | 741 | } |
| ... | ... | @@ -744,6 +760,7 @@ typedef NS_ENUM(NSInteger, PopType) {//弹窗类型 |
| 744 | 760 | // [view addSubview:bgView]; |
| 745 | 761 | // tableView.backgroundView = view; |
| 746 | 762 | _chatTableView = tableView; |
| 763 | + [self.animationBaseView addSubview:_chatTableView]; | |
| 747 | 764 | } |
| 748 | 765 | return _chatTableView; |
| 749 | 766 | } |
| ... | ... | @@ -766,6 +783,7 @@ typedef NS_ENUM(NSInteger, PopType) {//弹窗类型 |
| 766 | 783 | [closeBtn setBackgroundImage:[UIImage imageNamed:@"LiveCloseNormal"] forState:UIControlStateNormal]; |
| 767 | 784 | [closeBtn setBackgroundImage:[UIImage imageNamed:@"LiveCloseTouch"] forState:UIControlStateHighlighted]; |
| 768 | 785 | _closeBtn = closeBtn; |
| 786 | + [self addSubview:_closeBtn]; | |
| 769 | 787 | } |
| 770 | 788 | return _closeBtn; |
| 771 | 789 | } | ... | ... |
LiveVideoCloud/Classes/Sections/UGCSections/Controller/LVCUGCLivePlayerController.m
| ... | ... | @@ -112,6 +112,11 @@ |
| 112 | 112 | [_liveBaseView addGestureRecognizer:_pan]; |
| 113 | 113 | } |
| 114 | 114 | |
| 115 | +- (void)dealloc | |
| 116 | +{ | |
| 117 | + NSLog(@"dealloc"); | |
| 118 | +} | |
| 119 | + | |
| 115 | 120 | - (void)quitBtnClick { // 退出 |
| 116 | 121 | |
| 117 | 122 | [_player stop]; |
| ... | ... | @@ -119,6 +124,14 @@ |
| 119 | 124 | // [self.navigationController popViewControllerAnimated:YES]; |
| 120 | 125 | // } |
| 121 | 126 | |
| 127 | + [[CNLiveChatManager sharedCNLiveChatManager] quitChatRoom:_liveBaseView.roomId success:^(NSString *targetId) { | |
| 128 | + NSLog(@"quit Success"); | |
| 129 | + } error:^(CNLiveChatErrorCode errors, NSString *targetId) { | |
| 130 | + NSLog(@"quit Failure"); | |
| 131 | + }]; | |
| 132 | + | |
| 133 | + [_liveBaseView clearChatListData]; | |
| 134 | + | |
| 122 | 135 | for (UIViewController *controller in self.navigationController.viewControllers) { |
| 123 | 136 | if ([controller isKindOfClass:[MineLiveController class]]) { |
| 124 | 137 | MineLiveController *revise =(MineLiveController *)controller; | ... | ... |