Commit 2eb95b79f7dcb00949b57b2ff120f423e2c15d6d
1 parent
2257d52b
no message
Showing
3 changed files
with
64 additions
and
2 deletions
CNLiveScioLive/Pages/Live/Controller/CNLiveViewController.m
| @@ -373,7 +373,6 @@ static NSString *indicatorTableViewCell = @"CNLiveIndicatorTableViewCell"; | @@ -373,7 +373,6 @@ static NSString *indicatorTableViewCell = @"CNLiveIndicatorTableViewCell"; | ||
| 373 | CNLiveModel *model = self.data[indexPath.row]; | 373 | CNLiveModel *model = self.data[indexPath.row]; |
| 374 | NSDictionary *dic = [model toDictionary]; | 374 | NSDictionary *dic = [model toDictionary]; |
| 375 | VideoPlayBackViewController *vc = [[VideoPlayBackViewController alloc] initWithDictionary:dic]; | 375 | VideoPlayBackViewController *vc = [[VideoPlayBackViewController alloc] initWithDictionary:dic]; |
| 376 | -// OldVideoDetailViewController *vc = [[VideoPlayBackViewController alloc] initWithDictionary:dic]; | ||
| 377 | vc.title = model.cmsColumnName; | 376 | vc.title = model.cmsColumnName; |
| 378 | vc.hidesBottomBarWhenPushed = YES; | 377 | vc.hidesBottomBarWhenPushed = YES; |
| 379 | [self.navigationController pushViewController:vc animated:YES]; | 378 | [self.navigationController pushViewController:vc animated:YES]; |
CNLiveScioLive/Pages/Live/Controller/GraphicLiveViewController.m
| @@ -513,6 +513,7 @@ | @@ -513,6 +513,7 @@ | ||
| 513 | _webView.hidden = YES; | 513 | _webView.hidden = YES; |
| 514 | } | 514 | } |
| 515 | } | 515 | } |
| 516 | + | ||
| 516 | - (void)relatedInfoTaped:(id)sender { | 517 | - (void)relatedInfoTaped:(id)sender { |
| 517 | UIButton *btn = (UIButton *)sender; | 518 | UIButton *btn = (UIButton *)sender; |
| 518 | NSDictionary *dic = self.relatedArray[btn.tag - 1000]; | 519 | NSDictionary *dic = self.relatedArray[btn.tag - 1000]; |
| @@ -522,15 +523,18 @@ | @@ -522,15 +523,18 @@ | ||
| 522 | vc.hidesBottomBarWhenPushed = YES; | 523 | vc.hidesBottomBarWhenPushed = YES; |
| 523 | [self.navigationController pushViewController:vc animated:YES]; | 524 | [self.navigationController pushViewController:vc animated:YES]; |
| 524 | } | 525 | } |
| 526 | + | ||
| 525 | - (void)didReceiveMemoryWarning { | 527 | - (void)didReceiveMemoryWarning { |
| 526 | [super didReceiveMemoryWarning]; | 528 | [super didReceiveMemoryWarning]; |
| 527 | } | 529 | } |
| 530 | + | ||
| 528 | - (BOOL)shouldAutorotate { | 531 | - (BOOL)shouldAutorotate { |
| 529 | if (!isPlay) { | 532 | if (!isPlay) { |
| 530 | return [[[NSUserDefaults standardUserDefaults] objectForKey:@"GraphicLive_DidLockScreen"] boolValue]; | 533 | return [[[NSUserDefaults standardUserDefaults] objectForKey:@"GraphicLive_DidLockScreen"] boolValue]; |
| 531 | } | 534 | } |
| 532 | return ![[[NSUserDefaults standardUserDefaults] objectForKey:@"ZXVideoPlayer_DidLockScreen"] boolValue]; | 535 | return ![[[NSUserDefaults standardUserDefaults] objectForKey:@"ZXVideoPlayer_DidLockScreen"] boolValue]; |
| 533 | } | 536 | } |
| 537 | + | ||
| 534 | - (UIInterfaceOrientationMask)supportedInterfaceOrientations { | 538 | - (UIInterfaceOrientationMask)supportedInterfaceOrientations { |
| 535 | return UIInterfaceOrientationMaskAllButUpsideDown; | 539 | return UIInterfaceOrientationMaskAllButUpsideDown; |
| 536 | } | 540 | } |
CNLiveScioLive/Pages/Live/Controller/VideoPlayBackViewController.m
| @@ -12,7 +12,7 @@ | @@ -12,7 +12,7 @@ | ||
| 12 | //#import "ArticleDetailViewController.h" | 12 | //#import "ArticleDetailViewController.h" |
| 13 | //#import "OldVideoDetailViewController.h" | 13 | //#import "OldVideoDetailViewController.h" |
| 14 | 14 | ||
| 15 | -@interface VideoPlayBackViewController () { | 15 | +@interface VideoPlayBackViewController ()<CNLivePlayerControllerDelegate> { |
| 16 | BOOL isPlay; | 16 | BOOL isPlay; |
| 17 | } | 17 | } |
| 18 | 18 | ||
| @@ -329,6 +329,7 @@ | @@ -329,6 +329,7 @@ | ||
| 329 | strongSelf.videoController = nil; | 329 | strongSelf.videoController = nil; |
| 330 | [strongSelf Pop:nil]; | 330 | [strongSelf Pop:nil]; |
| 331 | }; | 331 | }; |
| 332 | + self.liveController.delegate = self; | ||
| 332 | [self.videoController showInView:self.view]; | 333 | [self.videoController showInView:self.view]; |
| 333 | } | 334 | } |
| 334 | ZXVideo *video = [[ZXVideo alloc] init]; | 335 | ZXVideo *video = [[ZXVideo alloc] init]; |
| @@ -362,6 +363,8 @@ | @@ -362,6 +363,8 @@ | ||
| 362 | strongSelf.liveController = nil; | 363 | strongSelf.liveController = nil; |
| 363 | [strongSelf Pop:nil]; | 364 | [strongSelf Pop:nil]; |
| 364 | }; | 365 | }; |
| 366 | + self.liveController.delegate = self; | ||
| 367 | + | ||
| 365 | } | 368 | } |
| 366 | ZXVideo *video = [[ZXVideo alloc] init]; | 369 | ZXVideo *video = [[ZXVideo alloc] init]; |
| 367 | video.title = _dictionary[@"title"]; | 370 | video.title = _dictionary[@"title"]; |
| @@ -510,7 +513,63 @@ | @@ -510,7 +513,63 @@ | ||
| 510 | } | 513 | } |
| 511 | } | 514 | } |
| 512 | - (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error{ | 515 | - (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error{ |
| 516 | + | ||
| 517 | +} | ||
| 518 | + | ||
| 519 | +- (void)shareButtonCNLivePlayerController:(CNLivePlayerController *)view{ | ||
| 520 | + NSString *img = [NSString stringWithFormat:@"%@",_dictionary[@"img"]]; | ||
| 521 | + NSArray* imageArray = nil; | ||
| 522 | + if (0 == [img length]) { | ||
| 523 | + imageArray = @[[UIImage imageNamed:@"cnlive_zhouxin_icon"]]; | ||
| 524 | + } else { | ||
| 525 | + imageArray = @[img]; | ||
| 526 | + } | ||
| 527 | + if (imageArray) { | ||
| 528 | + NSString *text = [NSString stringWithFormat:@"%@",_dictionary[@"subTitle"]]; | ||
| 529 | + if ([text isEqualToString:@"<null>"]) { | ||
| 530 | + text = _dictionary[@"title"]; | ||
| 531 | + } | ||
| 532 | + NSMutableDictionary *shareParams = [NSMutableDictionary dictionary]; | ||
| 533 | + [shareParams SSDKSetupShareParamsByText:text | ||
| 534 | + images:imageArray | ||
| 535 | + url:[NSURL URLWithString:_dictionary[@"pageUrl"]] | ||
| 536 | + title:_dictionary[@"title"] | ||
| 537 | + type:SSDKContentTypeAuto]; | ||
| 538 | + //2、分享(可以弹出我们的分享菜单和编辑界面) | ||
| 539 | + [ShareSDK showShareActionSheet:nil //要显示菜单的视图, iPad版中此参数作为弹出菜单的参照视图,只有传这个才可以弹出我们的分享菜单,可以传分享的按钮对象或者自己创建小的view 对象,iPhone可以传nil不会影响 | ||
| 540 | + items:nil | ||
| 541 | + shareParams:shareParams | ||
| 542 | + onShareStateChanged:^(SSDKResponseState state, SSDKPlatformType platformType, NSDictionary *userData, SSDKContentEntity *contentEntity, NSError *error, BOOL end) { | ||
| 543 | + | ||
| 544 | + switch (state) { | ||
| 545 | + case SSDKResponseStateSuccess: | ||
| 546 | + { | ||
| 547 | + UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:CustomStr(@"ShareSuccess") | ||
| 548 | + message:nil | ||
| 549 | + delegate:nil | ||
| 550 | + cancelButtonTitle:CustomStr(@"Sure") | ||
| 551 | + otherButtonTitles:nil]; | ||
| 552 | + [alertView show]; | ||
| 553 | + break; | ||
| 554 | + } | ||
| 555 | + case SSDKResponseStateFail: | ||
| 556 | + { | ||
| 557 | + UIAlertView *alert = [[UIAlertView alloc] initWithTitle:CustomStr(@"ShareFailure") | ||
| 558 | + message:[NSString stringWithFormat:@"%@",error] | ||
| 559 | + delegate:nil | ||
| 560 | + cancelButtonTitle:CustomStr(@"Sure") | ||
| 561 | + otherButtonTitles:nil, nil]; | ||
| 562 | + [alert show]; | ||
| 563 | + break; | ||
| 564 | + } | ||
| 565 | + default: | ||
| 566 | + break; | ||
| 567 | + } | ||
| 568 | + } | ||
| 569 | + ];} | ||
| 570 | + | ||
| 513 | } | 571 | } |
| 572 | + | ||
| 514 | - (void)loadRelatedInformation { | 573 | - (void)loadRelatedInformation { |
| 515 | if (![[Reachability reachabilityForInternetConnection] currentReachabilityStatus]) { | 574 | if (![[Reachability reachabilityForInternetConnection] currentReachabilityStatus]) { |
| 516 | [AlertViewTool showHUDViewText:CustomStr(@"NetworkiInterruption")]; | 575 | [AlertViewTool showHUDViewText:CustomStr(@"NetworkiInterruption")]; |