Commit af147b98ad5e6a487263cfa90a1f4145da34a278

Authored by yanglingyu
1 parent 70a7ae11

视频网络不好退出播放解决

CNLiveScioLive/Pages/Home/新闻详情/Controller/VideoDetailViewController.m
@@ -117,6 +117,7 @@ static NSString *newsLeftPicTableViewCell = @"CNLiveNewsLeftPicTableViewCell"; @@ -117,6 +117,7 @@ static NSString *newsLeftPicTableViewCell = @"CNLiveNewsLeftPicTableViewCell";
117 117
118 - (void)dealloc 118 - (void)dealloc
119 { 119 {
  120 + [self.liveController stop];
120 self.liveController = nil; 121 self.liveController = nil;
121 } 122 }
122 - (void)viewWillAppear:(BOOL)animated { 123 - (void)viewWillAppear:(BOOL)animated {
@@ -385,7 +386,7 @@ static NSString *newsLeftPicTableViewCell = @"CNLiveNewsLeftPicTableViewCell"; @@ -385,7 +386,7 @@ static NSString *newsLeftPicTableViewCell = @"CNLiveNewsLeftPicTableViewCell";
385 - (void)viewWillDisappear:(BOOL)animated { 386 - (void)viewWillDisappear:(BOOL)animated {
386 [super viewWillDisappear:animated]; 387 [super viewWillDisappear:animated];
387 [self.videoController stop]; 388 [self.videoController stop];
388 - [self.liveController stop]; 389 + [self.liveController stopShow];
389 [self.navigationController setNavigationBarHidden:NO]; 390 [self.navigationController setNavigationBarHidden:NO];
390 NSError *error = nil; 391 NSError *error = nil;
391 [[AVAudioSession sharedInstance] setCategory: AVAudioSessionCategoryPlayback error: &error]; 392 [[AVAudioSession sharedInstance] setCategory: AVAudioSessionCategoryPlayback error: &error];
CNLiveScioLive/Pages/Home/新闻详情/OldController/OldArticleDetailViewController.m
@@ -97,17 +97,17 @@ @@ -97,17 +97,17 @@
97 NSDictionary *dic = [NSDictionary dictionaryWithDictionary:responseObject]; 97 NSDictionary *dic = [NSDictionary dictionaryWithDictionary:responseObject];
98 // NSLog(@"%@",dic); 98 // NSLog(@"%@",dic);
99 if ([dic[@"errorCode"] isEqualToString:@"0"]) { 99 if ([dic[@"errorCode"] isEqualToString:@"0"]) {
100 - [_webView loadHTMLString:[self setHTMLString:dic[@"content"] author:dic[@"author"]] baseURL:[NSURL URLWithString:_dictionary[@"pageUrl"]]];  
101 - isFail = 0;  
102 - _refresh.hidden = YES; 100 + [self->_webView loadHTMLString:[self setHTMLString:dic[@"content"] author:dic[@"author"]] baseURL:[NSURL URLWithString:self->_dictionary[@"pageUrl"]]];
  101 + self->isFail = 0;
  102 + self->_refresh.hidden = YES;
103 103
104 } else { 104 } else {
105 - isFail++; 105 + self->isFail++;
106 [AlertViewTool showHUDViewText:dic[@"errorMessage"]]; 106 [AlertViewTool showHUDViewText:dic[@"errorMessage"]];
107 - if (isFail == 1) { 107 + if (self->isFail == 1) {
108 [self getDetailsData]; 108 [self getDetailsData];
109 - } else if (isFail > 1) {  
110 - _refresh.hidden = NO; 109 + } else if (self->isFail > 1) {
  110 + self->_refresh.hidden = NO;
111 } 111 }
112 } 112 }
113 113
CNLiveScioLive/Pages/Home/新闻详情/OldController/OldVideoDetailViewController.m
@@ -75,6 +75,7 @@ @@ -75,6 +75,7 @@
75 75
76 -(void)dealloc 76 -(void)dealloc
77 { 77 {
  78 + [self.liveController stop];
78 self.liveController = nil; 79 self.liveController = nil;
79 self.videoController = nil; 80 self.videoController = nil;
80 NSLog(@"delloc"); 81 NSLog(@"delloc");
@@ -183,7 +184,7 @@ @@ -183,7 +184,7 @@
183 - (void)viewWillDisappear:(BOOL)animated { 184 - (void)viewWillDisappear:(BOOL)animated {
184 [super viewWillDisappear:animated]; 185 [super viewWillDisappear:animated];
185 [self.videoController stop]; 186 [self.videoController stop];
186 - [self.liveController stop]; 187 + [self.liveController stopShow];
187 // self.liveController = nil; 188 // self.liveController = nil;
188 [self.navigationController setNavigationBarHidden:NO]; 189 [self.navigationController setNavigationBarHidden:NO];
189 190
CNLiveScioLive/Pages/Live/Controller/GraphicLiveViewController.m
@@ -95,7 +95,7 @@ @@ -95,7 +95,7 @@
95 95
96 - (void)viewWillDisappear:(BOOL)animated { 96 - (void)viewWillDisappear:(BOOL)animated {
97 [super viewWillDisappear:animated]; 97 [super viewWillDisappear:animated];
98 - [self.liveController stop]; 98 + [self.liveController stopShow];
99 // self.liveController = nil; 99 // self.liveController = nil;
100 [self.navigationController setNavigationBarHidden:NO]; 100 [self.navigationController setNavigationBarHidden:NO];
101 } 101 }
@@ -179,6 +179,7 @@ @@ -179,6 +179,7 @@
179 179
180 - (void)dealloc { 180 - (void)dealloc {
181 [[NSNotificationCenter defaultCenter] removeObserver:self]; 181 [[NSNotificationCenter defaultCenter] removeObserver:self];
  182 + [self.liveController stop];
182 self.liveController = nil; 183 self.liveController = nil;
183 } 184 }
184 #pragma mark - UI 185 #pragma mark - UI
CNLiveScioLive/Pages/Live/Controller/VideoPlayBackViewController.m
@@ -177,6 +177,7 @@ @@ -177,6 +177,7 @@
177 177
178 - (void)dealloc { 178 - (void)dealloc {
179 [[NSNotificationCenter defaultCenter] removeObserver:self]; 179 [[NSNotificationCenter defaultCenter] removeObserver:self];
  180 + [self.liveController stop];
180 self.liveController = nil; 181 self.liveController = nil;
181 } 182 }
182 183
@@ -207,7 +208,7 @@ @@ -207,7 +208,7 @@
207 } 208 }
208 - (void)viewWillDisappear:(BOOL)animated { 209 - (void)viewWillDisappear:(BOOL)animated {
209 [super viewWillDisappear:animated]; 210 [super viewWillDisappear:animated];
210 - [self.liveController stop]; 211 + [self.liveController stopShow];
211 [self.navigationController setNavigationBarHidden:NO]; 212 [self.navigationController setNavigationBarHidden:NO];
212 } 213 }
213 - (void)viewDidLoad { 214 - (void)viewDidLoad {
@@ -344,7 +345,7 @@ @@ -344,7 +345,7 @@
344 __strong typeof(self) strongSelf = weakSelf; 345 __strong typeof(self) strongSelf = weakSelf;
345 [[NSUserDefaults standardUserDefaults] setObject:@0 forKey:@"ZXVideoPlayer_DidLockScreen"]; 346 [[NSUserDefaults standardUserDefaults] setObject:@0 forKey:@"ZXVideoPlayer_DidLockScreen"];
346 [strongSelf.liveController destroyPlayer]; 347 [strongSelf.liveController destroyPlayer];
347 - strongSelf.liveController = nil; 348 +// strongSelf.liveController = nil;
348 [strongSelf Pop:nil]; 349 [strongSelf Pop:nil];
349 }; 350 };
350 self.liveController.delegate = self; 351 self.liveController.delegate = self;
CNLiveScioLive/Pages/Tools/CNLivePlayer/CNLivePlayerController.h
@@ -39,6 +39,6 @@ @@ -39,6 +39,6 @@
39 /// 展示播放器 39 /// 展示播放器
40 - (void)showInView:(UIView *)view; 40 - (void)showInView:(UIView *)view;
41 41
42 -- (void)stop ; 42 +- (void)stopShow;
43 43
44 @end 44 @end
CNLiveScioLive/Pages/Tools/CNLivePlayer/CNLivePlayerController.m
No preview for this file type