Commit 6199231f94fa8c39476d88a19160d347403f5c77

Authored by 张旭
2 parents c0cf25a8 802f13cd

Merge branch 'master' of bj.gitlab.cnlive.com:ios-team/ScioLive into App-Store配置

CNLiveScioLive/Info.plist
... ... @@ -17,7 +17,7 @@
17 17 <key>CFBundlePackageType</key>
18 18 <string>APPL</string>
19 19 <key>CFBundleShortVersionString</key>
20   - <string>3.5.1</string>
  20 + <string>3.5.2</string>
21 21 <key>CFBundleURLTypes</key>
22 22 <array>
23 23 <dict>
... ... @@ -54,7 +54,7 @@
54 54 </dict>
55 55 </array>
56 56 <key>CFBundleVersion</key>
57   - <string>354</string>
  57 + <string>355</string>
58 58 <key>LSApplicationQueriesSchemes</key>
59 59 <array>
60 60 <string>alipay</string>
... ...
CNLiveScioLive/Pages/Home/新闻详情/OldController/OldArticleDetailViewController.m
... ... @@ -31,7 +31,9 @@
31 31 if (self = [super init]) {
32 32 _dictionary = [NSDictionary dictionaryWithDictionary:dictionary];
33 33 _imageArray = [[ NSMutableArray alloc] init];
34   - htmlString = [NSString stringWithContentsOfURL:[NSURL URLWithString:dictionary[@"pageUrl"]] encoding:NSUTF8StringEncoding error:nil];
  34 +
  35 + NSString *url = [NSString stringWithFormat:@"%@?from=ios",dictionary[@"pageUrl"]];
  36 + htmlString = [NSString stringWithContentsOfURL:[NSURL URLWithString:url] encoding:NSUTF8StringEncoding error:nil];
35 37 //替换掉html页面中的展示js
36 38 NSString *replace=[htmlString stringByReplacingOccurrencesOfString:@"previewImage.start(obj);" withString:@""];
37 39 htmlString=replace;
... ...
CNLiveScioLive/Pages/Live/Controller/CNLiveViewController.m
... ... @@ -57,7 +57,7 @@ static NSString *indicatorTableViewCell = @&quot;CNLiveIndicatorTableViewCell&quot;;
57 57 self.liveModel = [CNLiveModel mj_objectWithKeyValues:dic];
58 58 self.header.model = [CNLiveModel mj_objectWithKeyValues:dic];
59 59 [self.tableView reloadData];
60   - self->_isLoaded = YES;
  60 +// self->_isLoaded = YES;
61 61  
62 62 } failure:^(NSError *error) {
63 63 [AlertViewTool showHUDAddedToView:self.view text:CustomStr(@"ServerBusy")];
... ... @@ -157,12 +157,12 @@ static NSString *indicatorTableViewCell = @&quot;CNLiveIndicatorTableViewCell&quot;;
157 157 }
158 158 }
159 159 - (void)loadMoreData{
160   -// if(!_isRefreshing){
161   -// _isRefreshing = YES;
162   -// [self loadData];
163   -// }
164   - [self.tableView.mj_footer endRefreshing];
165   - [AlertViewTool showHUDViewText:@"查看往期发布会回放,请点击搜索按钮" block:nil duration:1.5];
  160 + if(!_isRefreshing){
  161 + _isRefreshing = YES;
  162 + [self loadData];
  163 + }
  164 +// [self.tableView.mj_footer endRefreshing];
  165 +// [AlertViewTool showHUDViewText:@"查看往期发布会回放,请点击搜索按钮" block:nil duration:1.5];
166 166  
167 167 }
168 168 - (void)viewWillAppear:(BOOL)animated{
... ... @@ -370,10 +370,20 @@ static NSString *indicatorTableViewCell = @&quot;CNLiveIndicatorTableViewCell&quot;;
370 370 [self.navigationController pushViewController:vc animated:YES];
371 371 return;
372 372 }
  373 +
373 374 CNLiveModel *model = self.data[indexPath.row];
374 375 NSDictionary *dic = [model toDictionary];
  376 +
  377 +// if ([model.videoFlag isEqualToString:@"0"]){
  378 +// //查看发布会预告
  379 +// OldArticleDetailViewController *vc = [[OldArticleDetailViewController alloc] initWithDictionary:dic];
  380 +// vc.title = dic[@"cmsColumnName"];
  381 +// vc.hidesBottomBarWhenPushed = YES;
  382 +// [self.navigationController pushViewController:vc animated:YES];
  383 +// return;
  384 +// }
  385 +
375 386 VideoPlayBackViewController *vc = [[VideoPlayBackViewController alloc] initWithDictionary:dic];
376   -// OldVideoDetailViewController *vc = [[VideoPlayBackViewController alloc] initWithDictionary:dic];
377 387 vc.title = model.cmsColumnName;
378 388 vc.hidesBottomBarWhenPushed = YES;
379 389 [self.navigationController pushViewController:vc animated:YES];
... ... @@ -424,14 +434,14 @@ static NSString *indicatorTableViewCell = @&quot;CNLiveIndicatorTableViewCell&quot;;
424 434  
425 435 // 设置下拉刷新
426 436 MJRefreshAutoNormalFooter *footer = [MJRefreshAutoNormalFooter footerWithRefreshingTarget:self refreshingAction:@selector(loadMoreData)];
427   -// [footer setTitle:CustomStr(@"RefreshBackFooterIdleText") forState:MJRefreshStateIdle];
428   -// [footer setTitle:CustomStr(@"RefreshBackFooterPullingText") forState:MJRefreshStatePulling];
429   -// [footer setTitle:CustomStr(@"RefreshBackFooterRefreshingText") forState:MJRefreshStateRefreshing];
430   -// [footer setTitle:CustomStr(@"RefreshBackFooterNoMoreDataText") forState:MJRefreshStateNoMoreData];
431   - [footer setTitle:CustomStr(@"RefreshBackFooterNoMoreDataText") forState:MJRefreshStateIdle];
432   - [footer setTitle:CustomStr(@"RefreshBackFooterNoMoreDataText") forState:MJRefreshStatePulling];
433   - [footer setTitle:CustomStr(@"RefreshBackFooterNoMoreDataText") forState:MJRefreshStateRefreshing];
  437 + [footer setTitle:CustomStr(@"RefreshBackFooterIdleText") forState:MJRefreshStateIdle];
  438 + [footer setTitle:CustomStr(@"RefreshBackFooterPullingText") forState:MJRefreshStatePulling];
  439 + [footer setTitle:CustomStr(@"RefreshBackFooterRefreshingText") forState:MJRefreshStateRefreshing];
434 440 [footer setTitle:CustomStr(@"RefreshBackFooterNoMoreDataText") forState:MJRefreshStateNoMoreData];
  441 +// [footer setTitle:CustomStr(@"RefreshBackFooterNoMoreDataText") forState:MJRefreshStateIdle];
  442 +// [footer setTitle:CustomStr(@"RefreshBackFooterNoMoreDataText") forState:MJRefreshStatePulling];
  443 +// [footer setTitle:CustomStr(@"RefreshBackFooterNoMoreDataText") forState:MJRefreshStateRefreshing];
  444 +// [footer setTitle:CustomStr(@"RefreshBackFooterNoMoreDataText") forState:MJRefreshStateNoMoreData];
435 445 _tableView.mj_footer = footer;
436 446  
437 447 }
... ...
CNLiveScioLive/Pages/Live/Controller/GraphicLiveViewController.m
... ... @@ -513,6 +513,7 @@
513 513 _webView.hidden = YES;
514 514 }
515 515 }
  516 +
516 517 - (void)relatedInfoTaped:(id)sender {
517 518 UIButton *btn = (UIButton *)sender;
518 519 NSDictionary *dic = self.relatedArray[btn.tag - 1000];
... ... @@ -522,15 +523,18 @@
522 523 vc.hidesBottomBarWhenPushed = YES;
523 524 [self.navigationController pushViewController:vc animated:YES];
524 525 }
  526 +
525 527 - (void)didReceiveMemoryWarning {
526 528 [super didReceiveMemoryWarning];
527 529 }
  530 +
528 531 - (BOOL)shouldAutorotate {
529 532 if (!isPlay) {
530 533 return [[[NSUserDefaults standardUserDefaults] objectForKey:@"GraphicLive_DidLockScreen"] boolValue];
531 534 }
532 535 return ![[[NSUserDefaults standardUserDefaults] objectForKey:@"ZXVideoPlayer_DidLockScreen"] boolValue];
533 536 }
  537 +
534 538 - (UIInterfaceOrientationMask)supportedInterfaceOrientations {
535 539 return UIInterfaceOrientationMaskAllButUpsideDown;
536 540 }
... ...
CNLiveScioLive/Pages/Live/Controller/VideoPlayBackViewController.m
... ... @@ -12,7 +12,7 @@
12 12 //#import "ArticleDetailViewController.h"
13 13 //#import "OldVideoDetailViewController.h"
14 14  
15   -@interface VideoPlayBackViewController () {
  15 +@interface VideoPlayBackViewController ()<CNLivePlayerControllerDelegate> {
16 16 BOOL isPlay;
17 17 }
18 18  
... ... @@ -35,14 +35,17 @@
35 35 }
36 36 url = [url stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];
37 37 movieUrl = [NSURL URLWithString:url];
38   -
  38 + videoHeight = MainScreenWidth * (9.0 / 16.0);
  39 +
39 40 } else {
40 41 isPlay = NO;
  42 + videoHeight = MainScreenWidth * (9.0 / 16.0);
  43 +
41 44 }
42 45  
43 46 } else {
44 47 isPlay = NO;
45   -
  48 + videoHeight = 0;
46 49 }
47 50  
48 51 NSLog(@"movieUrl -> %@",movieUrl);
... ... @@ -226,6 +229,22 @@
226 229 - (void)viewWillAppear:(BOOL)animated {
227 230 [super viewWillAppear:animated];
228 231 [[JGMusicManager shareMusicManager] playStop];
  232 +// if ([_dictionary[@"videoFlag"] isEqualToString:@"0"]) {
  233 +// self.navigationController.navigationBar.barTintColor = Color_Blue;
  234 +// self.navigationController.navigationBar.titleTextAttributes = @{NSForegroundColorAttributeName:[UIColor whiteColor], NSFontAttributeName:[UIFont systemFontOfSize:18]};
  235 +// //左
  236 +// UIButton *headerButton = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 20, 44)];
  237 +// headerButton.layer.cornerRadius = 2.0;
  238 +// headerButton.layer.masksToBounds = true;
  239 +// [headerButton setImage:[UIImage imageNamed:@"cnlive_white_back"] forState:UIControlStateNormal];
  240 +// [headerButton addTarget:self action:@selector(Pop:) forControlEvents:UIControlEventTouchUpInside];
  241 +// self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:headerButton];
  242 +// self.navigationItem.title = _dictionary[@"cmsColumnName"];
  243 +//
  244 +// }else{
  245 +// [self.navigationController setNavigationBarHidden:YES];
  246 +//
  247 +// }
229 248 [self.navigationController setNavigationBarHidden:YES];
230 249  
231 250 NSError *error = nil;
... ... @@ -308,7 +327,7 @@
308 327 - (void)loadMovieView {
309 328 [[NSUserDefaults standardUserDefaults] setObject:@0 forKey:@"GraphicLive_DidLockScreen"];
310 329 imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, iPhoneX ? 44 : 0, MainScreenWidth, videoHeight)];
311   - [imageView sd_setImageWithURL:[NSURL URLWithString:_dictionary[@"poster"]] placeholderImage:[UIImage imageNamed:@"cnlive_placeholder"]];
  330 + [imageView sd_setImageWithURL:[NSURL URLWithString:_dictionary[@"img"]] placeholderImage:[UIImage imageNamed:@"cnlive_placeholder"]];
312 331 [self.view addSubview:imageView];
313 332  
314 333 UIButton *backButton = [UIButton buttonWithType:UIButtonTypeCustom];
... ... @@ -329,6 +348,7 @@
329 348 strongSelf.videoController = nil;
330 349 [strongSelf Pop:nil];
331 350 };
  351 + self.liveController.delegate = self;
332 352 [self.videoController showInView:self.view];
333 353 }
334 354 ZXVideo *video = [[ZXVideo alloc] init];
... ... @@ -362,6 +382,8 @@
362 382 strongSelf.liveController = nil;
363 383 [strongSelf Pop:nil];
364 384 };
  385 + self.liveController.delegate = self;
  386 +
365 387 }
366 388 ZXVideo *video = [[ZXVideo alloc] init];
367 389 video.title = _dictionary[@"title"];
... ... @@ -510,7 +532,63 @@
510 532 }
511 533 }
512 534 - (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error{
  535 +
513 536 }
  537 +
  538 +- (void)shareButtonCNLivePlayerController:(CNLivePlayerController *)view{
  539 + NSString *img = [NSString stringWithFormat:@"%@",_dictionary[@"img"]];
  540 + NSArray* imageArray = nil;
  541 + if (0 == [img length]) {
  542 + imageArray = @[[UIImage imageNamed:@"cnlive_zhouxin_icon"]];
  543 + } else {
  544 + imageArray = @[img];
  545 + }
  546 + if (imageArray) {
  547 + NSString *text = [NSString stringWithFormat:@"%@",_dictionary[@"subTitle"]];
  548 + if ([text isEqualToString:@"<null>"]) {
  549 + text = _dictionary[@"title"];
  550 + }
  551 + NSMutableDictionary *shareParams = [NSMutableDictionary dictionary];
  552 + [shareParams SSDKSetupShareParamsByText:text
  553 + images:imageArray
  554 + url:[NSURL URLWithString:_dictionary[@"pageUrl"]]
  555 + title:_dictionary[@"title"]
  556 + type:SSDKContentTypeAuto];
  557 + //2、分享(可以弹出我们的分享菜单和编辑界面)
  558 + [ShareSDK showShareActionSheet:nil //要显示菜单的视图, iPad版中此参数作为弹出菜单的参照视图,只有传这个才可以弹出我们的分享菜单,可以传分享的按钮对象或者自己创建小的view 对象,iPhone可以传nil不会影响
  559 + items:nil
  560 + shareParams:shareParams
  561 + onShareStateChanged:^(SSDKResponseState state, SSDKPlatformType platformType, NSDictionary *userData, SSDKContentEntity *contentEntity, NSError *error, BOOL end) {
  562 +
  563 + switch (state) {
  564 + case SSDKResponseStateSuccess:
  565 + {
  566 + UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:CustomStr(@"ShareSuccess")
  567 + message:nil
  568 + delegate:nil
  569 + cancelButtonTitle:CustomStr(@"Sure")
  570 + otherButtonTitles:nil];
  571 + [alertView show];
  572 + break;
  573 + }
  574 + case SSDKResponseStateFail:
  575 + {
  576 + UIAlertView *alert = [[UIAlertView alloc] initWithTitle:CustomStr(@"ShareFailure")
  577 + message:[NSString stringWithFormat:@"%@",error]
  578 + delegate:nil
  579 + cancelButtonTitle:CustomStr(@"Sure")
  580 + otherButtonTitles:nil, nil];
  581 + [alert show];
  582 + break;
  583 + }
  584 + default:
  585 + break;
  586 + }
  587 + }
  588 + ];}
  589 +
  590 +}
  591 +
514 592 - (void)loadRelatedInformation {
515 593 if (![[Reachability reachabilityForInternetConnection] currentReachabilityStatus]) {
516 594 [AlertViewTool showHUDViewText:CustomStr(@"NetworkiInterruption")];
... ...
CNLiveScioLive/Pages/Tools/CNLivePlayer/CNLivePlayerController.m
No preview for this file type
CNLiveScioLive/Pages/Tools/ZXVideoPlayer/Classes/ZXVideoPlayerControlView.m
... ... @@ -53,8 +53,8 @@ static const CGFloat kVideoControlBarAutoFadeOutTimeInterval = 5.0;
53 53 // 直播状态
54 54 [self addSubview:self.anchorLabel];
55 55 // 重试按钮
56   - [self addSubview:self.retryButton];
57   - self.retryButton.hidden = YES;
  56 +// [self addSubview:self.retryButton];
  57 +// self.retryButton.hidden = YES;
58 58  
59 59 // 返回按钮
60 60 [self.topBar addSubview:self.backButton];
... ...