| | |
| | | #import "AppDelegate.h" |
| | | |
| | | #import "XYRDetailViewController.h" |
| | | #import "PPTVController.h" |
| | | #import "XYRVideoDetailModel.h" |
| | | #import "UIImageView+WebCache.h" |
| | | |
| | |
| | | [self addTitleBackView]; |
| | | //加载视频详情页面的数据 |
| | | [self getVideoDetailViewWithMovieId:self.Model.Id WithThirdType:self.Model.ThirdType WithResourceId:nil]; |
| | | |
| | | if ([YTHsharedManger startManger].ad[@"videoDetailFullVideo"] && [[YTHsharedManger startManger].ad[@"videoDetailFullVideo"] isEqualToString:@"csj"]) { |
| | | [self loadFullscreenVideoAd]; |
| | | } |
| | | } |
| | | |
| | | - (void)loadFullscreenVideoAd { |
| | |
| | | return UIInterfaceOrientationPortrait; |
| | | } |
| | | |
| | | - (UIViewController *)fetchCurrentViewController { |
| | | UIViewController* currentViewController = [UIApplication sharedApplication].keyWindow.rootViewController; |
| | | BOOL runLoopFind = YES; |
| | | while (runLoopFind) { |
| | | if (currentViewController.presentedViewController) { |
| | | currentViewController = currentViewController.presentedViewController; |
| | | } else if ([currentViewController isKindOfClass:[UINavigationController class]]) { |
| | | UINavigationController* navigationController = (UINavigationController* )currentViewController; |
| | | currentViewController = [navigationController.childViewControllers lastObject]; |
| | | } else if ([currentViewController isKindOfClass:[UITabBarController class]]) { |
| | | UITabBarController* tabBarController = (UITabBarController* )currentViewController; |
| | | currentViewController = tabBarController.selectedViewController; |
| | | } else { |
| | | NSUInteger childViewControllerCount = currentViewController.childViewControllers.count; |
| | | if (childViewControllerCount > 0) { |
| | | currentViewController = currentViewController.childViewControllers.lastObject; |
| | | return currentViewController; |
| | | } else { |
| | | return currentViewController; |
| | | } |
| | | } |
| | | } |
| | | return currentViewController; |
| | | } |
| | | |
| | | /***********(以下)数据网路加载**************/ |
| | | /** |
| | | * 获取视频的详细信息并加载 |
| | |
| | | //瀑布流滑动到顶部 |
| | | [self.collectionView setContentOffset:CGPointMake(0, 0) animated:YES]; |
| | | NSDictionary *dictionaryDta = (NSDictionary *)result; |
| | | |
| | | if ([dictionaryDta[@"Data"][@"pptv"] boolValue]) { |
| | | [SVProgressHUD dismiss]; |
| | | // 拦截跳转界面 |
| | | PPTVController *vc = [[PPTVController alloc] init]; |
| | | vc.parms = dictionaryDta[@"Data"]; |
| | | vc.hidesBottomBarWhenPushed = YES; |
| | | [[YTHsharedManger startManger].preController.navigationController pushViewController:vc animated:YES]; |
| | | |
| | | [self dismissViewControllerAnimated:NO completion:^{}]; |
| | | return; |
| | | } |
| | | if ([YTHsharedManger startManger].ad[@"videoDetailFullVideo"] && [[YTHsharedManger startManger].ad[@"videoDetailFullVideo"] isEqualToString:@"csj"]) { |
| | | [self loadFullscreenVideoAd]; |
| | | } |
| | | |
| | | _DetailModel=[XYRVideoDetailModel yy_modelWithDictionary:dictionaryDta]; |
| | | //更新详情页的视频图片 |
| | | [self.image setYthImageWithURL:_DetailModel.Data.PlayPicture placeholderImage:[UIImage imageNamed:@"默认加载图片"]]; |
| | |
| | | // }]; |
| | | //} |
| | | |
| | | |
| | | |
| | | - (void)dealloc { |
| | | |
| | | |