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 | 373 | CNLiveModel *model = self.data[indexPath.row]; |
| 374 | 374 | NSDictionary *dic = [model toDictionary]; |
| 375 | 375 | VideoPlayBackViewController *vc = [[VideoPlayBackViewController alloc] initWithDictionary:dic]; |
| 376 | -// OldVideoDetailViewController *vc = [[VideoPlayBackViewController alloc] initWithDictionary:dic]; | |
| 377 | 376 | vc.title = model.cmsColumnName; |
| 378 | 377 | vc.hidesBottomBarWhenPushed = YES; |
| 379 | 378 | [self.navigationController pushViewController:vc animated:YES]; | ... | ... |
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 | |
| ... | ... | @@ -329,6 +329,7 @@ |
| 329 | 329 | strongSelf.videoController = nil; |
| 330 | 330 | [strongSelf Pop:nil]; |
| 331 | 331 | }; |
| 332 | + self.liveController.delegate = self; | |
| 332 | 333 | [self.videoController showInView:self.view]; |
| 333 | 334 | } |
| 334 | 335 | ZXVideo *video = [[ZXVideo alloc] init]; |
| ... | ... | @@ -362,6 +363,8 @@ |
| 362 | 363 | strongSelf.liveController = nil; |
| 363 | 364 | [strongSelf Pop:nil]; |
| 364 | 365 | }; |
| 366 | + self.liveController.delegate = self; | |
| 367 | + | |
| 365 | 368 | } |
| 366 | 369 | ZXVideo *video = [[ZXVideo alloc] init]; |
| 367 | 370 | video.title = _dictionary[@"title"]; |
| ... | ... | @@ -510,7 +513,63 @@ |
| 510 | 513 | } |
| 511 | 514 | } |
| 512 | 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 | 573 | - (void)loadRelatedInformation { |
| 515 | 574 | if (![[Reachability reachabilityForInternetConnection] currentReachabilityStatus]) { |
| 516 | 575 | [AlertViewTool showHUDViewText:CustomStr(@"NetworkiInterruption")]; | ... | ... |