Commit a806b9703e60720b2aaedc4d0b3fe17996d3214c

Authored by 王军波
2 parents 95e8023c 7d4c4b5f

Merge branch 'master' of bj.gitlab.cnlive.com:ios-team/LiveVideoCloud

# Conflicts:
#	LiveVideoCloud/AppDelegate/AppDelegate.m
Showing 28 changed files with 279 additions and 147 deletions
LiveVideoCloud.xcodeproj/project.pbxproj
@@ -28,7 +28,6 @@ @@ -28,7 +28,6 @@
28 4B45CE861EB86A590079AFB7 /* LVCLoginShowView.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B45CE6B1EB86A590079AFB7 /* LVCLoginShowView.m */; }; 28 4B45CE861EB86A590079AFB7 /* LVCLoginShowView.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B45CE6B1EB86A590079AFB7 /* LVCLoginShowView.m */; };
29 4B45CE871EB86A590079AFB7 /* LVCMineCommonCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B45CE6D1EB86A590079AFB7 /* LVCMineCommonCell.m */; }; 29 4B45CE871EB86A590079AFB7 /* LVCMineCommonCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B45CE6D1EB86A590079AFB7 /* LVCMineCommonCell.m */; };
30 4B45CE881EB86A590079AFB7 /* LVCMineShowCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B45CE6F1EB86A590079AFB7 /* LVCMineShowCell.m */; }; 30 4B45CE881EB86A590079AFB7 /* LVCMineShowCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B45CE6F1EB86A590079AFB7 /* LVCMineShowCell.m */; };
31 - 4B45CE891EB86A590079AFB7 /* LVCPersonalImageCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B45CE711EB86A590079AFB7 /* LVCPersonalImageCell.m */; };  
32 4B45CE8A1EB86A590079AFB7 /* LVCPersonCommonCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B45CE731EB86A590079AFB7 /* LVCPersonCommonCell.m */; }; 31 4B45CE8A1EB86A590079AFB7 /* LVCPersonCommonCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B45CE731EB86A590079AFB7 /* LVCPersonCommonCell.m */; };
33 4B45CE8B1EB86A590079AFB7 /* LVCTextField.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B45CE751EB86A590079AFB7 /* LVCTextField.m */; }; 32 4B45CE8B1EB86A590079AFB7 /* LVCTextField.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B45CE751EB86A590079AFB7 /* LVCTextField.m */; };
34 4B45CE971EB86A760079AFB7 /* UIButton+createButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B45CE8E1EB86A760079AFB7 /* UIButton+createButton.m */; }; 33 4B45CE971EB86A760079AFB7 /* UIButton+createButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B45CE8E1EB86A760079AFB7 /* UIButton+createButton.m */; };
@@ -344,8 +343,6 @@ @@ -344,8 +343,6 @@
344 4B45CE6D1EB86A590079AFB7 /* LVCMineCommonCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LVCMineCommonCell.m; sourceTree = "<group>"; }; 343 4B45CE6D1EB86A590079AFB7 /* LVCMineCommonCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LVCMineCommonCell.m; sourceTree = "<group>"; };
345 4B45CE6E1EB86A590079AFB7 /* LVCMineShowCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LVCMineShowCell.h; sourceTree = "<group>"; }; 344 4B45CE6E1EB86A590079AFB7 /* LVCMineShowCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LVCMineShowCell.h; sourceTree = "<group>"; };
346 4B45CE6F1EB86A590079AFB7 /* LVCMineShowCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LVCMineShowCell.m; sourceTree = "<group>"; }; 345 4B45CE6F1EB86A590079AFB7 /* LVCMineShowCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LVCMineShowCell.m; sourceTree = "<group>"; };
347 - 4B45CE701EB86A590079AFB7 /* LVCPersonalImageCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LVCPersonalImageCell.h; sourceTree = "<group>"; };  
348 - 4B45CE711EB86A590079AFB7 /* LVCPersonalImageCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LVCPersonalImageCell.m; sourceTree = "<group>"; };  
349 4B45CE721EB86A590079AFB7 /* LVCPersonCommonCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LVCPersonCommonCell.h; sourceTree = "<group>"; }; 346 4B45CE721EB86A590079AFB7 /* LVCPersonCommonCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LVCPersonCommonCell.h; sourceTree = "<group>"; };
350 4B45CE731EB86A590079AFB7 /* LVCPersonCommonCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LVCPersonCommonCell.m; sourceTree = "<group>"; }; 347 4B45CE731EB86A590079AFB7 /* LVCPersonCommonCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LVCPersonCommonCell.m; sourceTree = "<group>"; };
351 4B45CE741EB86A590079AFB7 /* LVCTextField.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LVCTextField.h; sourceTree = "<group>"; }; 348 4B45CE741EB86A590079AFB7 /* LVCTextField.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LVCTextField.h; sourceTree = "<group>"; };
@@ -967,8 +964,6 @@ @@ -967,8 +964,6 @@
967 4B45CE6D1EB86A590079AFB7 /* LVCMineCommonCell.m */, 964 4B45CE6D1EB86A590079AFB7 /* LVCMineCommonCell.m */,
968 4B45CE6E1EB86A590079AFB7 /* LVCMineShowCell.h */, 965 4B45CE6E1EB86A590079AFB7 /* LVCMineShowCell.h */,
969 4B45CE6F1EB86A590079AFB7 /* LVCMineShowCell.m */, 966 4B45CE6F1EB86A590079AFB7 /* LVCMineShowCell.m */,
970 - 4B45CE701EB86A590079AFB7 /* LVCPersonalImageCell.h */,  
971 - 4B45CE711EB86A590079AFB7 /* LVCPersonalImageCell.m */,  
972 4B45CE721EB86A590079AFB7 /* LVCPersonCommonCell.h */, 967 4B45CE721EB86A590079AFB7 /* LVCPersonCommonCell.h */,
973 4B45CE731EB86A590079AFB7 /* LVCPersonCommonCell.m */, 968 4B45CE731EB86A590079AFB7 /* LVCPersonCommonCell.m */,
974 4B45CE741EB86A590079AFB7 /* LVCTextField.h */, 969 4B45CE741EB86A590079AFB7 /* LVCTextField.h */,
@@ -2436,7 +2431,6 @@ @@ -2436,7 +2431,6 @@
2436 81A483081E88B6140097A80A /* UIView+ViewController.m in Sources */, 2431 81A483081E88B6140097A80A /* UIView+ViewController.m in Sources */,
2437 D2EBC8721F02108000F198FB /* LVCLiveActivityInfoService.m in Sources */, 2432 D2EBC8721F02108000F198FB /* LVCLiveActivityInfoService.m in Sources */,
2438 D2029CC81E6EADE10027CD92 /* SVProgressAnimatedView.m in Sources */, 2433 D2029CC81E6EADE10027CD92 /* SVProgressAnimatedView.m in Sources */,
2439 - 4B45CE891EB86A590079AFB7 /* LVCPersonalImageCell.m in Sources */,  
2440 D2029C961E6EADE10027CD92 /* MBProgressHUD.m in Sources */, 2434 D2029C961E6EADE10027CD92 /* MBProgressHUD.m in Sources */,
2441 810B65071E779B1F00133E15 /* ViewController+MASAdditions.m in Sources */, 2435 810B65071E779B1F00133E15 /* ViewController+MASAdditions.m in Sources */,
2442 D2EBC88E1F023AA400F198FB /* LVCVodPlayerController.m in Sources */, 2436 D2EBC88E1F023AA400F198FB /* LVCVodPlayerController.m in Sources */,
@@ -2721,7 +2715,6 @@ @@ -2721,7 +2715,6 @@
2721 "$(PROJECT_DIR)/LiveVideoCloud/Classes/SDK/WeChatSDK", 2715 "$(PROJECT_DIR)/LiveVideoCloud/Classes/SDK/WeChatSDK",
2722 "$(PROJECT_DIR)/LiveVideoCloud/Classes/SDK/SinaSDK", 2716 "$(PROJECT_DIR)/LiveVideoCloud/Classes/SDK/SinaSDK",
2723 ); 2717 );
2724 - OTHER_LDFLAGS = "";  
2725 PRODUCT_BUNDLE_IDENTIFIER = com.cnlive.shipinzhongguo; 2718 PRODUCT_BUNDLE_IDENTIFIER = com.cnlive.shipinzhongguo;
2726 PRODUCT_NAME = "$(TARGET_NAME)"; 2719 PRODUCT_NAME = "$(TARGET_NAME)";
2727 }; 2720 };
@@ -2751,7 +2744,6 @@ @@ -2751,7 +2744,6 @@
2751 "$(PROJECT_DIR)/LiveVideoCloud/Classes/SDK/WeChatSDK", 2744 "$(PROJECT_DIR)/LiveVideoCloud/Classes/SDK/WeChatSDK",
2752 "$(PROJECT_DIR)/LiveVideoCloud/Classes/SDK/SinaSDK", 2745 "$(PROJECT_DIR)/LiveVideoCloud/Classes/SDK/SinaSDK",
2753 ); 2746 );
2754 - OTHER_LDFLAGS = "";  
2755 PRODUCT_BUNDLE_IDENTIFIER = com.cnlive.shipinzhongguo; 2747 PRODUCT_BUNDLE_IDENTIFIER = com.cnlive.shipinzhongguo;
2756 PRODUCT_NAME = "$(TARGET_NAME)"; 2748 PRODUCT_NAME = "$(TARGET_NAME)";
2757 }; 2749 };
LiveVideoCloud.xcodeproj/xcuserdata/cnlive.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
@@ -10,11 +10,11 @@ @@ -10,11 +10,11 @@
10 ignoreCount = "0" 10 ignoreCount = "0"
11 continueAfterRunningActions = "No" 11 continueAfterRunningActions = "No"
12 filePath = "LiveVideoCloud/Classes/Sections/homeSections/Controller/LVCVodPlayerController.m" 12 filePath = "LiveVideoCloud/Classes/Sections/homeSections/Controller/LVCVodPlayerController.m"
13 - timestampString = "520277942.714492" 13 + timestampString = "520320963.334972"
14 startingColumnNumber = "9223372036854775807" 14 startingColumnNumber = "9223372036854775807"
15 endingColumnNumber = "9223372036854775807" 15 endingColumnNumber = "9223372036854775807"
16 - startingLineNumber = "287"  
17 - endingLineNumber = "287" 16 + startingLineNumber = "298"
  17 + endingLineNumber = "298"
18 landmarkName = "-deviceOrientationChanged:" 18 landmarkName = "-deviceOrientationChanged:"
19 landmarkType = "7"> 19 landmarkType = "7">
20 </BreakpointContent> 20 </BreakpointContent>
LiveVideoCloud/AppCustoms/Main/ZXTabBarController.m
@@ -26,7 +26,7 @@ @@ -26,7 +26,7 @@
26 [super viewDidLoad]; 26 [super viewDidLoad];
27 // Do any additional setup after loading the view. 27 // Do any additional setup after loading the view.
28 28
29 - [[UITabBar appearance] setBarTintColor:[UIColor blackColorZX]]; 29 + [[UITabBar appearance] setBarTintColor:[UIColor backgroundColor]];
30 //取消tabBar的透明效果 30 //取消tabBar的透明效果
31 [UITabBar appearance].translucent = NO; 31 [UITabBar appearance].translucent = NO;
32 32
LiveVideoCloud/AppDelegate/AppDelegate.m
@@ -22,7 +22,7 @@ @@ -22,7 +22,7 @@
22 self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; 22 self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
23 self.window.rootViewController = [[ZXTabBarController alloc] init]; 23 self.window.rootViewController = [[ZXTabBarController alloc] init];
24 24
25 - //初始化直播SDK 25 + //APP 启动是初始化直播SDK
26 [[CNLiveWebcastManager manager] initWithAppId:UserAppId appKey:UserAppKey isTestEnvironment:YES]; 26 [[CNLiveWebcastManager manager] initWithAppId:UserAppId appKey:UserAppKey isTestEnvironment:YES];
27 27
28 //初始化聊天SDK并连接服务器 28 //初始化聊天SDK并连接服务器
@@ -45,7 +45,9 @@ @@ -45,7 +45,9 @@
45 45
46 // 20170327 20170328 46 // 20170327 20170328
47 47
48 - CNLiveChatUserInfo *userInfo = [[CNLiveChatUserInfo alloc] initWithUserId:@"20170328" name:@"20170627" portrait:@""]; 48 +
  49 + CNLiveChatUserInfo *userInfo = [[CNLiveChatUserInfo alloc] initWithUserId:@"20170328ll" name:@"20170328" portrait:@""];
  50 +
49 [[CNLiveChatManager sharedCNLiveChatManager] loginServer:userInfo success:^(NSString *userId) { 51 [[CNLiveChatManager sharedCNLiveChatManager] loginServer:userInfo success:^(NSString *userId) {
50 NSLog(@"连接服务器-----success"); 52 NSLog(@"连接服务器-----success");
51 53
LiveVideoCloud/Classes/Sections/Mine/Controllers/MinePersonalDataController.m
1 // 1 //
2 // MinePersonalDataController.m 2 // MinePersonalDataController.m
3 -// LiveVideoCloud 3 +// WonderfulLive
4 // 4 //
5 -// Created by cnlive on 17/4/11.  
6 -// Copyright © 2017年 CNLive. All rights reserved. 5 +// Created by cnlive on 2016/10/24.
  6 +// Copyright © 2016年 CNLive. All rights reserved.
7 // 7 //
8 8
9 #import "MinePersonalDataController.h" 9 #import "MinePersonalDataController.h"
10 #import "LVCPersonCommonCell.h" 10 #import "LVCPersonCommonCell.h"
11 #import "LVCMineModel.h" 11 #import "LVCMineModel.h"
12 #import "ModifyInfomationController.h" 12 #import "ModifyInfomationController.h"
13 -#import "IDViewController.h"  
14 13
15 #import "MineLiveController.h" 14 #import "MineLiveController.h"
16 @interface MinePersonalDataController ()<UITableViewDelegate,UITableViewDataSource,UIImagePickerControllerDelegate, UINavigationControllerDelegate,UIAlertViewDelegate,UIActionSheetDelegate> 15 @interface MinePersonalDataController ()<UITableViewDelegate,UITableViewDataSource,UIImagePickerControllerDelegate, UINavigationControllerDelegate,UIAlertViewDelegate,UIActionSheetDelegate>
17 { 16 {
18 -// BOOL isLogin; 17 + // BOOL isLogin;
19 } 18 }
20 -@property (nonatomic, strong) UITableView * tbv;//调用的登录sdk 19 +@property (nonatomic, strong) UITableView * tbv;
21 @property (nonatomic, strong) NSMutableArray * dataarray; 20 @property (nonatomic, strong) NSMutableArray * dataarray;
22 @property (nonatomic, strong) NSMutableArray * localTitleArr; 21 @property (nonatomic, strong) NSMutableArray * localTitleArr;
23 22
@@ -29,7 +28,7 @@ @@ -29,7 +28,7 @@
29 [super viewDidLoad]; 28 [super viewDidLoad];
30 29
31 self.title = @"个人资料"; 30 self.title = @"个人资料";
32 -// self.view.backgroundColor = CommonBgColor; 31 + // self.view.backgroundColor = CommonBgColor;
33 } 32 }
34 33
35 34
@@ -47,8 +46,27 @@ @@ -47,8 +46,27 @@
47 } 46 }
48 -(void)bindModel 47 -(void)bindModel
49 { 48 {
50 - [self.dataarray removeAllObjects];} 49 + [self.dataarray removeAllObjects];
  50 + // isLogin = NO;
  51 + //
  52 + // if ([UserTools isLogin])
  53 + // {
  54 + // isLogin = YES;
  55 + // }else
  56 + // {
  57 + // isLogin = NO;
  58 + // }
  59 +}
51 60
  61 +//- (UIButton *)quitBtn
  62 +//{
  63 +// if (!_quitBtn) {
  64 +// _quitBtn = [UIButton buttonWithType:UIButtonTypeCustom];
  65 +// [_quitBtn setImage:[UIImage imageNamed:@" edit"] forState:UIControlStateNormal];
  66 +// [_quitBtn addTarget:self action:@selector(quitBtnClick) forControlEvents:UIControlEventTouchUpInside];
  67 +// }
  68 +// return _quitBtn;
  69 +//}
52 - (NSMutableArray *)dataarray 70 - (NSMutableArray *)dataarray
53 { 71 {
54 if (!_dataarray) { 72 if (!_dataarray) {
@@ -59,17 +77,19 @@ @@ -59,17 +77,19 @@
59 - (NSMutableArray *)localTitleArr 77 - (NSMutableArray *)localTitleArr
60 { 78 {
61 if (!_localTitleArr) { 79 if (!_localTitleArr) {
62 - _localTitleArr = [[NSMutableArray alloc] initWithObjects:@[@"头像",@"昵称",@"性别",@"手机号",@"邮箱",@"所在地"],@[@"视讯号id"], nil]; 80 + // _localTitleArr = [[NSMutableArray alloc] initWithObjects:@[@"头像",@"精灵ID",@"昵称",@"性别",@"手机号",@"邮箱",],@[@"个性签名",@"年龄",@"状态",@"职业"],@[@"收货地址"], nil];
  81 + // _localTitleArr = [[NSMutableArray alloc] initWithObjects:@[@"头像",@"精灵ID",@"昵称",@"性别",@"手机号",@"邮箱",],@[@"收货地址"], nil];
  82 + _localTitleArr = [[NSMutableArray alloc] initWithObjects:@[@"头像",@"昵称",@"性别",@"手机号",@"邮箱",],@[@"收货地址"], nil];
63 } 83 }
64 return _localTitleArr; 84 return _localTitleArr;
65 } 85 }
66 86
67 -- (void)logoutBtnAction//注销登出button 87 +- (void)logoutBtnAction
68 { 88 {
69 - UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"确定要离开吗?" message:nil delegate:self cancelButtonTitle:@"我手滑了" otherButtonTitles:@"忍痛离开", nil]; 89 + UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"你真的要注销吗?" message:nil delegate:self cancelButtonTitle:@"我骗你的" otherButtonTitles:@"注销", nil];
70 alert.tag = 1002; 90 alert.tag = 1002;
71 [alert show]; 91 [alert show];
72 - 92 +
73 } 93 }
74 #pragma mark - UIAlertViewDelegate 94 #pragma mark - UIAlertViewDelegate
75 - (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex 95 - (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
@@ -84,7 +104,16 @@ @@ -84,7 +104,16 @@
84 104
85 [[UserInformationModel manager] cleanUserInfo]; 105 [[UserInformationModel manager] cleanUserInfo];
86 [UserTools clearLocalUserInfo]; 106 [UserTools clearLocalUserInfo];
87 - 107 + //清除个人信息
  108 + // [CNLiveShare logoutWithAPPType:WeChatType result:NULL];
  109 + // [CNLiveShare logoutWithAPPType:QQType result:NULL];
  110 + // [CNLiveShare logoutWithAPPType:SinaType result:NULL];
  111 + // [CNlivePersonalCenter clearLocalUserInfoForLogout];
  112 + // [UserTools setUserLogin:NO];
  113 +
  114 + //清除个人信息邀请码
  115 + // [[NSUserDefaults standardUserDefaults] setObject:@"" forKey:@"kinvitecode"];
  116 +
88 [self.navigationController popViewControllerAnimated:YES]; 117 [self.navigationController popViewControllerAnimated:YES];
89 } 118 }
90 } 119 }
@@ -159,11 +188,10 @@ @@ -159,11 +188,10 @@
159 MBProgressHUD *hud = [Tools showActivityHudInView:self.view withString:@"修改中"]; 188 MBProgressHUD *hud = [Tools showActivityHudInView:self.view withString:@"修改中"];
160 [CNLiveUserSystemCenter uploadIconWithUid:[UserInformationModel manager].uid icon:image success:^(id result) { 189 [CNLiveUserSystemCenter uploadIconWithUid:[UserInformationModel manager].uid icon:image success:^(id result) {
161 [hud hide:NO]; 190 [hud hide:NO];
162 - 191 +
163 [Tools showHUDInView:CURRENT_WINDOW withString:@"修改头像成功" autoHide:YES]; 192 [Tools showHUDInView:CURRENT_WINDOW withString:@"修改头像成功" autoHide:YES];
164 [UserTools saveUserinfoDic:result[@"data"]]; 193 [UserTools saveUserinfoDic:result[@"data"]];
165 [_tbv reloadRowsAtIndexPaths:@[[NSIndexPath indexPathForRow:0 inSection:0]] withRowAnimation:UITableViewRowAnimationFade]; 194 [_tbv reloadRowsAtIndexPaths:@[[NSIndexPath indexPathForRow:0 inSection:0]] withRowAnimation:UITableViewRowAnimationFade];
166 -  
167 } failure:^(NSDictionary *errorDic) { 195 } failure:^(NSDictionary *errorDic) {
168 [Tools showHUDInView:self.view withString:@"修改失败,请稍后再试" autoHide:YES]; 196 [Tools showHUDInView:self.view withString:@"修改失败,请稍后再试" autoHide:YES];
169 }]; 197 }];
@@ -181,7 +209,7 @@ @@ -181,7 +209,7 @@
181 [UserTools setLocalUserInfo:string withKey:@"gender"]; 209 [UserTools setLocalUserInfo:string withKey:@"gender"];
182 [_tbv reloadRowsAtIndexPaths:@[[NSIndexPath indexPathForRow:2 inSection:0]] withRowAnimation:UITableViewRowAnimationFade]; 210 [_tbv reloadRowsAtIndexPaths:@[[NSIndexPath indexPathForRow:2 inSection:0]] withRowAnimation:UITableViewRowAnimationFade];
183 } failure:^(NSDictionary *errorDic) { 211 } failure:^(NSDictionary *errorDic) {
184 - [Tools showHUDInView:self.view withString:@"修改失败,请稍后再试" autoHide:YES]; 212 + [Tools showHUDInView:self.view withString:@"修改失败,请稍后再试" autoHide:YES];
185 }]; 213 }];
186 } 214 }
187 215
@@ -195,7 +223,6 @@ @@ -195,7 +223,6 @@
195 tableView.showsHorizontalScrollIndicator = NO; 223 tableView.showsHorizontalScrollIndicator = NO;
196 tableView.separatorStyle = UITableViewCellSeparatorStyleNone; 224 tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
197 tableView.backgroundColor = CommonBgColor; 225 tableView.backgroundColor = CommonBgColor;
198 -  
199 [tableView registerClass:[LVCPersonCommonCell class] forCellReuseIdentifier:NSStringFromClass([LVCPersonCommonCell class])]; 226 [tableView registerClass:[LVCPersonCommonCell class] forCellReuseIdentifier:NSStringFromClass([LVCPersonCommonCell class])];
200 _tbv = tableView; 227 _tbv = tableView;
201 } 228 }
@@ -205,7 +232,7 @@ @@ -205,7 +232,7 @@
205 { 232 {
206 LVCPersonCommonCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([LVCPersonCommonCell class]) forIndexPath:indexPath]; 233 LVCPersonCommonCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([LVCPersonCommonCell class]) forIndexPath:indexPath];
207 cell.userInteractionEnabled = YES; 234 cell.userInteractionEnabled = YES;
208 - 235 +
209 if (indexPath.section == 0 && indexPath.row == 0) { 236 if (indexPath.section == 0 && indexPath.row == 0) {
210 cell.type = PersonalCellTypeIcon; 237 cell.type = PersonalCellTypeIcon;
211 } 238 }
@@ -217,6 +244,19 @@ @@ -217,6 +244,19 @@
217 { 244 {
218 cell.type = PersonalCellTypedetailWithIndicator; 245 cell.type = PersonalCellTypedetailWithIndicator;
219 } 246 }
  247 + // else if (indexPath.section == 0 && indexPath.row == 1 )
  248 + // {
  249 + // cell.type = PersonalCellTypedetailID;
  250 + // cell.userInteractionEnabled = NO;
  251 + // }else if (indexPath.section == 0 && indexPath.row == 2)
  252 + // {
  253 + // cell.type = PersonalCellTypedetailNick;
  254 + // }
  255 + // else
  256 + // {
  257 + // cell.type = PersonalCellTypedetailWithIndicator;
  258 + // }
  259 +
220 if([UserTools isLogin]){//填入有值选项 260 if([UserTools isLogin]){//填入有值选项
221 UserInformationModel *personalModel = [UserInformationModel manager]; 261 UserInformationModel *personalModel = [UserInformationModel manager];
222 cell.personalModel = personalModel; 262 cell.personalModel = personalModel;
@@ -257,37 +297,61 @@ @@ -257,37 +297,61 @@
257 cell.detailLabel.text = personalModel.email; 297 cell.detailLabel.text = personalModel.email;
258 } 298 }
259 break; 299 break;
260 - case 5:  
261 - {  
262 - if (personalModel.location.length > 0)//收货地址  
263 - {  
264 - cell.detailLabel.text = personalModel.location;  
265 - }  
266 - else  
267 - {  
268 - cell.detailTextLabel.text = @"未设置";  
269 - }  
270 - }  
271 default: 300 default:
272 { 301 {
273 302
274 } 303 }
275 break; 304 break;
276 } 305 }
  306 + // }else if (indexPath.section == 1) {
  307 + // switch (indexPath.row) {
  308 + // case 0:
  309 + // {
  310 + // cell.detailLabel.text = personalModel.personalitySignature;
  311 + // }
  312 + // break;
  313 + // case 1:
  314 + // {
  315 + // cell.detailLabel.text = personalModel.age;
  316 + // }
  317 + // break;
  318 + // case 2:
  319 + // {
  320 + // cell.detailLabel.text = personalModel.state;
  321 + // }
  322 + // break;
  323 + // case 3:
  324 + // {
  325 + // cell.detailLabel.text = personalModel.professional;
  326 + // }
  327 + // break;
  328 + // default:
  329 + // break;
  330 + // }
  331 + }
  332 + else//收货地址
  333 + {
  334 + if(personalModel.location.length > 0)
  335 + {
  336 + cell.detailLabel.text = personalModel.location;
  337 + }else
  338 + {
  339 + cell.detailLabel.text = @"未设置";
  340 + }
  341 + }
  342 + }
  343 + else
  344 + {//未登录 默认为空
  345 + // if(indexPath.section == 2){
  346 + if(indexPath.section == 1){
  347 + cell.detailLabel.text = @"未设置";
  348 + }else
  349 + {
  350 + cell.detailLabel.text = @"";
277 } 351 }
278 -  
279 } 352 }
280 - else  
281 - {//未登录 默认为空  
282 - if(indexPath.section == 1){  
283 - cell.detailLabel.text = @"未设置";  
284 - }else  
285 - {  
286 - cell.detailLabel.text = @"";  
287 - }  
288 - }  
289 [cell loadUIWithModel:self.localTitleArr[indexPath.section][indexPath.row]];//设置本地名 353 [cell loadUIWithModel:self.localTitleArr[indexPath.section][indexPath.row]];//设置本地名
290 - return cell; 354 + return cell;
291 } 355 }
292 356
293 - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView 357 - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
@@ -303,6 +367,8 @@ @@ -303,6 +367,8 @@
303 if (indexPath.section == 0 && indexPath.row == 0) { 367 if (indexPath.section == 0 && indexPath.row == 0) {
304 return 63; 368 return 63;
305 } 369 }
  370 + // if(indexPath.section == 1 && indexPath.row == 1)
  371 + // return 200;
306 return 53; 372 return 53;
307 } 373 }
308 -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath 374 -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
@@ -326,10 +392,10 @@ @@ -326,10 +392,10 @@
326 break; 392 break;
327 case 2: 393 case 2:
328 { 394 {
329 - UIActionSheet *action = [[UIActionSheet alloc] initWithTitle:nil delegate:self cancelButtonTitle:@"取消" destructiveButtonTitle:@"男" otherButtonTitles:@"女", nil];//修改性别时的弹窗,男or女 395 + UIActionSheet *action = [[UIActionSheet alloc] initWithTitle:nil delegate:self cancelButtonTitle:@"取消" destructiveButtonTitle:@"男" otherButtonTitles:@"女", nil];
330 action.tag = 102; 396 action.tag = 102;
331 [action showInView:self.view]; 397 [action showInView:self.view];
332 - 398 +
333 } 399 }
334 break; 400 break;
335 case 3: 401 case 3:
@@ -346,26 +412,24 @@ @@ -346,26 +412,24 @@
346 [self.navigationController pushViewController:modify animated:YES]; 412 [self.navigationController pushViewController:modify animated:YES];
347 } 413 }
348 break; 414 break;
349 - case 5://  
350 - {  
351 - ModifyInfomationController *modify = [[ModifyInfomationController alloc] init];  
352 - modify.type = ModifyInfoTypeAddress;//@"所在地";  
353 - [self.navigationController pushViewController:modify animated:YES];  
354 - }  
355 -  
356 -  
357 default: 415 default:
358 break; 416 break;
359 } 417 }
360 - 418 +
361 return; 419 return;
362 }else if(indexPath.section == 1) 420 }else if(indexPath.section == 1)
363 { 421 {
364 - 422 + ModifyInfomationController *modify = [[ModifyInfomationController alloc] init];
  423 + modify.type = ModifyInfoTypeAddress;//@"设置地址";
  424 + [self.navigationController pushViewController:modify animated:YES];
365 }else 425 }else
366 { 426 {
367 427
368 } 428 }
  429 +
  430 + // MineLiveController * vc = [MineLiveController new];
  431 + // vc.title = self.localTitleArr[indexPath.section][indexPath.row];
  432 + // [self.navigationController pushViewController:vc animated:YES];
369 } 433 }
370 -(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section 434 -(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
371 { 435 {
@@ -380,8 +444,16 @@ @@ -380,8 +444,16 @@
380 - (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section 444 - (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section
381 { 445 {
382 UIView* footerView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_W, 200)]; 446 UIView* footerView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_W, 200)];
  447 + // UIButton *logoutBtn = [UIButton buttonWithType:UIButtonTypeCustom];
  448 + // [logoutBtn setBackgroundImage:[Tools getImageFromColor:[UIColor colorWithHexString:@"969797"]] forState:UIControlStateNormal];
  449 + // [logoutBtn setBackgroundImage:[Tools getImageFromColor:[UIColor colorWithHexString:@"6e6e6e"]] forState:UIControlStateHighlighted];
  450 + // [logoutBtn setTitle:@"注销" forState:UIControlStateNormal];
  451 + // [logoutBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
  452 + // logoutBtn.titleLabel.font = [UIFont systemFontOfSize:17];
  453 + // logoutBtn.layer.cornerRadius = 20;
  454 + // logoutBtn.layer.masksToBounds = YES;
383 455
384 - UIButton *logoutBtn = [UIButton buttonWithTitle:@"注销" titleColor:[UIColor whiteColor] labelFontSize:17 cornerRadius:20 backgroundImageNormal:[Tools getImageFromColor:[UIColor colorWithHexString:@"969797"]] backgroundImageHighlight:[Tools getImageFromColor:[UIColor colorWithHexString:@"6e6e6e"]]];//#fff100 456 + UIButton *logoutBtn = [UIButton buttonWithTitle:@"注销" titleColor:[UIColor whiteColor] labelFontSize:17 cornerRadius:20 backgroundImageNormal:[Tools getImageFromColor:[UIColor colorWithHexString:@"969797"]] backgroundImageHighlight:[Tools getImageFromColor:[UIColor colorWithHexString:@"6e6e6e"]]];
385 logoutBtn.frame = CGRectMake(20, 80, KScreenWidth-40, 40); 457 logoutBtn.frame = CGRectMake(20, 80, KScreenWidth-40, 40);
386 [logoutBtn addTarget:self action:@selector(logoutBtnAction) forControlEvents:UIControlEventTouchUpInside]; 458 [logoutBtn addTarget:self action:@selector(logoutBtnAction) forControlEvents:UIControlEventTouchUpInside];
387 [footerView addSubview:logoutBtn]; 459 [footerView addSubview:logoutBtn];
@@ -395,8 +467,53 @@ @@ -395,8 +467,53 @@
395 return 0; 467 return 0;
396 } 468 }
397 469
  470 +//-(void)scrollViewDidScroll:(UIScrollView *)scrollView {
  471 +//
  472 +// if (scrollView == self.tbv)
  473 +// {
  474 +//
  475 +// UITableView *tableview = (UITableView *)scrollView;
  476 +//
  477 +// CGFloat sectionHeaderHeight = 6;
  478 +//
  479 +// CGFloat sectionFooterHeight = 200;
  480 +//
  481 +// CGFloat offsetY = tableview.contentOffset.y;
  482 +//
  483 +// if (offsetY >= 0 && offsetY <= sectionHeaderHeight)
  484 +//
  485 +// {
  486 +//
  487 +// tableview.contentInset = UIEdgeInsetsMake(-offsetY, 0, -sectionFooterHeight, 0);
  488 +//
  489 +// }else if (offsetY >= sectionHeaderHeight && offsetY <= tableview.contentSize.height - tableview.frame.size.height - sectionFooterHeight)
  490 +//
  491 +// {
  492 +//
  493 +// tableview.contentInset = UIEdgeInsetsMake(-sectionHeaderHeight, 0, -sectionFooterHeight, 0);
  494 +//
  495 +// }else if (offsetY >= tableview.contentSize.height - tableview.frame.size.height - sectionFooterHeight && offsetY <= tableview.contentSize.height - tableview.frame.size.height) {
  496 +//
  497 +// tableview.contentInset = UIEdgeInsetsMake(-offsetY, 0, -(tableview.contentSize.height - tableview.frame.size.height - sectionFooterHeight), 0);
  498 +//
  499 +// }
  500 +//
  501 +// }
  502 +//
  503 +//}
398 - (void)didReceiveMemoryWarning { 504 - (void)didReceiveMemoryWarning {
399 [super didReceiveMemoryWarning]; 505 [super didReceiveMemoryWarning];
  506 + // Dispose of any resources that can be recreated.
400 } 507 }
401 508
  509 +/*
  510 + #pragma mark - Navigation
  511 +
  512 + // In a storyboard-based application, you will often want to do a little preparation before navigation
  513 + - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
  514 + // Get the new view controller using [segue destinationViewController].
  515 + // Pass the selected object to the new view controller.
  516 + }
  517 + */
  518 +
402 @end 519 @end
LiveVideoCloud/Classes/Sections/Mine/Login/Controller/RegisterCommonController.m
@@ -8,6 +8,7 @@ @@ -8,6 +8,7 @@
8 8
9 #import "RegisterCommonController.h" 9 #import "RegisterCommonController.h"
10 #import "RegistBasicInformationView.h" 10 #import "RegistBasicInformationView.h"
  11 +#import "LVCWebViewController.h"
11 12
12 @interface RegisterCommonController () 13 @interface RegisterCommonController ()
13 { 14 {
@@ -153,6 +154,14 @@ @@ -153,6 +154,14 @@
153 button.selected = !button.selected; 154 button.selected = !button.selected;
154 } 155 }
155 156
  157 +- (void)userServiceTermsBtnAction:(UIButton *)button
  158 +{
  159 + LVCWebViewController *VC = [[LVCWebViewController alloc] init];
  160 + VC.url = uploadServiceProtocol;
  161 + VC.title = @"视讯中国充值协议";
  162 + [self.navigationController pushViewController:VC animated:YES];
  163 +}
  164 +
156 - (void)loginBtnAction 165 - (void)loginBtnAction
157 { 166 {
158 167
LiveVideoCloud/Classes/Sections/Mine/Views/LVCLoginShowView.m
@@ -31,7 +31,6 @@ @@ -31,7 +31,6 @@
31 self.userInteractionEnabled = YES; 31 self.userInteractionEnabled = YES;
32 self.autoresizingMask = UIViewAutoresizingFlexibleTopMargin; 32 self.autoresizingMask = UIViewAutoresizingFlexibleTopMargin;
33 self.contentMode = UIViewContentModeScaleToFill; 33 self.contentMode = UIViewContentModeScaleToFill;
34 - //self.autoresizesSubviews = YES;//让子类自动布局  
35 self.autoresizesSubviews = YES;//让子类自动布局 34 self.autoresizesSubviews = YES;//让子类自动布局
36 [self bindView]; 35 [self bindView];
37 [self bindAction]; 36 [self bindAction];
LiveVideoCloud/Classes/Sections/Mine/Views/LVCMineShowCell.m
@@ -108,6 +108,8 @@ @@ -108,6 +108,8 @@
108 } 108 }
109 - (void)setNotification 109 - (void)setNotification
110 { 110 {
  111 + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(loginSuccess) name:ThirdLoginSuccess object:nil];
  112 + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(loginFailure) name:ThirdLoginFailure object:nil];
111 } 113 }
112 114
113 - (void)loginSuccess 115 - (void)loginSuccess
LiveVideoCloud/Classes/Sections/Mine/Views/LVCPersonCommonCell.h
@@ -7,7 +7,7 @@ @@ -7,7 +7,7 @@
7 // 7 //
8 8
9 #import "BaseTableViewCell.h" 9 #import "BaseTableViewCell.h"
10 -//@class UserInfoModel; 10 +
11 @class UserInformationModel; 11 @class UserInformationModel;
12 typedef enum { 12 typedef enum {
13 PersonalCellTypeIcon = 10, 13 PersonalCellTypeIcon = 10,
@@ -22,5 +22,4 @@ typedef enum { @@ -22,5 +22,4 @@ typedef enum {
22 @property (nonatomic ,strong) UIImageView *iconImageView; 22 @property (nonatomic ,strong) UIImageView *iconImageView;
23 @property (nonatomic) PersonalCellType type; 23 @property (nonatomic) PersonalCellType type;
24 24
25 -//- (void)loadUIWithModel:(id)model;  
26 @end 25 @end
LiveVideoCloud/Classes/Sections/Mine/Views/LVCPersonalImageCell.h deleted 100644 → 0
1 -//  
2 -// LVCPersonalImageCell.h  
3 -// LiveVideoCloud  
4 -//  
5 -// Created by cnlive on 17/4/11.  
6 -// Copyright © 2017年 CNLive. All rights reserved.  
7 -//  
8 -  
9 -#import "BaseTableViewCell.h"  
10 -  
11 -@interface LVCPersonalImageCell : BaseTableViewCell  
12 -  
13 -@end  
LiveVideoCloud/Classes/Sections/Mine/Views/LVCPersonalImageCell.m deleted 100644 → 0
1 -//  
2 -// LVCPersonalImageCell.m  
3 -// LiveVideoCloud  
4 -//  
5 -// Created by cnlive on 17/4/11.  
6 -// Copyright © 2017年 CNLive. All rights reserved.  
7 -//  
8 -  
9 -#import "LVCPersonalImageCell.h"  
10 -  
11 -@implementation LVCPersonalImageCell  
12 -  
13 -@end  
LiveVideoCloud/Classes/Sections/PGCSections/Controller/LVCLivePlayerController.m
@@ -41,11 +41,18 @@ @@ -41,11 +41,18 @@
41 - (void)viewWillAppear:(BOOL)animated 41 - (void)viewWillAppear:(BOOL)animated
42 { 42 {
43 [super viewWillAppear:animated]; 43 [super viewWillAppear:animated];
  44 + self.navigationController.navigationBar.hidden = YES;
44 [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent]; 45 [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];
45 [[UIApplication sharedApplication] setStatusBarHidden:NO withAnimation:UIStatusBarAnimationFade]; 46 [[UIApplication sharedApplication] setStatusBarHidden:NO withAnimation:UIStatusBarAnimationFade];
46 47
47 } 48 }
48 49
  50 +- (void)viewDidDisappear:(BOOL)animated
  51 +{
  52 + [super viewDidDisappear:animated];
  53 + self.navigationController.navigationBar.hidden = NO;
  54 +}
  55 +
49 - (void)viewWillDisappear:(BOOL)animated 56 - (void)viewWillDisappear:(BOOL)animated
50 { 57 {
51 [super viewWillDisappear:animated]; 58 [super viewWillDisappear:animated];
@@ -99,6 +106,7 @@ @@ -99,6 +106,7 @@
99 106
100 - (void)addObservers 107 - (void)addObservers
101 { 108 {
  109 + //设备旋转
102 [[NSNotificationCenter defaultCenter] addObserver:self 110 [[NSNotificationCenter defaultCenter] addObserver:self
103 selector:@selector(onDeviceOrientationChange:) 111 selector:@selector(onDeviceOrientationChange:)
104 name:UIDeviceOrientationDidChangeNotification 112 name:UIDeviceOrientationDidChangeNotification
@@ -263,7 +271,6 @@ @@ -263,7 +271,6 @@
263 [_chatView quitChatroom]; 271 [_chatView quitChatroom];
264 [self removeViews]; 272 [self removeViews];
265 273
266 - self.navigationController.navigationBar.hidden = NO;  
267 [self.navigationController popViewControllerAnimated:YES]; 274 [self.navigationController popViewControllerAnimated:YES];
268 } 275 }
269 } 276 }
LiveVideoCloud/Classes/Sections/PGCSections/Controller/LVCTelevisioController.m
@@ -13,7 +13,7 @@ @@ -13,7 +13,7 @@
13 13
14 @interface LVCTelevisioController ()<UITableViewDelegate, UITableViewDataSource> 14 @interface LVCTelevisioController ()<UITableViewDelegate, UITableViewDataSource>
15 { 15 {
16 - NSMutableArray *_channelsModelArray; 16 + NSMutableArray *_channelsModelArray; //数据源
17 } 17 }
18 18
19 @property (nonatomic, strong) UITableView *tableView; 19 @property (nonatomic, strong) UITableView *tableView;
@@ -21,13 +21,18 @@ @@ -21,13 +21,18 @@
21 @end 21 @end
22 22
23 @implementation LVCTelevisioController 23 @implementation LVCTelevisioController
  24 +- (void)viewWillAppear:(BOOL)animated {
  25 + [super viewWillAppear:animated];
  26 + self.edgesForExtendedLayout = UIRectEdgeNone;
  27 + self.navigationController.navigationBar.hidden = NO;
  28 +}
24 29
25 - (void)viewDidLoad { 30 - (void)viewDidLoad {
26 [super viewDidLoad]; 31 [super viewDidLoad];
27 // Do any additional setup after loading the view. 32 // Do any additional setup after loading the view.
28 self.view.backgroundColor = [UIColor whiteColor]; 33 self.view.backgroundColor = [UIColor whiteColor];
29 self.navigationItem.title = @"直播"; 34 self.navigationItem.title = @"直播";
30 - 35 +
31 _channelsModelArray = [[NSMutableArray alloc] init]; 36 _channelsModelArray = [[NSMutableArray alloc] init];
32 37
33 [self.view addSubview:self.tableView]; 38 [self.view addSubview:self.tableView];
@@ -37,6 +42,7 @@ @@ -37,6 +42,7 @@
37 42
38 - (void)loadData { 43 - (void)loadData {
39 44
  45 + //demo使用的是本地数据
40 NSString *path = [[NSBundle mainBundle] pathForResource:@"TelevisionData" ofType:@"json"]; 46 NSString *path = [[NSBundle mainBundle] pathForResource:@"TelevisionData" ofType:@"json"];
41 NSData *data=[NSData dataWithContentsOfFile:path]; 47 NSData *data=[NSData dataWithContentsOfFile:path];
42 NSError *error; 48 NSError *error;
@@ -93,7 +99,7 @@ @@ -93,7 +99,7 @@
93 - (UITableView *)tableView 99 - (UITableView *)tableView
94 { 100 {
95 if (!_tableView) { 101 if (!_tableView) {
96 - _tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT-49) style:UITableViewStylePlain]; 102 + _tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT-49-64) style:UITableViewStylePlain];
97 _tableView.delegate = self; 103 _tableView.delegate = self;
98 _tableView.dataSource = self; 104 _tableView.dataSource = self;
99 } 105 }
LiveVideoCloud/Classes/Sections/PGCSections/View/LVCPlayer.h
@@ -31,7 +31,7 @@ typedef void(^HideInputViewBlock)(BOOL hide); @@ -31,7 +31,7 @@ typedef void(^HideInputViewBlock)(BOOL hide);
31 @property (nonatomic, strong) UIImageView *contentView; //所有空间统一管理在这个view中 31 @property (nonatomic, strong) UIImageView *contentView; //所有空间统一管理在这个view中
32 @property (nonatomic, strong) LVCTelevisionModel *model; //所有空间统一管理在这个view中 32 @property (nonatomic, strong) LVCTelevisionModel *model; //所有空间统一管理在这个view中
33 @property (nonatomic, readwrite, assign) BOOL isFullScreen; //是否是全屏 33 @property (nonatomic, readwrite, assign) BOOL isFullScreen; //是否是全屏
34 -@property (nonatomic, copy) HideInputViewBlock hideBlock; //全屏模式下是否隐藏输入框 34 +@property (nonatomic, copy) HideInputViewBlock hideBlock; //全屏模式下是否隐藏输入框
35 @property (nonatomic, assign, readonly) BOOL displayBarrage; //是否显示弹幕 35 @property (nonatomic, assign, readonly) BOOL displayBarrage; //是否显示弹幕
36 @property (nonatomic, assign) id<LVCPlayerDelegate> delegate; 36 @property (nonatomic, assign) id<LVCPlayerDelegate> delegate;
37 37
@@ -39,6 +39,6 @@ typedef void(^HideInputViewBlock)(BOOL hide); @@ -39,6 +39,6 @@ typedef void(^HideInputViewBlock)(BOOL hide);
39 39
40 - (void)autoHideControlView; //自动隐藏上下功能条 40 - (void)autoHideControlView; //自动隐藏上下功能条
41 41
42 -- (void)stopPlaying; //停止播放 42 +- (void)stopPlaying; //停止播放
43 43
44 @end 44 @end
LiveVideoCloud/Classes/Sections/PGCSections/View/LVCPlayer.m
@@ -33,6 +33,7 @@ @@ -33,6 +33,7 @@
33 33
34 - (void)dealloc 34 - (void)dealloc
35 { 35 {
  36 + [self exitPlayer];
36 NSLog(@"LVCPlayer dealloc"); 37 NSLog(@"LVCPlayer dealloc");
37 } 38 }
38 39
@@ -72,9 +73,9 @@ @@ -72,9 +73,9 @@
72 NSString *channelId = [NSString stringWithFormat:@"82_%@",model.mediaId]; 73 NSString *channelId = [NSString stringWithFormat:@"82_%@",model.mediaId];
73 _player = [[CNLiveMoviePlayerController alloc] initLivePlayWithChannelId:channelId anchorStatus:NO authSuccess:^{ 74 _player = [[CNLiveMoviePlayerController alloc] initLivePlayWithChannelId:channelId anchorStatus:NO authSuccess:^{
74 [self addObservers]; 75 [self addObservers];
75 - _player.videoDecoderMode = CNLiveMovieVideoDecoderMode_AUTO;  
76 - _player.shouldAutoplay = YES;  
77 - [_player prepareToPlay]; 76 + _player.videoDecoderMode = CNLiveMovieVideoDecoderMode_AUTO; //自动解码
  77 + _player.shouldAutoplay = YES; //自动播放
  78 + [_player prepareToPlay]; //准备播放
78 [self.contentView addSubview:_player.view]; 79 [self.contentView addSubview:_player.view];
79 [self.contentView sendSubviewToBack:_player.view]; 80 [self.contentView sendSubviewToBack:_player.view];
80 81
@@ -86,31 +87,12 @@ @@ -86,31 +87,12 @@
86 [_loadingView stopLoading]; 87 [_loadingView stopLoading];
87 88
88 } getAnchorStatusResult:NULL]; 89 } getAnchorStatusResult:NULL];
89 -  
90 - /*  
91 - //点播播放  
92 - _player = [[CNLiveMoviePlayerController alloc] initVodPlayWithVId:@"aaa123"  
93 - authSuccess:^{  
94 -  
95 - [self addObservers];  
96 - _player.videoDecoderMode = CNLiveMovieVideoDecoderMode_AUTO;  
97 - _player.shouldAutoplay = YES;  
98 - [_player prepareToPlay];  
99 - [self.contentView addSubview:_player.view];  
100 - [self.contentView sendSubviewToBack:_player.view];  
101 -  
102 - [self makePlayerConstraint];  
103 -  
104 -  
105 - } authFailed:^(NSDictionary *errorInfo) {  
106 - NSLog(@"初始化点播播放器失败%@", errorInfo);  
107 -  
108 - }];  
109 - */ 90 +
110 } 91 }
111 92
112 #pragma mark - 93 #pragma mark -
113 #pragma mark - action 94 #pragma mark - action
  95 +//播放/暂停
114 - (void)playOrPauseBtnAction:(UIButton *)btn 96 - (void)playOrPauseBtnAction:(UIButton *)btn
115 { 97 {
116 if (btn.selected) { 98 if (btn.selected) {
@@ -123,6 +105,7 @@ @@ -123,6 +105,7 @@
123 105
124 } 106 }
125 107
  108 +//返回
126 - (void)backBtnAction:(UIButton *)btn 109 - (void)backBtnAction:(UIButton *)btn
127 { 110 {
128 if (self.delegate && [self.delegate respondsToSelector:@selector(lvcPlayer:clickedBackBtn:)]) { 111 if (self.delegate && [self.delegate respondsToSelector:@selector(lvcPlayer:clickedBackBtn:)]) {
@@ -130,14 +113,15 @@ @@ -130,14 +113,15 @@
130 } 113 }
131 } 114 }
132 115
  116 +//全屏
133 - (void)fullScreenBtnAction:(UIButton *)btn 117 - (void)fullScreenBtnAction:(UIButton *)btn
134 { 118 {
135 if (self.delegate && [self.delegate respondsToSelector:@selector(lvcPlayer:clickedFullScreenBtn:)]) { 119 if (self.delegate && [self.delegate respondsToSelector:@selector(lvcPlayer:clickedFullScreenBtn:)]) {
136 [self.delegate lvcPlayer:self clickedFullScreenBtn:btn]; 120 [self.delegate lvcPlayer:self clickedFullScreenBtn:btn];
137 } 121 }
138 -  
139 } 122 }
140 123
  124 +//弹幕
141 - (void)barrageSwitchAction 125 - (void)barrageSwitchAction
142 { 126 {
143 self.editBtn.hidden =! self.barrageSwitch.on; 127 self.editBtn.hidden =! self.barrageSwitch.on;
@@ -148,6 +132,7 @@ @@ -148,6 +132,7 @@
148 132
149 } 133 }
150 134
  135 +//编辑弹幕
151 - (void)editBtnAction:(UIButton *)btn 136 - (void)editBtnAction:(UIButton *)btn
152 { 137 {
153 if (self.hideBlock) { 138 if (self.hideBlock) {
@@ -161,7 +146,7 @@ @@ -161,7 +146,7 @@
161 } 146 }
162 } 147 }
163 148
164 - 149 +//单击显示和隐藏工具条
165 - (void)singleTapView 150 - (void)singleTapView
166 { 151 {
167 [UIView animateWithDuration:0.25 animations:^{ 152 [UIView animateWithDuration:0.25 animations:^{
@@ -181,6 +166,7 @@ @@ -181,6 +166,7 @@
181 166
182 } 167 }
183 168
  169 +//自动隐藏工具条
184 - (void)autoHideControlView 170 - (void)autoHideControlView
185 { 171 {
186 if (!_timer) { 172 if (!_timer) {
@@ -192,6 +178,7 @@ @@ -192,6 +178,7 @@
192 } 178 }
193 } 179 }
194 180
  181 +//手动隐藏工具条
195 - (void)hideControlView 182 - (void)hideControlView
196 { 183 {
197 184
@@ -211,8 +198,7 @@ @@ -211,8 +198,7 @@
211 } 198 }
212 } 199 }
213 200
214 -#pragma mark -  
215 -#pragma mark - LVCPlayerLoadingViewDelegate 201 +//播放异常,重试
216 - (void)retryBtnClick 202 - (void)retryBtnClick
217 { 203 {
218 [_loadingView setLVCPlayerStatus:LVCPlayerStatusStartLoading]; 204 [_loadingView setLVCPlayerStatus:LVCPlayerStatusStartLoading];
@@ -272,6 +258,7 @@ @@ -272,6 +258,7 @@
272 object:nil]; 258 object:nil];
273 } 259 }
274 260
  261 +//加载状态通知
275 - (void)loadStateDidChange:(NSNotification *)notification 262 - (void)loadStateDidChange:(NSNotification *)notification
276 { 263 {
277 if (_player) { 264 if (_player) {
@@ -291,6 +278,7 @@ @@ -291,6 +278,7 @@
291 } 278 }
292 } 279 }
293 280
  281 +//播放完成通知,当状态为MPMovieFinishReasonPlaybackError时为异常结束,应显示重试页面
294 - (void)moviePlayBackDidFinish:(NSNotification *)notification 282 - (void)moviePlayBackDidFinish:(NSNotification *)notification
295 { 283 {
296 if (_player) { 284 if (_player) {
@@ -314,6 +302,7 @@ @@ -314,6 +302,7 @@
314 } 302 }
315 } 303 }
316 304
  305 +//播放状态改变通知
317 - (void)moviePlayBackStateDidChange:(NSNotification *)notification 306 - (void)moviePlayBackStateDidChange:(NSNotification *)notification
318 { 307 {
319 if (_player) { 308 if (_player) {
@@ -361,6 +350,7 @@ @@ -361,6 +350,7 @@
361 return netString; 350 return netString;
362 } 351 }
363 352
  353 +//退到后台将播放器暂停
364 - (void)appResignActive:(NSNotification *)noti 354 - (void)appResignActive:(NSNotification *)noti
365 { 355 {
366 if (_player.playbackState == MPMoviePlaybackStatePlaying) { 356 if (_player.playbackState == MPMoviePlaybackStatePlaying) {
@@ -368,6 +358,7 @@ @@ -368,6 +358,7 @@
368 } 358 }
369 } 359 }
370 360
  361 +//回到前台继续播放
371 - (void)appBecomeActive:(NSNotification *)noti 362 - (void)appBecomeActive:(NSNotification *)noti
372 { 363 {
373 if (_player.playbackState == MPMoviePlaybackStatePaused) { 364 if (_player.playbackState == MPMoviePlaybackStatePaused) {
@@ -377,9 +368,14 @@ @@ -377,9 +368,14 @@
377 368
378 #pragma mark - 369 #pragma mark -
379 #pragma mark - public 370 #pragma mark - public
  371 +//停止播放
380 - (void)stopPlaying 372 - (void)stopPlaying
381 { 373 {
382 - [_player stop]; 374 + if (_player) {
  375 + [_player stop]; //注* stop调用多次是会导致崩溃
  376 + }
  377 +
  378 + [_player destroyPlayer];
383 _player = nil; 379 _player = nil;
384 380
385 if (_timer) { 381 if (_timer) {
@@ -392,18 +388,7 @@ @@ -392,18 +388,7 @@
392 388
393 - (void)removeMovieNotificationObservers 389 - (void)removeMovieNotificationObservers
394 { 390 {
395 - [[NSNotificationCenter defaultCenter]removeObserver:self  
396 - name:MPMoviePlayerLoadStateDidChangeNotification  
397 - object:nil];  
398 - [[NSNotificationCenter defaultCenter]removeObserver:self  
399 - name:MPMoviePlayerPlaybackDidFinishNotification  
400 - object:nil];  
401 - [[NSNotificationCenter defaultCenter]removeObserver:self  
402 - name:MPMediaPlaybackIsPreparedToPlayDidChangeNotification  
403 - object:nil];  
404 - [[NSNotificationCenter defaultCenter]removeObserver:self  
405 - name:MPMoviePlayerPlaybackStateDidChangeNotification  
406 - object:nil]; 391 + [[NSNotificationCenter defaultCenter] removeObserver:self];
407 } 392 }
408 393
409 #pragma mark - 394 #pragma mark -
@@ -511,18 +496,20 @@ @@ -511,18 +496,20 @@
511 } 496 }
512 497
513 - (void)exitPlayer { 498 - (void)exitPlayer {
514 - if (_player.isPlaying) { 499 +
  500 + if (_player) {
515 [_player stop]; 501 [_player stop];
516 } 502 }
517 503
518 [_player destroyPlayer]; 504 [_player destroyPlayer];
519 _player = nil; 505 _player = nil;
520 - [self removeMovieNotificationObservers];  
521 506
522 if (_timer) { 507 if (_timer) {
523 [_timer invalidate]; 508 [_timer invalidate];
524 _timer = nil; 509 _timer = nil;
525 } 510 }
  511 +
  512 + [self removeMovieNotificationObservers];
526 } 513 }
527 514
528 #pragma mark - 515 #pragma mark -
LiveVideoCloud/Info.plist
@@ -26,9 +26,11 @@ @@ -26,9 +26,11 @@
26 <true/> 26 <true/>
27 </dict> 27 </dict>
28 <key>NSCameraUsageDescription</key> 28 <key>NSCameraUsageDescription</key>
29 - <string></string> 29 + <string>App需要您的同意,才能访问相机</string>
  30 + <key>NSPhotoLibraryUsageDescription</key>
  31 + <string>App 需要您的同意,才能读取媒体资料库</string>
30 <key>NSMicrophoneUsageDescription</key> 32 <key>NSMicrophoneUsageDescription</key>
31 - <string></string> 33 + <string>App需要您的同意,才能访问麦克风</string>
32 <key>UILaunchStoryboardName</key> 34 <key>UILaunchStoryboardName</key>
33 <string>LaunchScreen</string> 35 <string>LaunchScreen</string>
34 <key>UIRequiredDeviceCapabilities</key> 36 <key>UIRequiredDeviceCapabilities</key>
LiveVideoCloud/animation.xcassets/tabBar/ic_camera.imageset/Contents.json
@@ -17,5 +17,8 @@ @@ -17,5 +17,8 @@
17 "info" : { 17 "info" : {
18 "version" : 1, 18 "version" : 1,
19 "author" : "xcode" 19 "author" : "xcode"
  20 + },
  21 + "properties" : {
  22 + "template-rendering-intent" : "original"
20 } 23 }
21 } 24 }
22 \ No newline at end of file 25 \ No newline at end of file
LiveVideoCloud/animation.xcassets/tabBar/ic_camera_sel.imageset/Contents.json
@@ -17,5 +17,8 @@ @@ -17,5 +17,8 @@
17 "info" : { 17 "info" : {
18 "version" : 1, 18 "version" : 1,
19 "author" : "xcode" 19 "author" : "xcode"
  20 + },
  21 + "properties" : {
  22 + "template-rendering-intent" : "original"
20 } 23 }
21 } 24 }
22 \ No newline at end of file 25 \ No newline at end of file
LiveVideoCloud/animation.xcassets/tabBar/ic_home.imageset/Contents.json
@@ -17,5 +17,8 @@ @@ -17,5 +17,8 @@
17 "info" : { 17 "info" : {
18 "version" : 1, 18 "version" : 1,
19 "author" : "xcode" 19 "author" : "xcode"
  20 + },
  21 + "properties" : {
  22 + "template-rendering-intent" : "original"
20 } 23 }
21 } 24 }
22 \ No newline at end of file 25 \ No newline at end of file
LiveVideoCloud/animation.xcassets/tabBar/ic_home_sel.imageset/Contents.json
@@ -17,5 +17,8 @@ @@ -17,5 +17,8 @@
17 "info" : { 17 "info" : {
18 "version" : 1, 18 "version" : 1,
19 "author" : "xcode" 19 "author" : "xcode"
  20 + },
  21 + "properties" : {
  22 + "template-rendering-intent" : "original"
20 } 23 }
21 } 24 }
22 \ No newline at end of file 25 \ No newline at end of file
LiveVideoCloud/animation.xcassets/tabBar/ic_live_tv.imageset/Contents.json
@@ -17,5 +17,8 @@ @@ -17,5 +17,8 @@
17 "info" : { 17 "info" : {
18 "version" : 1, 18 "version" : 1,
19 "author" : "xcode" 19 "author" : "xcode"
  20 + },
  21 + "properties" : {
  22 + "template-rendering-intent" : "original"
20 } 23 }
21 } 24 }
22 \ No newline at end of file 25 \ No newline at end of file
LiveVideoCloud/animation.xcassets/tabBar/ic_live_tv_sel.imageset/Contents.json
@@ -17,5 +17,8 @@ @@ -17,5 +17,8 @@
17 "info" : { 17 "info" : {
18 "version" : 1, 18 "version" : 1,
19 "author" : "xcode" 19 "author" : "xcode"
  20 + },
  21 + "properties" : {
  22 + "template-rendering-intent" : "original"
20 } 23 }
21 } 24 }
22 \ No newline at end of file 25 \ No newline at end of file
LiveVideoCloud/animation.xcassets/tabBar/ic_person.imageset/Contents.json
@@ -17,5 +17,8 @@ @@ -17,5 +17,8 @@
17 "info" : { 17 "info" : {
18 "version" : 1, 18 "version" : 1,
19 "author" : "xcode" 19 "author" : "xcode"
  20 + },
  21 + "properties" : {
  22 + "template-rendering-intent" : "original"
20 } 23 }
21 } 24 }
22 \ No newline at end of file 25 \ No newline at end of file
LiveVideoCloud/animation.xcassets/tabBar/ic_person_sel.imageset/Contents.json
@@ -17,5 +17,8 @@ @@ -17,5 +17,8 @@
17 "info" : { 17 "info" : {
18 "version" : 1, 18 "version" : 1,
19 "author" : "xcode" 19 "author" : "xcode"
  20 + },
  21 + "properties" : {
  22 + "template-rendering-intent" : "original"
20 } 23 }
21 } 24 }
22 \ No newline at end of file 25 \ No newline at end of file
LiveVideoCloud/animation.xcassets/tabBar/ic_videocam.imageset/Contents.json
@@ -17,5 +17,8 @@ @@ -17,5 +17,8 @@
17 "info" : { 17 "info" : {
18 "version" : 1, 18 "version" : 1,
19 "author" : "xcode" 19 "author" : "xcode"
  20 + },
  21 + "properties" : {
  22 + "template-rendering-intent" : "original"
20 } 23 }
21 } 24 }
22 \ No newline at end of file 25 \ No newline at end of file
LiveVideoCloud/animation.xcassets/tabBar/ic_videocam_sel.imageset/Contents.json
@@ -17,5 +17,8 @@ @@ -17,5 +17,8 @@
17 "info" : { 17 "info" : {
18 "version" : 1, 18 "version" : 1,
19 "author" : "xcode" 19 "author" : "xcode"
  20 + },
  21 + "properties" : {
  22 + "template-rendering-intent" : "original"
20 } 23 }
21 } 24 }
22 \ No newline at end of file 25 \ No newline at end of file
LiveVideoCloud/animation.xcassets/tabBar/live_default.imageset/Contents.json
@@ -17,5 +17,8 @@ @@ -17,5 +17,8 @@
17 "info" : { 17 "info" : {
18 "version" : 1, 18 "version" : 1,
19 "author" : "xcode" 19 "author" : "xcode"
  20 + },
  21 + "properties" : {
  22 + "template-rendering-intent" : "original"
20 } 23 }
21 } 24 }
22 \ No newline at end of file 25 \ No newline at end of file
LiveVideoCloud/animation.xcassets/tabBar/news_default.imageset/Contents.json
@@ -17,5 +17,8 @@ @@ -17,5 +17,8 @@
17 "info" : { 17 "info" : {
18 "version" : 1, 18 "version" : 1,
19 "author" : "xcode" 19 "author" : "xcode"
  20 + },
  21 + "properties" : {
  22 + "template-rendering-intent" : "original"
20 } 23 }
21 } 24 }
22 \ No newline at end of file 25 \ No newline at end of file