Commit e917767764bfe118f2931aa433fe16e8201eccbf
1 parent
aaa38dcf
修复个别视频无法播放问题
Showing
1 changed file
with
18 additions
and
13 deletions
CNLiveScioLive/Pages/Home/新闻详情/OldController/OldVideoDetailViewController.m
| ... | ... | @@ -269,7 +269,7 @@ |
| 269 | 269 | [backgroundView addSubview:self.errorLabe]; |
| 270 | 270 | self.errorLabe.text = @"没有数据"; |
| 271 | 271 | self.errorLabe.hidden = YES; |
| 272 | - if ([_dictionary[@"playType"] isEqualToString:@"1"]) { | |
| 272 | + if (!_dictionary[@"imgSmall"]||[_dictionary[@"imgSmall"] isEqualToString:@""]) { | |
| 273 | 273 | [self addCNLivePlayer]; |
| 274 | 274 | } else { |
| 275 | 275 | [self addZXVideo:movieUrl]; |
| ... | ... | @@ -289,19 +289,24 @@ |
| 289 | 289 | [backButton addTarget:self action:@selector(backButtonAction:) forControlEvents:UIControlEventTouchUpInside]; |
| 290 | 290 | [bgView addSubview:backButton]; |
| 291 | 291 | [self.view addSubview:bgView]; |
| 292 | - | |
| 292 | + self.liveController = [[CNLivePlayerController alloc] initWithContentURL:[NSURL URLWithString:self -> url]]; | |
| 293 | + [[AVAudioSession sharedInstance] setActive:YES error:nil]; | |
| 294 | + [bgView removeFromSuperview]; | |
| 295 | + [self.liveController configPlayerWithFrame:frame isLiving:NO]; | |
| 296 | + [self.liveController showInView:self.view]; | |
| 293 | 297 | // 点播 |
| 294 | - self.liveController = [[CNLivePlayerController alloc] initVodPlayWithVId:_dictionary[@"uuid"] authSuccess:^{ | |
| 295 | - NSError *error = nil; | |
| 296 | - [[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback error: &error]; | |
| 297 | - [[AVAudioSession sharedInstance] setActive:YES error:nil]; | |
| 298 | - | |
| 299 | - [bgView removeFromSuperview]; | |
| 300 | - [self.liveController configPlayerWithFrame:frame isLiving:NO]; | |
| 301 | - [self.liveController showInView:self.view]; | |
| 302 | - } authFailed:^(NSDictionary *errorInfo) { | |
| 303 | - NSLog(@"初始化点播播放器失败%@", errorInfo); | |
| 304 | - }]; | |
| 298 | +// self.liveController = [[CNLivePlayerController alloc] initVodPlayWithVId:_dictionary[@"uuid"] authSuccess:^{ | |
| 299 | +// [self.liveController reload:[NSURL URLWithString:self->url]]; | |
| 300 | +// NSError *error = nil; | |
| 301 | +// [[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback error: &error]; | |
| 302 | +// [[AVAudioSession sharedInstance] setActive:YES error:nil]; | |
| 303 | +// | |
| 304 | +// [bgView removeFromSuperview]; | |
| 305 | +// [self.liveController configPlayerWithFrame:frame isLiving:NO]; | |
| 306 | +// [self.liveController showInView:self.view]; | |
| 307 | +// } authFailed:^(NSDictionary *errorInfo) { | |
| 308 | +// NSLog(@"初始化点播播放器失败%@", errorInfo); | |
| 309 | +// }]; | |
| 305 | 310 | self.liveController.delegate = self; |
| 306 | 311 | |
| 307 | 312 | [[NSUserDefaults standardUserDefaults] setObject:@0 forKey:@"ZXVideoPlayer_DidLockScreen"]; | ... | ... |