Commit 702818dde10d444d048c5dfab5e375e2dc1fe0e5

Authored by 王军波
1 parent 294abd65

点播控制器

LiveVideoCloud.xcodeproj/project.pbxproj
... ... @@ -200,7 +200,6 @@
200 200 D217A24B1E7B76C7003B44CB /* PresentViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = D217A2491E7B76C7003B44CB /* PresentViewCell.m */; };
201 201 D217A24E1E7B77C7003B44CB /* ComboCell.m in Sources */ = {isa = PBXBuildFile; fileRef = D217A24D1E7B77C7003B44CB /* ComboCell.m */; };
202 202 D219E86B1EFD04A700650F38 /* LVCBigHorizontalCollectionViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = D219E86A1EFD04A700650F38 /* LVCBigHorizontalCollectionViewCell.m */; };
203   - D219E86E1F01002400650F38 /* LVCVodPlayerListView.m in Sources */ = {isa = PBXBuildFile; fileRef = D219E86D1F01002400650F38 /* LVCVodPlayerListView.m */; };
204 203 D224B1971E826ED800CC61D0 /* ChatBarrageAnimAction.m in Sources */ = {isa = PBXBuildFile; fileRef = D224B1961E826ED800CC61D0 /* ChatBarrageAnimAction.m */; };
205 204 D22830F11E778C0F00627701 /* LiveBaseView.m in Sources */ = {isa = PBXBuildFile; fileRef = D22830F01E778C0F00627701 /* LiveBaseView.m */; };
206 205 D22830FC1E77C2D900627701 /* BottomToolView.m in Sources */ = {isa = PBXBuildFile; fileRef = D22830FB1E77C2D900627701 /* BottomToolView.m */; };
... ... @@ -261,7 +260,6 @@
261 260 D2CBC13B1ECC157A00E00279 /* LVCVerifyLiveAuthService.m in Sources */ = {isa = PBXBuildFile; fileRef = D2CBC13A1ECC157A00E00279 /* LVCVerifyLiveAuthService.m */; };
262 261 D2D7D18D1E8A581000217771 /* timg.jpeg in Resources */ = {isa = PBXBuildFile; fileRef = D2D7D18C1E8A581000217771 /* timg.jpeg */; };
263 262 D2EBC8571F01FF9200F198FB /* LVCCommentModel.m in Sources */ = {isa = PBXBuildFile; fileRef = D2EBC8561F01FF9200F198FB /* LVCCommentModel.m */; };
264   - D2EBC85A1F02011400F198FB /* LVCVodPlayerTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = D2EBC8591F02011400F198FB /* LVCVodPlayerTableViewCell.m */; };
265 263 D2EBC8641F02105C00F198FB /* LVCHomePageViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D2EBC8631F02105C00F198FB /* LVCHomePageViewController.m */; };
266 264 D2EBC8711F02108000F198FB /* LiveListService.m in Sources */ = {isa = PBXBuildFile; fileRef = D2EBC8661F02108000F198FB /* LiveListService.m */; };
267 265 D2EBC8721F02108000F198FB /* LVCLiveActivityInfoService.m in Sources */ = {isa = PBXBuildFile; fileRef = D2EBC8681F02108000F198FB /* LVCLiveActivityInfoService.m */; };
... ... @@ -715,8 +713,6 @@
715 713 D217A24D1E7B77C7003B44CB /* ComboCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ComboCell.m; path = Present/ComboCell.m; sourceTree = "<group>"; };
716 714 D219E8691EFD04A700650F38 /* LVCBigHorizontalCollectionViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LVCBigHorizontalCollectionViewCell.h; sourceTree = "<group>"; };
717 715 D219E86A1EFD04A700650F38 /* LVCBigHorizontalCollectionViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LVCBigHorizontalCollectionViewCell.m; sourceTree = "<group>"; };
718   - D219E86C1F01002400650F38 /* LVCVodPlayerListView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LVCVodPlayerListView.h; sourceTree = "<group>"; };
719   - D219E86D1F01002400650F38 /* LVCVodPlayerListView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LVCVodPlayerListView.m; sourceTree = "<group>"; };
720 716 D224B1951E826ED800CC61D0 /* ChatBarrageAnimAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ChatBarrageAnimAction.h; sourceTree = "<group>"; };
721 717 D224B1961E826ED800CC61D0 /* ChatBarrageAnimAction.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ChatBarrageAnimAction.m; sourceTree = "<group>"; };
722 718 D22830EF1E778C0F00627701 /* LiveBaseView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LiveBaseView.h; sourceTree = "<group>"; };
... ... @@ -825,8 +821,6 @@
825 821 D2D7D18C1E8A581000217771 /* timg.jpeg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = timg.jpeg; sourceTree = "<group>"; };
826 822 D2EBC8551F01FF9200F198FB /* LVCCommentModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LVCCommentModel.h; sourceTree = "<group>"; };
827 823 D2EBC8561F01FF9200F198FB /* LVCCommentModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LVCCommentModel.m; sourceTree = "<group>"; };
828   - D2EBC8581F02011400F198FB /* LVCVodPlayerTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LVCVodPlayerTableViewCell.h; sourceTree = "<group>"; };
829   - D2EBC8591F02011400F198FB /* LVCVodPlayerTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LVCVodPlayerTableViewCell.m; sourceTree = "<group>"; };
830 824 D2EBC8621F02105C00F198FB /* LVCHomePageViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LVCHomePageViewController.h; sourceTree = "<group>"; };
831 825 D2EBC8631F02105C00F198FB /* LVCHomePageViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LVCHomePageViewController.m; sourceTree = "<group>"; };
832 826 D2EBC8651F02108000F198FB /* LiveListService.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LiveListService.h; sourceTree = "<group>"; };
... ... @@ -2177,10 +2171,6 @@
2177 2171 D2888DAA1E6EC014003A77C8 /* View */ = {
2178 2172 isa = PBXGroup;
2179 2173 children = (
2180   - D219E86C1F01002400650F38 /* LVCVodPlayerListView.h */,
2181   - D219E86D1F01002400650F38 /* LVCVodPlayerListView.m */,
2182   - D2EBC8581F02011400F198FB /* LVCVodPlayerTableViewCell.h */,
2183   - D2EBC8591F02011400F198FB /* LVCVodPlayerTableViewCell.m */,
2184 2174 );
2185 2175 path = View;
2186 2176 sourceTree = "<group>";
... ... @@ -2425,7 +2415,6 @@
2425 2415 4B45CE981EB86A760079AFB7 /* UILabel+createLabel.m in Sources */,
2426 2416 D2029C9C1E6EADE10027CD92 /* MJPropertyType.m in Sources */,
2427 2417 D22831091E77D8D500627701 /* GiftModel.m in Sources */,
2428   - D2EBC85A1F02011400F198FB /* LVCVodPlayerTableViewCell.m in Sources */,
2429 2418 D23BBDBE1EF8ED4A002FE0B8 /* LVCChannelDetailModel.m in Sources */,
2430 2419 D2029CCD1E6EADE10027CD92 /* SearchModel.m in Sources */,
2431 2420 4BD8560F1EBACEF80082061D /* CNLiveWebView.m in Sources */,
... ... @@ -2579,7 +2568,6 @@
2579 2568 D2029D031E6EAE2E0027CD92 /* UIImage+ZXExtension.m in Sources */,
2580 2569 4BD855FC1EBACD530082061D /* AFHTTPSessionManager.m in Sources */,
2581 2570 4B45CE841EB86A590079AFB7 /* ModifyCommonView.m in Sources */,
2582   - D219E86E1F01002400650F38 /* LVCVodPlayerListView.m in Sources */,
2583 2571 4BD856081EBACD530082061D /* UIProgressView+AFNetworking.m in Sources */,
2584 2572 D24571581E8393EB00AA85D6 /* UIImageView+ZXExtension.m in Sources */,
2585 2573 D2029D0A1E6EAE2E0027CD92 /* ZXServerUrl.m in Sources */,
... ...
LiveVideoCloud/Classes/Sections/homeSections/Controller/LVCVodPlayerListController.m
... ... @@ -8,7 +8,15 @@
8 8  
9 9 #import "LVCVodPlayerListController.h"
10 10  
11   -@interface LVCVodPlayerListController ()
  11 +static NSString *vodCellId = @"vodCellId";
  12 +
  13 +@interface LVCVodPlayerListController ()<UITableViewDelegate, UITableViewDataSource> {
  14 +
  15 + AFHTTPRequestOperation *_operation;
  16 + NSMutableArray *_programArrayM;
  17 +}
  18 +
  19 +@property (nonatomic, strong)UITableView *tableView;
12 20  
13 21 @end
14 22  
... ... @@ -19,21 +27,99 @@
19 27  
20 28 self.navigationItem.title = @"点播";
21 29 self.view.backgroundColor = [UIColor whiteColor];
  30 + _programArrayM = [[NSMutableArray alloc] init];
22 31 }
23 32  
24   -- (void)didReceiveMemoryWarning {
25   - [super didReceiveMemoryWarning];
26   - // Dispose of any resources that can be recreated.
  33 +- (void)requestVodPlayerList {
  34 +
  35 + NSString *uid;
  36 + if ([UserTools isLogin]) {
  37 + uid = [UserInformationModel manager].uid;
  38 + } else {
  39 + uid = [NSString stringWithFormat:@"%u", arc4random()%3];
  40 + }
  41 + NSString *tm = [NSString stringWithFormat:@"%u_%@", arc4random()%10, uid];
  42 +
  43 + NSDictionary *parameter = @{@"cid": @"82_news/",
  44 + @"page": [NSString stringWithFormat:@"%d", 1],
  45 + @"pagesize": @"15",
  46 + @"tm": tm};
  47 +
  48 + [[AFHTTPRequestOperationManager manager] GET:Newslist parameters:[self addParameters:parameter] success:^(AFHTTPRequestOperation *operation, id responseObject) {
  49 +
  50 + responseObject = [responseObject validatedDictionary];
  51 +
  52 + if (responseObject[@"programs"] && [responseObject[@"programs"] isKindOfClass:[NSArray class]]) {
  53 +
  54 + for (NSDictionary *dic in responseObject[@"programs"]) {
  55 + ProgramModel *programModel = [ProgramModel modelWithDic:dic];
  56 + [_programArrayM addObject:programModel];
  57 + if (dic[@"comments"] && [dic[@"comments"] isKindOfClass:[NSArray class]] && [dic[@"comments"] count] > 0) {
  58 + NSMutableArray *comments = [[NSMutableArray alloc] init];
  59 + for (NSDictionary *commentDic in dic[@"comments"]) {
  60 + LVCCommentModel *commentModel = [LVCCommentModel modelWithDic:commentDic];
  61 + [comments addObject:commentModel];
  62 + }
  63 + [_programArrayM addObject:comments];
  64 + }
  65 + }
  66 + }
  67 + [self.tableView reloadData];
  68 +
  69 + } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
  70 +
  71 + NSLog(@"点播列表请求失败!");
  72 + }];
  73 +}
  74 +
  75 +#pragma mark - UITableViewDelegate !!!!!!!!!!!!!!!!!!!!!!!!
  76 +
  77 +#pragma mark - UITableViewDataSource !!!!!!!!!!!!!!!!!!!!!!!!
  78 +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
  79 + return _programArrayM.count;
  80 +}
  81 +
  82 +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
  83 +
  84 + return nil;
  85 +}
  86 +
  87 +#pragma mark - GetMethod !!!!!!!!!!!!!!!!!!!!!!!!!!!!
  88 +- (UITableView *)tableView {
  89 +
  90 + if (!_tableView) {
  91 + _tableView = [[UITableView alloc] initWithFrame:self.view.bounds style:UITableViewStylePlain];
  92 + _tableView.dataSource = self;
  93 + _tableView.delegate = self;
  94 + _tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
  95 +
  96 + UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, -KScreenHeight, KScreenWidth, KScreenHeight)];
  97 + view.backgroundColor = [UIColor backgroundColor];
  98 + [_tableView addSubview:view];
  99 +
  100 + [_tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:vodCellId];
  101 + }
  102 + return _tableView;
27 103 }
28 104  
29   -/*
30   -#pragma mark - Navigation
  105 +#pragma mark ------------------------------ 分割线 ----------------------------------------------
  106 +- (NSDictionary *)addParameters:(NSDictionary *)dict {
  107 +
  108 + if (![dict isKindOfClass:[NSDictionary class]]) {
  109 + return dict;
  110 + }
  111 + if (!dict) {
  112 + return @{@"appid": JBAppId, @"plat": @"i", @"version": JBAppVersion};
  113 + } else {
  114 + NSMutableDictionary *dic = [[NSMutableDictionary alloc] initWithDictionary:dict];
  115 + [dic addEntriesFromDictionary:@{@"appid": JBAppId, @"plat": @"i", @"version": JBAppVersion}];
  116 + return [[NSDictionary alloc] initWithDictionary:dic];
  117 + }
  118 +}
31 119  
32   -// In a storyboard-based application, you will often want to do a little preparation before navigation
33   -- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
34   - // Get the new view controller using [segue destinationViewController].
35   - // Pass the selected object to the new view controller.
  120 +- (void)didReceiveMemoryWarning {
  121 + [super didReceiveMemoryWarning];
  122 + // Dispose of any resources that can be recreated.
36 123 }
37   -*/
38 124  
39 125 @end
... ...
LiveVideoCloud/Classes/Sections/homeSections/View/LVCVodPlayerListView.h deleted 100644 → 0
1   -//
2   -// LVCVodPlayerListView.h
3   -// LiveVideoCloud
4   -//
5   -// Created by cnliveJunBo on 17/6/26.
6   -// Copyright © 2017年 cnlive. All rights reserved.
7   -//
8   -
9   -#import <UIKit/UIKit.h>
10   -
11   -@interface LVCVodPlayerListView : UIView
12   -
13   -@end
LiveVideoCloud/Classes/Sections/homeSections/View/LVCVodPlayerListView.m deleted 100644 → 0
1   -//
2   -// LVCVodPlayerListView.m
3   -// LiveVideoCloud
4   -//
5   -// Created by cnliveJunBo on 17/6/26.
6   -// Copyright © 2017年 cnlive. All rights reserved.
7   -//
8   -
9   -#import "LVCVodPlayerListView.h"
10   -#import "LVCVodPlayerTableViewCell.h"
11   -
12   -static NSString *vodCellId = @"vodCellId";
13   -
14   -@interface LVCVodPlayerListView()<UITableViewDelegate, UITableViewDataSource> {
15   -
16   - AFHTTPRequestOperation *_operation;
17   - NSMutableArray *_programArrayM;
18   -}
19   -
20   -@property (nonatomic, strong)UITableView *tableView;
21   -
22   -@end
23   -
24   -@implementation LVCVodPlayerListView
25   -
26   -- (instancetype)initWithFrame:(CGRect)frame
27   -{
28   - self = [super initWithFrame:frame];
29   - if (self) {
30   - self.backgroundColor = [UIColor whiteColor];
31   - _programArrayM = [[NSMutableArray alloc] init];
32   - [self requestVodPlayerList];
33   - }
34   - return self;
35   -}
36   -
37   -- (void)requestVodPlayerList {
38   -
39   - NSString *uid;
40   - if ([UserTools isLogin]) {
41   - uid = [UserInformationModel manager].uid;
42   - } else {
43   - uid = [NSString stringWithFormat:@"%u", arc4random()%3];
44   - }
45   - NSString *tm = [NSString stringWithFormat:@"%u_%@", arc4random()%10, uid];
46   -
47   - NSDictionary *parameter = @{@"cid": @"82_news/",
48   - @"page": [NSString stringWithFormat:@"%d", 1],
49   - @"pagesize": @"15",
50   - @"tm": tm};
51   -
52   - [[AFHTTPRequestOperationManager manager] GET:Newslist parameters:[self addParameters:parameter] success:^(AFHTTPRequestOperation *operation, id responseObject) {
53   -
54   - responseObject = [responseObject validatedDictionary];
55   -
56   - if (responseObject[@"programs"] && [responseObject[@"programs"] isKindOfClass:[NSArray class]]) {
57   -
58   - for (NSDictionary *dic in responseObject[@"programs"]) {
59   - ProgramModel *programModel = [ProgramModel modelWithDic:dic];
60   - [_programArrayM addObject:programModel];
61   - if (dic[@"comments"] && [dic[@"comments"] isKindOfClass:[NSArray class]] && [dic[@"comments"] count] > 0) {
62   - NSMutableArray *comments = [[NSMutableArray alloc] init];
63   - for (NSDictionary *commentDic in dic[@"comments"]) {
64   - LVCCommentModel *commentModel = [LVCCommentModel modelWithDic:commentDic];
65   - [comments addObject:commentModel];
66   - }
67   - [_programArrayM addObject:comments];
68   - }
69   - }
70   - }
71   - [self.tableView reloadData];
72   -
73   - } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
74   -
75   - NSLog(@"点播列表请求失败!");
76   - }];
77   -}
78   -
79   -#pragma mark - UITableViewDelegate !!!!!!!!!!!!!!!!!!!!!!!!
80   -
81   -#pragma mark - UITableViewDataSource !!!!!!!!!!!!!!!!!!!!!!!!
82   -- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
83   - return _programArrayM.count;
84   -}
85   -
86   -- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
87   -
88   - return nil;
89   -}
90   -
91   -#pragma mark - GetMethod !!!!!!!!!!!!!!!!!!!!!!!!!!!!
92   -- (UITableView *)tableView {
93   -
94   - if (!_tableView) {
95   - _tableView = [[UITableView alloc] initWithFrame:self.bounds style:UITableViewStylePlain];
96   - _tableView.dataSource = self;
97   - _tableView.delegate = self;
98   - _tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
99   -
100   - UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, -KScreenHeight, KScreenWidth, KScreenHeight)];
101   - view.backgroundColor = [UIColor backgroundColor];
102   - [_tableView addSubview:view];
103   -
104   - [_tableView registerClass:[LVCVodPlayerTableViewCell class] forCellReuseIdentifier:vodCellId];
105   - }
106   - return _tableView;
107   -}
108   -
109   -#pragma mark ------------------------------ 分割线 ----------------------------------------------
110   -- (NSDictionary *)addParameters:(NSDictionary *)dict {
111   -
112   - if (![dict isKindOfClass:[NSDictionary class]]) {
113   - return dict;
114   - }
115   - if (!dict) {
116   - return @{@"appid": JBAppId, @"plat": @"i", @"version": JBAppVersion};
117   - } else {
118   - NSMutableDictionary *dic = [[NSMutableDictionary alloc] initWithDictionary:dict];
119   - [dic addEntriesFromDictionary:@{@"appid": JBAppId, @"plat": @"i", @"version": JBAppVersion}];
120   - return [[NSDictionary alloc] initWithDictionary:dic];
121   - }
122   -}
123   -
124   -@end
LiveVideoCloud/Classes/Sections/homeSections/View/LVCVodPlayerTableViewCell.h deleted 100644 → 0
1   -//
2   -// LVCVodPlayerTableViewCell.h
3   -// LiveVideoCloud
4   -//
5   -// Created by cnliveJunBo on 17/6/27.
6   -// Copyright © 2017年 cnlive. All rights reserved.
7   -//
8   -
9   -#import <UIKit/UIKit.h>
10   -
11   -@interface LVCVodPlayerTableViewCell : UITableViewCell
12   -
13   -@end
LiveVideoCloud/Classes/Sections/homeSections/View/LVCVodPlayerTableViewCell.m deleted 100644 → 0
1   -//
2   -// LVCVodPlayerTableViewCell.m
3   -// LiveVideoCloud
4   -//
5   -// Created by cnliveJunBo on 17/6/27.
6   -// Copyright © 2017年 cnlive. All rights reserved.
7   -//
8   -
9   -#import "LVCVodPlayerTableViewCell.h"
10   -
11   -@implementation LVCVodPlayerTableViewCell
12   -
13   -- (void)awakeFromNib {
14   - [super awakeFromNib];
15   - // Initialization code
16   -}
17   -
18   -- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
19   - [super setSelected:selected animated:animated];
20   -
21   - // Configure the view for the selected state
22   -}
23   -
24   -@end