Commit c647b2e97805765e0ddf8e001c716ad29f4514f7

Authored by zhangxiaowen
1 parent c0419aa5

no message

CNLiveScioLive/Pages/Live/Controller/CNLiveViewController.m
... ... @@ -173,6 +173,8 @@ static NSString *indicatorTableViewCell = @"CNLiveIndicatorTableViewCell";
173 173  
174 174 self.navigationController.navigationBar.barTintColor = [UIColor whiteColor];
175 175 self.navigationController.navigationBar.titleTextAttributes = @{NSForegroundColorAttributeName:[UIColor whiteColor], NSFontAttributeName:[UIFont systemFontOfSize:18]};
  176 + [self.navigationController setNavigationBarHidden:NO];
  177 +
176 178 }
177 179  
178 180 - (void)viewDidLoad {
... ...
CNLiveScioLive/Pages/Live/Controller/GraphicLiveViewController.h
... ... @@ -54,5 +54,7 @@ typedef NS_ENUM(NSInteger, PlayerType) {
54 54 @property (nonatomic, assign) PlayerType type;
55 55  
56 56 @property (nonatomic, strong) NSArray *relatedArray;
57   --(id)initWithDictionary:(NSDictionary*)dictionary;
  57 +
  58 +- (id)initWithDictionary:(NSDictionary*)dictionary;
  59 +
58 60 @end
... ...
CNLiveScioLive/Pages/Live/Controller/GraphicLiveViewController.m
... ... @@ -16,7 +16,8 @@
16 16 [self.videoController stop];
17 17 [self.navigationController popViewControllerAnimated:YES];
18 18 }
19   -- (id)initWithDictionary:(NSDictionary*)dictionary {
  19 +
  20 +- (id)initWithDictionary:(NSDictionary *)dictionary {
20 21 if (self = [super init]) {
21 22 _dictionary = [NSDictionary dictionaryWithDictionary:dictionary];
22 23 int status = [_dictionary[@"status"] intValue];
... ... @@ -44,12 +45,14 @@
44 45 }
45 46 return self;
46 47 }
  48 +
47 49 - (NSString *)setHTMLString {
48 50 NSString* htmlBody = [[NSString alloc] initWithFormat:@"<p><font style=\"font-size:%@px;\">%@</font></p>",fontArray[fontIndex],[_dic objectForKey:@"Content"]];
49 51 NSString* htmlFooter = @"</body></html>";
50 52 NSString* strHtml = [[NSString alloc] initWithFormat:@"%@%@",htmlBody,htmlFooter];
51 53 return strHtml;
52 54 }
  55 +
53 56 - (void)loadData {
54 57 if (![[Reachability reachabilityForInternetConnection] currentReachabilityStatus]) {
55 58 [AlertViewTool showHUDViewText:CustomStr(@"NetworkiInterruption")];
... ... @@ -89,12 +92,14 @@
89 92 [[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryAmbient error: &error];
90 93 [[AVAudioSession sharedInstance] setActive:YES error:nil];
91 94 }
  95 +
92 96 - (void)viewWillDisappear:(BOOL)animated {
93 97 [super viewWillDisappear:animated];
94 98 [self.liveController stop];
95 99 self.liveController = nil;
96 100 [self.navigationController setNavigationBarHidden:NO];
97 101 }
  102 +
98 103 - (void)viewDidLoad {
99 104 [super viewDidLoad];
100 105 self.view.backgroundColor = [UIColor whiteColor];
... ... @@ -168,7 +173,8 @@
168 173 - (void)loadMovieView {
169 174 [[NSUserDefaults standardUserDefaults] setObject:@0 forKey:@"GraphicLive_DidLockScreen"];
170 175 imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, iPhoneX ? 44 : 0, MainScreenWidth, videoHeight)];
171   - imageView.image = [UIImage imageNamed:@"cnlive_placeholder"];
  176 +// imageView.image = [UIImage imageNamed:@"cnlive_placeholder"];
  177 + [imageView sd_setImageWithURL:[NSURL URLWithString:_dictionary[@"poster"]] placeholderImage:[UIImage imageNamed:@"cnlive_placeholder"]];
172 178 [self.view addSubview:imageView];
173 179  
174 180 UIButton *backButton = [UIButton buttonWithType:UIButtonTypeCustom];
... ...
CNLiveScioLive/Pages/Live/Controller/VideoPlayBackViewController.m
... ... @@ -23,25 +23,35 @@
23 23 [self.videoController stop];
24 24 [self.navigationController popToRootViewControllerAnimated:YES];
25 25 }
26   --(id)initWithDictionary:(NSDictionary*)dictionary{
  26 +- (id)initWithDictionary:(NSDictionary*)dictionary{
27 27 if (self = [super init]) {
28 28 _dictionary = [NSDictionary dictionaryWithDictionary:dictionary];
29   - if (![_dictionary[@"videoUrl"] isEqualToString:@""]) {
30   - isPlay = YES;
31   - url = _dictionary[@"videoUrl"];
32   - if (0 == [url length]) {
33   - url = _dictionary[@"uploadVideoUrl"];
  29 + if ([_dictionary[@"videoFlag"] isEqualToString:@"1"]) {
  30 + if (![_dictionary[@"videoUrl"] isEqualToString:@""]) {
  31 + isPlay = YES;
  32 + url = _dictionary[@"videoUrl"];
  33 + if (0 == [url length]) {
  34 + url = _dictionary[@"uploadVideoUrl"];
  35 + }
  36 + url = [url stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];
  37 + movieUrl = [NSURL URLWithString:url];
  38 +
  39 + } else {
  40 + isPlay = NO;
34 41 }
35   - url = [url stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];
36   - movieUrl = [NSURL URLWithString:url];
  42 +
37 43 } else {
38 44 isPlay = NO;
  45 +
39 46 }
  47 +
40 48 NSLog(@"movieUrl -> %@",movieUrl);
41 49 videoHeight = MainScreenWidth * (9.0 / 16.0);
  50 +
42 51 }
43 52 return self;
44 53 }
  54 +
45 55 - (NSString *)setHTMLString {
46 56 // NSString* htmlHeader = [[NSString alloc] initWithFormat:@"<html><p><font style=\"font-size:20px;\"><strong>%@</strong></font><br>%@</p><body>",[_dicArticle objectForKey:@"Tittle"],[_dicArticle objectForKey:@"PublishDateTime"]];
47 57 NSString* htmlBody = [[NSString alloc] initWithFormat:@"<p><font style=\"font-size:%@px;\">%@</font></p>",fontArray[fontIndex],[_dicArticle objectForKey:@"Content"]];
... ... @@ -126,6 +136,7 @@
126 136 [shareButton addTarget:self action:@selector(shareButtonTaped:) forControlEvents:UIControlEventTouchUpInside];
127 137 [self.view addSubview:shareButton];
128 138 [shareButton setTag:30000];
  139 +
129 140 }
130 141 - (void)shareButtonTaped:(id)sender {
131 142 UIButton *btn = (UIButton *)sender;
... ... @@ -297,13 +308,13 @@
297 308 - (void)loadMovieView {
298 309 [[NSUserDefaults standardUserDefaults] setObject:@0 forKey:@"GraphicLive_DidLockScreen"];
299 310 imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, iPhoneX ? 44 : 0, MainScreenWidth, videoHeight)];
300   - imageView.image = [UIImage imageNamed:@"backDefault1"];
  311 + [imageView sd_setImageWithURL:[NSURL URLWithString:_dictionary[@"poster"]] placeholderImage:[UIImage imageNamed:@"cnlive_placeholder"]];
301 312 [self.view addSubview:imageView];
302 313  
303 314 UIButton *backButton = [UIButton buttonWithType:UIButtonTypeCustom];
304 315 [backButton addTarget:self action:@selector(Pop:) forControlEvents:UIControlEventTouchUpInside];
305   - [backButton setImage:[UIImage imageNamed:@"navigationBack"] forState:UIControlStateNormal];
306   - [backButton setFrame:CGRectMake(0, 20, 44, 44)];
  316 + [backButton setImage:[UIImage imageNamed:@"cnlive_white_back"] forState:UIControlStateNormal];
  317 + [backButton setFrame:CGRectMake(0, StatusBarHeight, 44, 44)];
307 318 [self.view addSubview:backButton];
308 319 }
309 320  
... ...
CNLiveScioLive/Pages/Live/Model/CNLiveModel.h
... ... @@ -18,6 +18,12 @@
18 18 @property (nonatomic, copy) NSString *img;
19 19 @property (nonatomic, copy) NSString *selectedImage;
20 20 @property (nonatomic, copy) NSString *createDate;
  21 +@property (nonatomic, copy) NSString *liveShow;//liveShow 展示标识 0:APP不展示 1:展示
  22 +
  23 +
  24 +@property (nonatomic, copy) NSString *liveFlag;//liveFlag 直播标识 0:视频直播 1:图文直播
  25 +
  26 +@property (nonatomic, copy) NSString *videoFlag;//videoFlag 0 图文回放 1视频回放
21 27  
22 28  
23 29 /*
... ... @@ -39,7 +45,6 @@
39 45 }
40 46 */
41 47  
42   -@property (nonatomic, copy) NSString *liveFlag;
43 48 @property (nonatomic, copy) NSString *activityId;
44 49 @property (nonatomic, copy) NSString *playbackId;
45 50 @property (nonatomic, copy) NSString *checkinfo;
... ...
CNLiveScioLive/Pages/Live/View/CNLiveTableViewCell.m
... ... @@ -67,6 +67,7 @@
67 67 _titleLabel.text = model.title;
68 68 _timeLabel.text = model.createDate;
69 69 [_picImage sd_setImageWithURL:[NSURL URLWithString:model.img] placeholderImage:[UIImage imageNamed:@"placeholder"]];
  70 + _playImage.hidden = [model.videoFlag isEqualToString:@"0"];
70 71 [self layoutSubviews];
71 72  
72 73 }
... ...