From 94217b294ccd75a34787eb04d6e273e99536e45b Mon Sep 17 00:00:00 2001
From: 重庆迈尖科技有限公司
Date: 星期三, 30 一月 2019 15:12:32 +0800
Subject: [PATCH] no message

---
 BuWanVideo2.0/XYRDetailViewController.m |  672 +++++++++++++++++++++++--------------------------------
 1 files changed, 284 insertions(+), 388 deletions(-)

diff --git a/BuWanVideo2.0/XYRDetailViewController.m b/BuWanVideo2.0/XYRDetailViewController.m
index 54cb74e..54300fa 100755
--- a/BuWanVideo2.0/XYRDetailViewController.m
+++ b/BuWanVideo2.0/XYRDetailViewController.m
@@ -46,12 +46,12 @@
 #import "GDTMobBannerView.h"
 
 //浼橀叿鎾斁鍣�
-#import "YTEngineOpenViewManager.h"
-#import "YYMediaPlayerEvents.h"
+//#import "YTEngineOpenViewManager.h"
+//#import "YYMediaPlayerEvents.h"
 
 //PPTV鎾斁鍣ㄥ鍏�
-#import "PPTVview.h"
-#import <PPTVSdk/PPTVSdk.h>
+//#import "PPTVview.h"
+//#import <PPTVSdk/PPTVSdk.h>
 
 #import "LGLAlertView.h"
 
@@ -64,7 +64,7 @@
 #define BETWEEN_BOUND_FULL 100
 #define BETWEEN_BOUND_NORMAL 20
 
-@interface XYRDetailViewController ()<CMuneBarDelegate,UIScrollViewDelegate,UICollectionViewDelegate,UICollectionViewDataSource,UICollectionViewDelegateFlowLayout,YYMediaPlayerEvents,UITableViewDelegate,UITableViewDataSource,UITextFieldDelegate,YTHNetDelegateRecommend,UIGestureRecognizerDelegate,YTHBacktoApplicationsDelegate,GDTNativeAdDelegate,GDTMobBannerViewDelegate,HXEasyCustomShareViewDelegate>{
+@interface XYRDetailViewController ()<CMuneBarDelegate,UIScrollViewDelegate,UICollectionViewDelegate,UICollectionViewDataSource,UICollectionViewDelegateFlowLayout,UITableViewDelegate,UITableViewDataSource,UITextFieldDelegate,YTHNetDelegateRecommend,UIGestureRecognizerDelegate,YTHBacktoApplicationsDelegate,GDTNativeAdDelegate,GDTMobBannerViewDelegate,HXEasyCustomShareViewDelegate>{
     int _gather;//闆嗘暟鍔犺浇鏇村鐨勬帶鍒跺彉閲忥紝榛樿涓�1
     int isCollectNum;//褰撳墠閫変腑鐨勯泦
     
@@ -97,7 +97,7 @@
 @property (weak, nonatomic) IBOutlet UIButton *playBtn;//鎾斁鎸夐挳
 
 @property (weak, nonatomic) IBOutlet UIButton *backBtn;//璇︽儏椤甸潰鐨勮繑鍥炴寜閽�
-@property (weak, nonatomic) IBOutlet UIImageView *image;//椤堕儴瑙嗛鍥剧墖
+@property (weak, nonatomic) IBOutlet YYAnimatedImageView *image;//椤堕儴瑙嗛鍥剧墖
 @property (weak, nonatomic) IBOutlet UILabel *detailTitle;//椤堕儴鐨勬爣棰�
 @property (weak, nonatomic) IBOutlet UILabel *detailTitleBackgroundColor;//椤堕儴鏍囬鑳屾櫙
 @property (weak, nonatomic) IBOutlet UIButton *backgroundButton;//瑕嗙洊鍦ㄥご鍥剧墖鐨凚utton锛屽搷搴旀挱鏀句簨浠�
@@ -120,14 +120,14 @@
 @property (nonatomic,strong) NSArray *PeopleSeeVideo;//鑾峰彇鍒扮殑澶у閮藉湪鐪嬬殑鏁版嵁
 
 //浼橀叿鐨勪笁涓睘鎬э細
-@property (nonatomic, retain) YTEngineOpenViewManager *viewManager;
-@property (nonatomic, strong) YYMediaPlayer *cloudPlayer;
+//@property (nonatomic, retain) YTEngineOpenViewManager *viewManager;
+//@property (nonatomic, strong) YYMediaPlayer *cloudPlayer;
 @property (nonatomic, retain) UIButton *backButton;
 @property (nonatomic, retain) UITextView *textView;
 @property (nonatomic, assign) BOOL YKloadSuccess;    //浼橀叿鍒涘缓鎴愬姛
 
 //PPTV
-@property (nonatomic, strong) PPTVview *pptvview;
+//@property (nonatomic, strong) PPTVview *pptvview;
 @property (nonatomic, assign) BOOL isPPTVSuccess;     //PPTV鍒涘缓鎴愬姛
 @property (nonatomic, strong) UIButton *collectionbt; //澶栭儴鏀惰棌鎸夐挳
 @property (nonatomic, strong) NSString *showurl;      //PPTV鏉ユ簮
@@ -137,7 +137,7 @@
 @end
 
 @implementation XYRDetailViewController
-@synthesize player = _player;
+//@synthesize player = _player;
 @synthesize islocal;
 @synthesize videoItem;
 
@@ -149,6 +149,14 @@
     ApplicationDelegate.YNetdelegateRecommend = self;
     //瀹炵幇鍑哄幓搴旂敤鎴栬�呭洖鍒板簲鐢ㄧ殑澶勭悊
     ApplicationDelegate.YBackAppDelegate = self;
+    if (KIsiPhoneX) {
+//        self.topLayout.constant = 20;
+        self.backLayout.constant = 39;
+    }else{
+//        self.topLayout.constant = 0;
+        self.backLayout.constant = 19;
+
+    }
     //鍔犺浇鍩虹鏁版嵁
     [self loadData];
     //瑙嗛鍚嶇О鑳屾櫙鑹�
@@ -198,6 +206,7 @@
  */
 - (IBAction)backToMainViewController:(id)sender {
     [self backToRootView];
+    
 }
 
 
@@ -212,29 +221,40 @@
  *  @param sender 鏀惰棌鎸夐挳
  */
 - (void)ClickCollection:(UIButton *)sender {
-    if (sender.isSelected) {
-        [sender setSelected:NO];
-        [[YTHNetInterface startInterface] getScoreCollectWithUid:[YTHsharedManger startManger].Uid withId:self.Model.Id withThirdType:self.Model.ThirdType WithType:@"0" withSystem:@"1" withBlock:^(BOOL isSuccessful, id result, NSString *error) {
-            if (isSuccessful) {
-                if([self.NewResource intValue]==16){
-                    [_pptvview SuccessCollection:NO]; //閫氱煡PPTV鎾斁鍣ㄦ敹钘�
+    if([[NSUserDefaults standardUserDefaults] boolForKey:@"userOnLine"]){
+        if (sender.isSelected) {
+            [sender setSelected:NO];
+            [[YTHNetInterface startInterface] getScoreCollectWithUid:[YTHsharedManger startManger].Uid withId:self.Model.Id withThirdType:self.Model.ThirdType WithType:@"0" withSystem:@"1" withBlock:^(BOOL isSuccessful, id result, NSString *error) {
+                if (isSuccessful) {
+                    if([self.NewResource intValue]==16){
+                        //                    [_pptvview SuccessCollection:NO]; //閫氱煡PPTV鎾斁鍣ㄦ敹钘�
+                    }
+                }else{//鍙栨秷鏀惰棌澶辫触
+                    [sender setSelected:YES];
                 }
-            }else{//鍙栨秷鏀惰棌澶辫触
-                [sender setSelected:YES];
-            }
-        }];
+            }];
+        }else{
+            [sender setSelected:YES];
+            [[YTHNetInterface startInterface] getScoreCollectWithUid:[YTHsharedManger startManger].Uid withId:self.Model.Id withThirdType:self.Model.ThirdType WithType:@"1" withSystem:@"1" withBlock:^(BOOL isSuccessful, id result, NSString *error) {
+                if (isSuccessful) {
+                    if([self.NewResource intValue]==16){
+                        //                    [_pptvview SuccessCollection:YES];  //閫氱煡PPTV鎾斁鍣ㄦ敹钘�
+                    }
+                }else{//鏀惰棌澶辫触
+                    [sender setSelected:NO];
+                }
+            }];
+        }
     }else{
-        [sender setSelected:YES];
-        [[YTHNetInterface startInterface] getScoreCollectWithUid:[YTHsharedManger startManger].Uid withId:self.Model.Id withThirdType:self.Model.ThirdType WithType:@"1" withSystem:@"1" withBlock:^(BOOL isSuccessful, id result, NSString *error) {
-            if (isSuccessful) {
-                if([self.NewResource intValue]==16){
-                    [_pptvview SuccessCollection:YES];  //閫氱煡PPTV鎾斁鍣ㄦ敹钘�
-                }
-            }else{//鏀惰棌澶辫触
-                [sender setSelected:NO];
-            }
+        //鏈櫥褰曪紝寮曞鐢ㄦ埛鐧诲綍
+        LoggingViewController *loginVC=[[LoggingViewController alloc] init];
+        loginVC.ispresent=YES;
+        [self presentViewController:loginVC animated:YES completion:^{
+            
         }];
+        
     }
+    
 }
 
 
@@ -431,7 +451,7 @@
     NSMutableArray *arr=[[NSMutableArray alloc] initWithCapacity:(_DetailModel.Data.ResourceList.count+5)];
     NSArray *ResourceList=[[NSMutableArray alloc] initWithArray:_DetailModel.Data.ResourceList];
     for (int i=0; i<_DetailModel.Data.ResourceList.count; i++) {
-        arr[i]=[ResourceList[i] objectForKey:@"Name"];
+        arr[i]=[ResourceList[i] objectForKey:@"Picture"];
         if ([[ResourceList[i] objectForKey:@"Checked"] intValue]==1) {
             self.NewResource=[ResourceList[i] objectForKey:@"Id"];
             //浜ゆ崲鏁扮粍鍏冪礌锛岃榛樿鐨勬挱鏀炬簮鏀惧湪绗竴涓�
@@ -453,7 +473,7 @@
         [_MuneBar setUserInteractionEnabled:YES];
         _MuneBar.delegate = self;
         _MuneBar.center = CGPointMake(((KScreenW/3)-80)/2, 22);
-        
+        [self.collectionView bringSubviewToFront:_MuneBar];
 //        [self.collectionView reloadSections:[NSIndexSet indexSetWithIndex:0]];
         [self.collectionView reloadData];
 
@@ -461,9 +481,10 @@
 }
 //榛樿缃戠粶鎯呭喌
 - (void)NetWorkStuas{
+
     switch ([YTHsharedManger startManger].NetworkStatus) {
         case 0:{//褰撳墠缃戠粶涓嶅彲鐢�
-            UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"鎻愮ず"message:@"褰撳墠缃戠粶涓嶅彲鐢紝鏄惁杩炴帴缃戠粶锛�"preferredStyle:UIAlertControllerStyleAlert];
+            UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"鎻愮ず"message:@"褰撳墠缃戠粶涓嶅彲鐢紝鏄惁浣跨敤杩炴帴缃戠粶锛�"preferredStyle:UIAlertControllerStyleAlert];
             //鍙栨秷
             [alert addAction:[UIAlertAction actionWithTitle:@"鍙栨秷" style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) {
                 [self backToRootView];
@@ -472,8 +493,8 @@
                 }];
             }]];
             //鍘昏繛鎺ョ綉缁�
-            [alert addAction:[UIAlertAction actionWithTitle:@"杩炴帴鍏嶈垂缃戠粶" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
-                [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"prefs:root=WIFI"]];
+            [alert addAction:[UIAlertAction actionWithTitle:@"杩炴帴缃戠粶" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
+                [[UIApplication sharedApplication]openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString] ];
                 [alert dismissViewControllerAnimated:YES completion:^{
                     
                 }];
@@ -484,19 +505,22 @@
         }
             break;
         case 1:{//绉诲姩缃戠粶
-            UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"璀﹀憡"message:@"褰撳墠缃戠粶涓轰粯璐圭綉缁滐紒"preferredStyle:UIAlertControllerStyleAlert];
+            static BOOL isFirst = YES;
+            if (!isFirst) {
+                return;
+            }else{
+                isFirst = NO;
+            }
+            UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"娓╅Θ鎻愮ず"message:@"鎮ㄧ洰鍓嶆病鏈夎繛鎺IFi锛屾槸鍚︿娇鐢ㄦ祦閲忕户缁鐪�" preferredStyle:UIAlertControllerStyleAlert];
             //缁х画瑙傜湅
-            [alert addAction:[UIAlertAction actionWithTitle:@"缁х画瑙傜湅" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
+            [alert addAction:[UIAlertAction actionWithTitle:@"缁х画" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
                 [alert dismissViewControllerAnimated:YES completion:^{
                     
                 }];
             }]];
             //鍘昏繛鎺ョ綉缁�
-            [alert addAction:[UIAlertAction actionWithTitle:@"杩炴帴鍏嶈垂缃戠粶" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
-                [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"prefs:root=WIFI"]];
-                [alert dismissViewControllerAnimated:YES completion:^{
-                    
-                }];
+            [alert addAction:[UIAlertAction actionWithTitle:@"鍙栨秷" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
+
             }]];
             [self presentViewController:alert animated:YES completion:^{
                 
@@ -540,13 +564,13 @@
 - (UIInterfaceOrientationMask)supportedInterfaceOrientations
 #endif
 {
-    if(_isPPTVSuccess){   //濡傛灉鏄疨PTV 鎾斁  杩斿洖鍙棆杞�
-        if(_pptvview.playoptions.isHalfScreen){
-            return UIInterfaceOrientationMaskLandscape;
-        }else{
-            return UIInterfaceOrientationMaskPortrait;
-        }
-    }
+//    if(_isPPTVSuccess){   //濡傛灉鏄疨PTV 鎾斁  杩斿洖鍙棆杞�
+//        if(_pptvview.playoptions.isHalfScreen){
+//            return UIInterfaceOrientationMaskLandscape;
+//        }else{
+//            return UIInterfaceOrientationMaskPortrait;
+//        }
+//    }
     if (self.YKloadSuccess==YES) {  //濡傛灉鍔犺浇浜嗕紭閰锋挱鏀惧櫒
         return UIInterfaceOrientationMaskAllButUpsideDown;
     }
@@ -631,8 +655,6 @@
         [Share shareAPP:self];
 }
 
-
-
 /**
  *  鐐瑰嚮鍏虫敞鎴栧彇娑堝叧娉�
  */
@@ -699,7 +721,9 @@
     NSDate *date = [NSDate date];
     NSTimeInterval seconds = [date timeIntervalSinceDate:self.startTime];
     NSLog(@"%f",seconds);
-    if (seconds < 1.5) {
+    static BOOL bor = NO;
+    if (seconds < 1.5 && bor) {
+        bor = YES;
         return;
     }
     self.startTime = date;
@@ -738,111 +762,6 @@
     }
 }
 
-/********************PPTV**************************/
-
--(void)playPPTV:(NSString*)urlstring{
-    [self PPTVclear];
-    NSString *qudao = @"2462";  //娓犻亾鍙�
-    NSInteger sdkType = 0;
-    sdkType |= DLNA_DMC;        //sdk鍐呴儴鎾斁鍣�
-    NSString *parmString = [NSString stringWithFormat:@"tunnel=%@&sdkType=%zd",qudao,sdkType];
-    _isPPTVSuccess = [[PPTVSdk sharedPPTVSdk] initializeWithUrl:nil params:parmString logPath:nil];
-    //杩涜鍒濆鍖� 杩斿洖鍊兼槸鍚︽垚鍔�
-    if(_isPPTVSuccess){
-        [SVProgressHUD show];
-        _pptvview = [[PPTVview alloc]init];
-        _pptvview.viewcontroller = self;
-        _pptvview.Brightness = [UIScreen mainScreen].brightness;
-        NSInteger sdkType = 0;
-        sdkType |= DLNA_DMC;        //sdk鍐呴儴鎾斁鍣�
-        //鎾斁鍣ㄥ唴閮ㄧ墖婧愮被鍨�
-        int VedioType;
-        if(self.DetailModel.Data.ShowType==1){//缁艰壓
-            VedioType = 1;
-        }else{//闈炵患鑹�
-            VedioType = 2;
-        }
-        //鏄惁鏀惰棌
-        BOOL Iscollection;
-        if(_collectionbt.isSelected){
-            Iscollection = YES;
-        }else{
-            Iscollection = NO;
-        }
-        //闅愯棌鎺т欢
-        [_image bringSubviewToFront:self.view];
-        _image.userInteractionEnabled = YES;
-        _backBtn.tag = 113;
-        [_pptvview initWithSid:nil WithUrl:urlstring WithVid:nil WithHisPlayTime:0 WithPlayerType:PLAYER_TYPE_VOD WithViewController:self WithFatherView:self.view WithFatherFrameView:_image WithTitleStr:_Model.Name WihtChosSet:isCollectNum-1  WithDataArray:_VideoDetailList WithType:VedioType WithIsCllection:Iscollection WithImage:self.image.image WithShowUrl:_showurl];
-        __weak typeof (self) selfweak = self;
-        
-        _pptvview.clearpptv = ^(){
-            selfweak.isPPTVSuccess = NO;
-            selfweak.image.userInteractionEnabled = NO;
-            selfweak.backgroundButton.hidden = NO;
-            selfweak.detailTitle.hidden = NO;
-        };
-        _pptvview.next = ^(){
-            if (selfweak.DetailModel.Data.ShowType==1) {   //鏄患鑹�
-                if (selfweak.VideoDetailList.count>6*_gather && isCollectNum > 6*_gather) {
-                    _gather++;
-//                    [selfweak.collectionView reloadSections:[NSIndexSet indexSetWithIndex:1]];
-                    [self.collectionView reloadData];
-
-                }
-            }else{  //涓嶆槸缁艰壓
-                if (selfweak.VideoDetailList.count>10*_gather && isCollectNum >= 10*_gather) {
-                    _gather++;
-//                    [selfweak.collectionView reloadSections:[NSIndexSet indexSetWithIndex:1]];
-                    [self.collectionView reloadData];
-
-                }
-            }
-            if(isCollectNum < selfweak.VideoDetailList.count){
-                isCollectNum += 1;
-                NSArray *arr = [selfweak.collectionView indexPathsForVisibleItems];
-                NSIndexPath * targetIndex;
-                NSIndexPath * lastIndex;
-                
-                for( int i = 0 ; i < arr.count ; ++i){
-                    NSIndexPath * temp = arr[i];
-                    if(isCollectNum-1 == temp.row ){
-                        targetIndex = temp;
-                    }else if(isCollectNum -2 == temp.row){
-                        lastIndex = temp;
-                    }
-                }
-//                [selfweak.collectionView reloadItemsAtIndexPaths:@[targetIndex,lastIndex]];
-                [_collectionView reloadData];
-
-                [selfweak PPTVplay:[NSString stringWithFormat:@"%d",isCollectNum-1] WithBoolInit:selfweak.isPPTVSuccess];
-            }
-            return isCollectNum-1;
-        };
-        
-        _pptvview.Collectioning = ^(){  //鍏ㄥ睆鏀惰棌鐐瑰嚮
-            [selfweak ClickCollection:selfweak.collectionbt];
-        };
-        
-        _pptvview.rload = ^(){
-            dispatch_async(dispatch_get_main_queue(), ^{
-                [selfweak.collectionView reloadData];
-            });
-        };
-        
-        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(selfchose:) name:@"selfchose" object:nil];
-        
-        [_pptvview initPlayInfo];
-    }
-    
-    //鎺т欢闅愯棌澶勭悊
-    _backgroundButton.hidden = YES;
-    _detailTitle.hidden = YES;
-    _backBtn.hidden = NO;
-    [_backBtn bringSubviewToFront:self.view];
-    _playBtn.hidden = YES;
-}
-
 -(void)selfchose:(NSNotification*)notification{
     NSDictionary* num = [notification userInfo];
     isCollectNum = ((NSNumber*)[num objectForKey:@"index"]).intValue +1;
@@ -861,20 +780,20 @@
 }
 
 //鍦ㄥ凡鏈夌殑PPTV鎾斁鍣ㄨ繘琛屾挱鏀�
--(void)playPPTVSecend:(NSString*)urlstring{
-    [SVProgressHUD show];
-    [_pptvview playvedio:urlstring];
-    [_pptvview.playoptions.collection OtherChose:isCollectNum-1];   //鎾斁鍣ㄥ唴閮ㄦ樉绀哄悓姝�
-}
+//-(void)playPPTVSecend:(NSString*)urlstring{
+//    [SVProgressHUD show];
+//    [_pptvview playvedio:urlstring];
+//    [_pptvview.playoptions.collection OtherChose:isCollectNum-1];   //鎾斁鍣ㄥ唴閮ㄦ樉绀哄悓姝�
+//}
 
 
-//PPTV閫�鍑轰翰娓呴櫎
--(void)PPTVclear{
-    if(!_pptvview){
-        return ;
-    }
-    [_pptvview clear];
-}
+////PPTV閫�鍑轰翰娓呴櫎
+//-(void)PPTVclear{
+//    if(!_pptvview){
+//        return ;
+//    }
+//    [_pptvview clear];
+//}
 
 
 //PPTV鑾峰彇鏁版嵁
@@ -898,9 +817,9 @@
             
             //鍔犺浇PPTV鎾斁鍣�
             if(!BL){  //娌℃湁琚垵濮嬪寲杩�
-                [self playPPTV:urlstring];
+//                [self playPPTV:urlstring];
             }else{
-                [self playPPTVSecend:urlstring];
+//                [self playPPTVSecend:urlstring];
             }
         }else{
             NSLog(@"鑾峰彇瑙嗛鎾斁閾炬帴澶辫触%@",error);
@@ -920,7 +839,10 @@
     [SVProgressHUD showWithStatus:@"绮惧僵锛岄┈涓婂氨鏉ワ紒"];
     [_playBtn setEnabled:NO];
     [_backgroundButton setEnabled:NO];
-    Videodetaillist *lst=self.VideoDetailList[[IDS intValue]];
+    Videodetaillist *lst;
+    if ([IDS intValue] <= self.VideoDetailList.count) {
+        lst=self.VideoDetailList[[IDS intValue]];
+    }
     [[YTHNetInterface startInterface] getparseVideoUrlWithUid:[YTHsharedManger startManger].Uid WithId:[(NSDictionary *)lst objectForKey:@"Id"] WithVideoId:self.DetailModel.Data.Id WithSystem:@"1" WithType:[(NSDictionary *)lst objectForKey:@"Type"] WithResourceId:_NewResource WithEID:nil withBlock:^(BOOL isSuccessful, id result, NSString *error) {
         if (isSuccessful) {
             NSLog(@"鑾峰彇瑙嗛鎾斁閾炬帴鎴愬姛");
@@ -974,7 +896,7 @@
                 [_backgroundButton setEnabled:YES];
                 if([_NewResource intValue]==15){
                     //鍔犺浇浼橀叿鎾斁鍣�
-                    [self loadYKPlayer:urlstring];
+//                    [self loadYKPlayer:urlstring];
                 }
             }else{//绔欏鎾斁
                 NSString *urlstring=[[dictionaryDta objectForKey:@"Data"] objectForKey:@"Url"];
@@ -994,76 +916,76 @@
  *
  *  @param urlstring 鎾斁鍦板潃
  */
--(void)loadYKPlayer:(NSString *)urlstring{
-    if(_cloudPlayer==nil){
-        [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];
-        
-        _cloudPlayer = [[YYMediaPlayer alloc] init];
-        _cloudPlayer.controller = self;
-        _cloudPlayer.view.clipsToBounds = YES;
-        _cloudPlayer.fullscreen = NO;
-        _cloudPlayer.platform = @"youku";
-        
-        CGSize size = self.view.bounds.size;
-        
-        CGFloat width = 0.f;
-        if (DEVICE_TYPE_IPAD) {
-            width = 681.f;
-        } else {
-            width = KScreenWp;
-        }
-        
-        CGFloat height = width * 9.0f / 16.0f;
-        _cloudPlayer.view.frame = CGRectMake(0, 0, width, height);
-        
-        _playerFrame = CGRectMake(0, 20, size.width, size.height - 20);
-        _cloudPlayerFrame = _cloudPlayer.view.frame;
-        
-        //绔栧睆鏃堕湶鍑虹姸鎬佹爮
-        if ([[UIDevice currentDevice].systemVersion floatValue] >= 7){
-            CGRect bounds = self.view.frame;
-            self.view.bounds = bounds;
-        }
-        
-        self.MarkToTop.constant=8.0f;
-        [self.view addSubview:_cloudPlayer.view];
-        
-        [self initViews];
-        
-        [_cloudPlayer addEventsObserver:self];
-        
-        _cloudPlayer.clientId = YKCLIENTId;
-        _cloudPlayer.clientSecret = YKCLIENTSECRET;
-        
-        // 鍒濆鍖栨挱鏀惧櫒鐣岄潰绠$悊鍣�
-        _viewManager = [[YTEngineOpenViewManager alloc] initWithPlayer:_cloudPlayer];
-        [_cloudPlayer addEventsObserver:_viewManager];
-        [self.view bringSubviewToFront:self.backBtn];
-        self.YKloadSuccess=YES;
-    }
-    if (!islocal) {
-        [_cloudPlayer playVid:urlstring quality:kYYVideoQualityFLV password:nil from:0];
-    } else {
-        if (self.videoItem) {
-            [_cloudPlayer playVideo:(id<YYMediaPlayerItem>)self.videoItem quality:kYYVideoQualityFLV from:0 oldEncrypt:NO];
-        }
-    }
-}
+//-(void)loadYKPlayer:(NSString *)urlstring{
+//    if(_cloudPlayer==nil){
+//        [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];
+//
+//        _cloudPlayer = [[YYMediaPlayer alloc] init];
+//        _cloudPlayer.controller = self;
+//        _cloudPlayer.view.clipsToBounds = YES;
+//        _cloudPlayer.fullscreen = NO;
+//        _cloudPlayer.platform = @"youku";
+//
+//        CGSize size = self.view.bounds.size;
+//
+//        CGFloat width = 0.f;
+//        if (DEVICE_TYPE_IPAD) {
+//            width = 681.f;
+//        } else {
+//            width = KScreenWp;
+//        }
+//
+//        CGFloat height = width * 9.0f / 16.0f;
+//        _cloudPlayer.view.frame = CGRectMake(0, 0, width, height);
+//
+//        _playerFrame = CGRectMake(0, 20, size.width, size.height - 20);
+//        _cloudPlayerFrame = _cloudPlayer.view.frame;
+//
+//        //绔栧睆鏃堕湶鍑虹姸鎬佹爮
+//        if ([[UIDevice currentDevice].systemVersion floatValue] >= 7){
+//            CGRect bounds = self.view.frame;
+//            self.view.bounds = bounds;
+//        }
+//
+//        self.MarkToTop.constant=8.0f;
+//        [self.view addSubview:_cloudPlayer.view];
+//
+//        [self initViews];
+//
+//        [_cloudPlayer addEventsObserver:self];
+//
+//        _cloudPlayer.clientId = YKCLIENTId;
+//        _cloudPlayer.clientSecret = YKCLIENTSECRET;
+//
+//        // 鍒濆鍖栨挱鏀惧櫒鐣岄潰绠$悊鍣�
+//        _viewManager = [[YTEngineOpenViewManager alloc] initWithPlayer:_cloudPlayer];
+//        [_cloudPlayer addEventsObserver:_viewManager];
+//        [self.view bringSubviewToFront:self.backBtn];
+//        self.YKloadSuccess=YES;
+//    }
+//    if (!islocal) {
+//        [_cloudPlayer playVid:urlstring quality:kYYVideoQualityFLV password:nil from:0];
+//    } else {
+//        if (self.videoItem) {
+//            [_cloudPlayer playVideo:(id<YYMediaPlayerItem>)self.videoItem quality:kYYVideoQualityFLV from:0 oldEncrypt:NO];
+//        }
+//    }
+//}
 
 - (void)layout:(BOOL)fullscreen{
     CGFloat backHeight = _backButton.bounds.size.height;
     CGFloat y = 0;
     
     if (!fullscreen) {
-        _cloudPlayer.view.frame = _cloudPlayerFrame;
+//        _cloudPlayer.view.frame = _cloudPlayerFrame;
         y = (44 - backHeight) / 2;
         _backButton.frame = CGRectMake(MARGIN, y , BACK_WIDTH, backHeight);
     } else {
-        _cloudPlayer.view.frame = self.view.frame;
+//        _cloudPlayer.view.frame = self.view.frame;
         y = (30 - backHeight) / 2 + 20;
         _backButton.frame = CGRectMake(MARGIN, y, BACK_WIDTH, _backButton.bounds.size.height);
     }
-    _textView.frame = CGRectMake(_cloudPlayer.view.center.x - TEXTVIEW_WIDTH/2, _cloudPlayer.view.center.y - TEXTVIEW_HEIGHT/2, TEXTVIEW_WIDTH, TEXTVIEW_HEIGHT);
+//    _textView.frame = CGRectMake(_cloudPlayer.view.center.x - TEXTVIEW_WIDTH/2, _cloudPlayer.view.center.y - TEXTVIEW_HEIGHT/2, TEXTVIEW_WIDTH, TEXTVIEW_HEIGHT);
 }
 
 - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)orien{
@@ -1093,9 +1015,9 @@
     _textView.font = [UIFont systemFontOfSize:TEXTVIEW_FONT];
     _textView.editable = NO;
     _textView.userInteractionEnabled = NO;
-    _textView.frame = CGRectMake(_cloudPlayer.view.center.x - TEXTVIEW_WIDTH/2,_cloudPlayer.view.center.y - TEXTVIEW_HEIGHT/2, TEXTVIEW_WIDTH, TEXTVIEW_HEIGHT);
+//    _textView.frame = CGRectMake(_cloudPlayer.view.center.x - TEXTVIEW_WIDTH/2,_cloudPlayer.view.center.y - TEXTVIEW_HEIGHT/2, TEXTVIEW_WIDTH, TEXTVIEW_HEIGHT);
     [_textView setTextAlignment:NSTextAlignmentCenter];
-    [_cloudPlayer.view addSubview:_textView];
+//    [_cloudPlayer.view addSubview:_textView];
 }
 
 /**
@@ -1128,11 +1050,11 @@
     if (!DEVICE_TYPE_IPAD) {
         if (orien == UIInterfaceOrientationPortrait &&
             self.interfaceOrientation != orien) {
-            [_cloudPlayer setFullscreen:NO];
+//            [_cloudPlayer setFullscreen:NO];
         } else if (UIInterfaceOrientationIsLandscape(orien)) {
             UIInterfaceOrientation corien = self.interfaceOrientation;
             if (!UIInterfaceOrientationIsLandscape(corien)) {
-                [_cloudPlayer setFullscreen:YES];
+//                [_cloudPlayer setFullscreen:YES];
             }
         }
     }
@@ -1172,53 +1094,53 @@
 /**
  *  浼橀叿鎾斁鍣ㄦ柟娉�
  */
-- (void)endPlayCode:(YYErrorCode)err{
-    NSString *tip;
-    switch (err) {
-        case YYPlayCompleted:
-            tip = @"璇ヨ棰戝凡鎾斁瀹屾垚锛岀偣鍑婚噸鏂版挱鏀�";
-            _textView.text = tip;
-            break;
-        case YYPlayCanceled:
-            break;
-        case YYErrorClientFormat:
-            tip = [NSString stringWithFormat:@"client鍙傛暟鏍煎紡閿欒锛岄敊璇爜锛�%ld", (long)err];
-            _textView.text = tip;
-            break;
-        case YYErrorInvalidClient:
-            tip = [NSString stringWithFormat:@"client鏃犳晥鎴杝dk鐗堟湰杩囦綆锛岄敊璇爜锛�%ld", (long)err];
-            _textView.text = tip;
-            break;
-        case YYErrorPermissionDeny:
-            tip = [NSString stringWithFormat:@"瑙嗛鏃犳潈闄愭挱鏀撅紝閿欒鐮侊細%ld", (long)err];
-            _textView.text = tip;
-            break;
-        case YYErrorInitOpenView:
-            tip = [NSString stringWithFormat:@"鍒濆鍖栫晫闈㈡棤鏁堬紝閿欒鐮侊細%ld", (long)err];
-            _textView.text = tip;
-            break;
-        case YYDataSourceError:
-            tip = [NSString stringWithFormat:@"濯掍綋鏂囦欢閿欒,閿欒鐮侊細%ld", (long)err];
-            _textView.text = tip;
-            break;
-        case YYNetworkError:
-            tip = [NSString stringWithFormat:@"缃戠粶杩炴帴瓒呮椂锛岄敊璇爜锛�%ld, 鐐瑰嚮閲嶈瘯", (long)err];
-            _textView.text = tip;
-            break;
-        default:
-            tip = [NSString stringWithFormat:@"鎾斁鍙戠敓閿欒锛岄敊璇爜锛�%ld, 鐐瑰嚮閲嶈瘯", (long)err];
-            _textView.text = tip;
-            break;
-    }
-}
+//- (void)endPlayCode:(YYErrorCode)err{
+//    NSString *tip;
+//    switch (err) {
+//        case YYPlayCompleted:
+//            tip = @"璇ヨ棰戝凡鎾斁瀹屾垚锛岀偣鍑婚噸鏂版挱鏀�";
+//            _textView.text = tip;
+//            break;
+//        case YYPlayCanceled:
+//            break;
+//        case YYErrorClientFormat:
+//            tip = [NSString stringWithFormat:@"client鍙傛暟鏍煎紡閿欒锛岄敊璇爜锛�%ld", (long)err];
+//            _textView.text = tip;
+//            break;
+//        case YYErrorInvalidClient:
+//            tip = [NSString stringWithFormat:@"client鏃犳晥鎴杝dk鐗堟湰杩囦綆锛岄敊璇爜锛�%ld", (long)err];
+//            _textView.text = tip;
+//            break;
+//        case YYErrorPermissionDeny:
+//            tip = [NSString stringWithFormat:@"瑙嗛鏃犳潈闄愭挱鏀撅紝閿欒鐮侊細%ld", (long)err];
+//            _textView.text = tip;
+//            break;
+//        case YYErrorInitOpenView:
+//            tip = [NSString stringWithFormat:@"鍒濆鍖栫晫闈㈡棤鏁堬紝閿欒鐮侊細%ld", (long)err];
+//            _textView.text = tip;
+//            break;
+//        case YYDataSourceError:
+//            tip = [NSString stringWithFormat:@"濯掍綋鏂囦欢閿欒,閿欒鐮侊細%ld", (long)err];
+//            _textView.text = tip;
+//            break;
+//        case YYNetworkError:
+//            tip = [NSString stringWithFormat:@"缃戠粶杩炴帴瓒呮椂锛岄敊璇爜锛�%ld, 鐐瑰嚮閲嶈瘯", (long)err];
+//            _textView.text = tip;
+//            break;
+//        default:
+//            tip = [NSString stringWithFormat:@"鎾斁鍙戠敓閿欒锛岄敊璇爜锛�%ld, 鐐瑰嚮閲嶈瘯", (long)err];
+//            _textView.text = tip;
+//            break;
+//    }
+//}
 /**
  *  浼橀叿鎾斁鍣ㄦ柟娉�
  */
-- (void)startPlay {
-    if (_viewManager) {
-        _textView.hidden = YES;
-    }
-}
+//- (void)startPlay {
+//    if (_viewManager) {
+//        _textView.hidden = YES;
+//    }
+//}
 
 - (void)setNewOrientation:(BOOL)fullscreen
 {
@@ -1267,20 +1189,23 @@
  *  閫�鍑鸿鎯呴〉闈㈢殑鏂规硶
  */
 -(void)backToRootView{
-    if(_isPPTVSuccess){
-        if(_pptvview.playoptions.isHalfScreen){
-            [_pptvview FullScreen];
-            return;
-        }
-        [self PPTVclear];
-    }
-    
+//    if(_isPPTVSuccess){
+//        if(_pptvview.playoptions.isHalfScreen){
+//            [_pptvview FullScreen];
+//            return;
+//        }
+//        [self PPTVclear];
+//    }
+//
     [SVProgressHUD dismiss];
-    [self.player removeEventsObserver:_viewManager];
-    [self dismissViewControllerAnimated:YES completion:^{
-        [self.player stop];
-        [self.player deinit];
-    }];
+    self.collectionView.delegate = nil;
+    self.collectionView.dataSource = nil;
+    [self.collectionView removeFromSuperview];
+    self.collectionView = nil;
+    _nativeAd.controller = nil;
+    _nativeAd.delegate = nil;
+//    [self.player removeEventsObserver:_viewManager];
+    [self dismissViewControllerAnimated:YES completion:nil];
     //鏄剧ず鐘舵�佹爮
     [[UIApplication sharedApplication] setStatusBarHidden:NO];
 }
@@ -1312,6 +1237,7 @@
     //鎻愮ず鏁版嵁鍔犺浇
     [SVProgressHUD showWithStatus:@"鍔犺浇涓�"];
     [[YTHNetInterface startInterface] getVoideoDetailWithUid:[YTHsharedManger startManger].Uid  withLoginUid:[[NSUserDefaults standardUserDefaults] objectForKey:@"LoginUid"] withId:movieid withThirdType:thirdtype withSystem:@"1" WithResourceId:resourceId withBlock:^(BOOL isSuccessful, id result, NSString *error) {
+        NSLog(@"%@",result);
         if (isSuccessful) {
             //鐎戝竷娴佹粦鍔ㄥ埌椤堕儴
             [self.collectionView setContentOffset:CGPointMake(0, 0) animated:YES];
@@ -1347,8 +1273,7 @@
             _VideoDetailList=self.DetailModel.Data.VideoDetailList;
             //璁$畻cell鐨勫ぇ灏�
             [self CalculateHeightWithArray:_VideoDetailList];
-            //鍔犺浇瑙嗛婧�
-            [self loadResourceItem];
+
             //鍔犺浇骞垮憡
             [self loadAd];
             //鍔犺浇鐩稿叧瑙嗛
@@ -1359,12 +1284,16 @@
             [self getPeopleSeeVideowithVideoId:movieid];
             //鍔犺浇璇勮瑙嗗浘
             [self reloadCommentView];
+            //鍔犺浇瑙嗛婧�
+            [self loadResourceItem];
             //鏁版嵁鍔犺浇鎴愬姛
             [SVProgressHUD dismiss];
         }else{
             NSLog(@"%@",error);
             //鎻愮ず鐢ㄦ埛閿欒
-            [SVProgressHUD showErrorWithStatus:@"鍔犺浇澶辫触锛�"];
+            [SVProgressHUD dismiss];
+
+//            [SVProgressHUD showErrorWithStatus:@"鍔犺浇澶辫触锛�"];
             
         }
     }];
@@ -1376,7 +1305,7 @@
 -(void)SourcesSwitching:(NSInteger)index{
     [SVProgressHUD showWithStatus:@"瑙嗛婧愬垏鎹腑"];
     if(_isPPTVSuccess){
-        [self PPTVclear];
+//        [self PPTVclear];
     }
     [[YTHNetInterface startInterface] getVoideoDetailWithUid:[YTHsharedManger startManger].Uid withLoginUid:[[NSUserDefaults standardUserDefaults] objectForKey:@"LoginUid"] withId:self.Model.Id withThirdType:self.Model.ThirdType withSystem:@"1" WithResourceId:_NewResource withBlock:^(BOOL isSuccessful, id result, NSString *error) {
         if (isSuccessful) {
@@ -1390,10 +1319,10 @@
             
             //闇�瑕佽�冭檻鍒版鍦ㄦ挱鏀句紭閰疯灞忔椂锛屽鏋滃垏鎹㈢埍濂囪壓鐨勬儏鍐�
             if([_NewResource intValue]!=15){
-                [self.player.view removeFromSuperview];
-                [self.player removeEventsObserver:_viewManager];
-                [self.player stop];
-                [self.player deinit];
+//                [self.player.view removeFromSuperview];
+//                [self.player removeEventsObserver:_viewManager];
+//                [self.player stop];
+//                [self.player deinit];
                 
                 //鍙栨秷闅愯棌playBtn
                 [_playBtn setHidden:NO];
@@ -1423,14 +1352,16 @@
  *  鑱旂綉妫�鏌ユ槸鍚︽敹钘�
  */
 -(void)checkWhetherCollection{
-    [[YTHNetInterface startInterface] getIsCollectedWithUid:[YTHsharedManger startManger].Uid withId:self.Model.Id withThirdType:self.Model.ThirdType withSystem:@"1" withBlock:^(BOOL isSuccessful, id result, NSString *error) {
-        UIButton *B1=[self.view viewWithTag:321];
-        if (isSuccessful) {
-            [B1 setSelected:YES];
-        }else{
-            [B1 setSelected:NO];
-        }
-    }];
+//    if([[NSUserDefaults standardUserDefaults] boolForKey:@"userOnLine"]){
+        [[YTHNetInterface startInterface] getIsCollectedWithUid:[YTHsharedManger startManger].Uid withId:self.Model.Id withThirdType:self.Model.ThirdType withSystem:@"1" withBlock:^(BOOL isSuccessful, id result, NSString *error) {
+            UIButton *B1=[self.view viewWithTag:321];
+            if (isSuccessful) {
+                [B1 setSelected:YES];
+            }else{
+                [B1 setSelected:NO];
+            }
+        }];
+//    }
 }
 
 //鐢ㄤ簬璁$畻閫夐泦cell鐨勫ぇ灏�
@@ -1571,9 +1502,7 @@
         //濡傛灉鐢ㄦ埛鏈櫥褰�
         LoggingViewController *loginVC=[[LoggingViewController alloc] init];
         loginVC.ispresent=YES;
-        [self presentViewController:loginVC animated:YES completion:^{
-            
-        }];
+        [self presentViewController:loginVC animated:YES completion:nil];
     }
 }
 
@@ -1646,9 +1575,7 @@
             //濡傛灉鐢ㄦ埛鏈櫥褰�
             LoggingViewController *loginVC=[[LoggingViewController alloc] init];
             loginVC.ispresent=YES;
-            [self presentViewController:loginVC animated:YES completion:^{
-                
-            }];
+            [self presentViewController:loginVC animated:YES completion:nil];
         }
     }
 }
@@ -1664,46 +1591,6 @@
         [self SourcesSwitching:index];
     }
     [self.MuneBar hideItems];
-}
--(void)muneBarShow{
-    UIButton *B1=[self.view viewWithTag:321];
-    UIButton *B2=[self.view viewWithTag:322];
-    UILabel *L1=[self.view viewWithTag:331];
-    UILabel *L2=[self.view viewWithTag:332];
-    if (B1.alpha == 1) {
-        static BOOL isfirst;
-        if(!isfirst){
-            isfirst = YES;
-            B1.transform = CGAffineTransformMakeScale(1.0f, 1.0f);
-            B2.transform = CGAffineTransformMakeScale(1.0f, 1.0f);
-            L1.transform = CGAffineTransformMakeScale(1.0f, 1.0f);
-            L2.transform = CGAffineTransformMakeScale(1.0f, 1.0f);
-        }
-        [UIView beginAnimations:nil context:UIGraphicsGetCurrentContext()];
-        [UIView setAnimationDuration:0.5];
-        B1.transform=CGAffineTransformMakeScale(0.01f, 0.01f);
-        B2.transform=CGAffineTransformMakeScale(0.01f, 0.01f);
-        L1.transform=CGAffineTransformMakeScale(0.01f, 0.01f);
-        L2.transform=CGAffineTransformMakeScale(0.01f, 0.01f);
-        
-        B1.alpha=0;
-        
-        [UIView commitAnimations];
-    }else{
-        [UIView beginAnimations:nil context:UIGraphicsGetCurrentContext()];
-        [UIView setAnimationDuration:0.5];
-        B1.transform=CGAffineTransformMakeScale(1.0f, 1.0f);
-        B2.transform=CGAffineTransformMakeScale(1.0f, 1.0f);
-        L1.transform=CGAffineTransformMakeScale(1.0f, 1.0f);
-        L2.transform=CGAffineTransformMakeScale(1.0f, 1.0f);
-        
-        B1.alpha=1;
-        [UIView commitAnimations];
-    }
-}
-//灏界娌℃湁鐢紝浣嗘槸蹇呴』瑕佸啓锛屼笉鐒秏uneBarShow鏂规硶涓嶄細璧�
--(void)muneBarHide{
-    
 }
 
 #pragma mark - UIScrollViewDelegate
@@ -1762,12 +1649,12 @@
         }
         isCollectNum=(int)indexPath.row +1;
         if(lastIndex.row == 0 || indexPath.row == 0 || !lastIndex){ //鍦╥phone6浠ヤ笂鍒锋柊row==0鏃舵棤鏁堢殑鐗规畩澶勭悊
-//            [_collectionView reloadSections:[NSIndexSet indexSetWithIndex:1]];
-            [self.collectionView reloadData];
+            [_collectionView reloadSections:[NSIndexSet indexSetWithIndex:1]];
+//            [self.collectionView reloadData];
 
         }else{
-//            [_collectionView reloadItemsAtIndexPaths:indexPatharr];
-            [_collectionView reloadData];
+            [_collectionView reloadItemsAtIndexPaths:indexPatharr];
+//            [_collectionView reloadData];
 
         }
         
@@ -1784,15 +1671,15 @@
         
     }else{
         if(_isPPTVSuccess){   //娓呯┖pptv杩涜杞崲
-            [self PPTVclear];
+//            [self PPTVclear];
             _isPPTVSuccess = NO;
         }
         
         //鑰冭檻鍒版鍦ㄦ挱鏀句紭閰疯棰戯紝鍒囨崲鍒扮埍濂囪壓璧勬簮锛屾墍浠ヨ鍋氫竴娆$Щ闄や紭閰锋挱鏀惧櫒鐨勬搷浣�
-        [self.player.view removeFromSuperview];
-        [self.player removeEventsObserver:_viewManager];
-        [self.player stop];
-        [self.player deinit];
+//        [self.player.view removeFromSuperview];
+//        [self.player removeEventsObserver:_viewManager];
+//        [self.player stop];
+//        [self.player deinit];
         //鍙栨秷闅愯棌playBtn
         [_playBtn setHidden:NO];
         [_backgroundButton setEnabled:NO];
@@ -1976,10 +1863,7 @@
         case 0:{
             if (kind == UICollectionElementKindSectionHeader){
                 titleCollectionReusableView *titleCollectionReusableView = [collectionView dequeueReusableSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:@"titleCollectionReusableViewID" forIndexPath:indexPath];
-                //鍔犺浇瑙嗛婧愯鍥�
-                if (_MuneBar!=nil) {
-                    [titleCollectionReusableView.resourceSelectionView addSubview:self.MuneBar];
-                }
+      
                 //娣诲姞鏀惰棌鐨勭偣鍑讳簨浠�
                 [titleCollectionReusableView.collectionBtn addTarget:self action:@selector(ClickCollection:) forControlEvents:UIControlEventTouchUpInside];
                 _collectionbt = titleCollectionReusableView.collectionBtn;
@@ -1987,6 +1871,10 @@
                 [titleCollectionReusableView.shareBtn addTarget:self action:@selector(clickShareButton:) forControlEvents:UIControlEventTouchUpInside];
                 //鑱旂綉妫�鏌ユ槸鍚︽敹钘�
                 [self checkWhetherCollection];
+                //鍔犺浇瑙嗛婧愯鍥�
+                if (_MuneBar!=nil) {
+                    [titleCollectionReusableView.resourceSelectionView addSubview:self.MuneBar];
+                }
                 
                 return titleCollectionReusableView;
             }else if(kind == UICollectionElementKindSectionFooter){
@@ -2308,9 +2196,11 @@
  *  0 . 涓嶅彲鐢�   1. 绉诲姩缃戠粶   2.wifi   3.褰撳墠缃戠粶鏈煡
  */
 - (void)updateNet:(NSInteger )status{
+
     switch (status) {
+            
         case 0:{//褰撳墠缃戠粶涓嶅彲鐢�
-            UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"鎻愮ず"message:@"褰撳墠缃戠粶涓嶅彲鐢紝鏄惁杩炴帴缃戠粶锛�"preferredStyle:UIAlertControllerStyleAlert];
+            UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"娓╅Θ鎻愮ず"message:@"褰撳墠缃戠粶涓嶅彲鐢紝鏄惁杩炴帴缃戠粶锛�"preferredStyle:UIAlertControllerStyleAlert];
             //鍙栨秷
             [alert addAction:[UIAlertAction actionWithTitle:@"鍙栨秷" style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) {
                 [alert dismissViewControllerAnimated:YES completion:^{
@@ -2318,8 +2208,12 @@
                 }];
             }]];
             //鍘昏繛鎺ョ綉缁�
-            [alert addAction:[UIAlertAction actionWithTitle:@"杩炴帴鍏嶈垂缃戠粶" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
-                [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"prefs:root=WIFI"]];
+            [alert addAction:[UIAlertAction actionWithTitle:@"杩炴帴缃戠粶" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
+                if (IOS_VERSION <  8.0) {
+
+                }else{
+                    [[UIApplication sharedApplication]openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString]];
+                }
                 [alert dismissViewControllerAnimated:YES completion:^{
                     
                 }];
@@ -2330,19 +2224,16 @@
         }
             break;
         case 1:{//绉诲姩缃戠粶
-            UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"璀﹀憡"message:@"褰撳墠缃戠粶涓轰粯璐圭綉缁滐紒"preferredStyle:UIAlertControllerStyleAlert];
+            UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"娓╅Θ鎻愮ず"message:@"鎮ㄧ洰鍓嶆病鏈夎繛鎺IFi锛屾槸鍚︿娇鐢ㄦ祦閲忕户缁鐪�"preferredStyle:UIAlertControllerStyleAlert];
             //缁х画瑙傜湅
-            [alert addAction:[UIAlertAction actionWithTitle:@"缁х画瑙傜湅" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
+            [alert addAction:[UIAlertAction actionWithTitle:@"缁х画" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
                 [alert dismissViewControllerAnimated:YES completion:^{
                     
                 }];
             }]];
             //鍘昏繛鎺ョ綉缁�
-            [alert addAction:[UIAlertAction actionWithTitle:@"杩炴帴鍏嶈垂缃戠粶" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
-                [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"prefs:root=WIFI"]];
-                [alert dismissViewControllerAnimated:YES completion:^{
-                    
-                }];
+            [alert addAction:[UIAlertAction actionWithTitle:@"鍙栨秷" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
+
             }]];
             [self presentViewController:alert animated:YES completion:^{
                 
@@ -2353,7 +2244,7 @@
             
             break;
         case 3:{//褰撳墠缃戠粶鏃犳硶妫�娴嬶紝闇�瑕佺敤鎴疯嚜琛屽垽鏂綉缁�
-            UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"鎻愮ず"message:@"鏃犳硶鐩戞祴褰撳墠缃戠粶锛岃鑷鍒ゆ柇缃戠粶锛�"preferredStyle:UIAlertControllerStyleAlert];
+            UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"娓╅Θ鎻愮ず"message:@"鏃犳硶鐩戞祴褰撳墠缃戠粶锛岃鑷鍒ゆ柇缃戠粶锛�"preferredStyle:UIAlertControllerStyleAlert];
             //缁х画瑙傜湅
             [alert addAction:[UIAlertAction actionWithTitle:@"缁х画瑙傜湅" style:UIAlertActionStyleDestructive handler:^(UIAlertAction * _Nonnull action) {
                 [alert dismissViewControllerAnimated:YES completion:^{
@@ -2377,17 +2268,17 @@
 
 #pragma mark -YTHBacktoApplicationsDelegate
 
-- (void)OutApplication{
-    if (self.cloudPlayer) {
-        [self.cloudPlayer pause];
-    }
-}
-
-- (void)backApplication{
-    if (self.cloudPlayer) {
-        [self.cloudPlayer play];
-    }
-}
+//- (void)OutApplication{
+//    if (self.cloudPlayer) {
+//        [self.cloudPlayer pause];
+//    }
+//}
+//
+//- (void)backApplication{
+//    if (self.cloudPlayer) {
+//        [self.cloudPlayer play];
+//    }
+//}
 
 - (UIViewController *)viewControllerForPresentingModalView{
     return self;
@@ -2473,5 +2364,10 @@
     }];
 }
 
+- (void)dealloc {
+    
+    
+}
 
 @end
+

--
Gitblit v1.8.0