Commit 017c698b717286a524083461a02ccb69fb55509a
1 parent
e0fed438
修改
Showing
3 changed files
with
23 additions
and
9 deletions
LiveVideoCloud/Classes/Sections/homeSections/Controller/LVCUGCLiveListView.m
| ... | ... | @@ -91,9 +91,7 @@ static NSString *cellId = @"cellId"; |
| 91 | 91 | LVCUGCLivePlayerCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:cellId forIndexPath:indexPath]; |
| 92 | 92 | |
| 93 | 93 | LVCUGCLivePlayerModel *model = _arrayM[indexPath.row]; |
| 94 | - if (indexPath.row == 0) { | |
| 95 | - NSLog(@"%@",model.extensionName); | |
| 96 | - } | |
| 94 | + | |
| 97 | 95 | cell.model = model; |
| 98 | 96 | |
| 99 | 97 | return cell; | ... | ... |
LiveVideoCloud/Classes/Sections/homeSections/Controller/LVCUGCLivePlayerController.m
| ... | ... | @@ -153,6 +153,10 @@ |
| 153 | 153 | } getAnchorStatusResult:^(BOOL result) { |
| 154 | 154 | |
| 155 | 155 | NSLog(@"-------------获取主播状态%d", result ? YES : NO); |
| 156 | + //如果获取主播状态失败再重新获取 | |
| 157 | + if (!result) { | |
| 158 | + [self anchorStatusConnectFailed]; | |
| 159 | + } | |
| 156 | 160 | |
| 157 | 161 | }]; |
| 158 | 162 | |
| ... | ... | @@ -286,11 +290,14 @@ |
| 286 | 290 | } getAnchorStatusResult:^(BOOL result) { |
| 287 | 291 | |
| 288 | 292 | NSLog(@"-------------获取主播状态%d", result ? YES : NO); |
| 293 | + //如果获取主播状态失败再重新获取 | |
| 294 | + if (!result) { | |
| 295 | + [self anchorStatusConnectFailed]; | |
| 296 | + } | |
| 289 | 297 | |
| 290 | 298 | }]; |
| 291 | 299 | } else if ([_playArray[_index].activityStatus isEqualToString:@"0"]) { |
| 292 | 300 | |
| 293 | - | |
| 294 | 301 | _bgView.anchorStatus = 4; |
| 295 | 302 | |
| 296 | 303 | } else if ([_playArray[_index].activityStatus isEqualToString:@"4"]) { |
| ... | ... | @@ -388,6 +395,10 @@ |
| 388 | 395 | } getAnchorStatusResult:^(BOOL result) { |
| 389 | 396 | |
| 390 | 397 | NSLog(@"-------------获取主播状态%d", result ? YES : NO); |
| 398 | + //如果获取主播状态失败再重新获取 | |
| 399 | + if (!result) { | |
| 400 | + [self anchorStatusConnectFailed]; | |
| 401 | + } | |
| 391 | 402 | |
| 392 | 403 | }]; |
| 393 | 404 | } else if ([_playArray[_index].activityStatus isEqualToString:@"0"]) { |
| ... | ... | @@ -527,6 +538,7 @@ |
| 527 | 538 | //2)播放出现错误后结束播放 |
| 528 | 539 | case MPMovieFinishReasonUserExited: |
| 529 | 540 | NSLog(@"playbackStateDidChange: MPMovieFinishReasonUserExited: %d\n", reason); |
| 541 | + [self toast:@""]; | |
| 530 | 542 | break; |
| 531 | 543 | //3)用户点击done完成播放 |
| 532 | 544 | case MPMovieFinishReasonPlaybackError: |
| ... | ... | @@ -572,6 +584,7 @@ |
| 572 | 584 | if (_playPauseBtn) { |
| 573 | 585 | [self changePlayBtnStatus:NO]; |
| 574 | 586 | } |
| 587 | + // ** | |
| 575 | 588 | NSLog(@"moviePlayBackStateDidChange : MPMoviePlaybackStateStopped"); |
| 576 | 589 | break; |
| 577 | 590 | } |
| ... | ... | @@ -625,7 +638,10 @@ |
| 625 | 638 | |
| 626 | 639 | - (void)anchorStatusConnectFailed //重新连接获取主播状态 |
| 627 | 640 | { |
| 628 | - | |
| 641 | + [_player retryToGetAnchorStatusResult:^(BOOL result) { | |
| 642 | + | |
| 643 | + NSLog(@"-------------重新获取主播状态%d", result ? YES : NO); | |
| 644 | + }]; | |
| 629 | 645 | } |
| 630 | 646 | |
| 631 | 647 | #pragma mark - Button Action !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ... | ... |
LiveVideoCloud/Classes/Sections/homeSections/View/LVCUGCLivePlayerCell.m
| ... | ... | @@ -66,10 +66,10 @@ |
| 66 | 66 | } else { |
| 67 | 67 | _nameLabel.text = @"我的昵称"; |
| 68 | 68 | } |
| 69 | -// NSString *iconPath = [[NSBundle mainBundle] pathForResource:@"头像" ofType:@"jpg"]; | |
| 70 | -// UIImage *iconImage = [UIImage imageWithContentsOfFile:iconPath]; | |
| 71 | - UIImage *iconImage = [UIImage imageWithData:[NSData | |
| 72 | - dataWithContentsOfURL:[NSURL URLWithString:[UserInformationModel manager].faceUrl]]]; | |
| 69 | + NSString *iconPath = [[NSBundle mainBundle] pathForResource:@"头像" ofType:@"jpg"]; | |
| 70 | + UIImage *iconImage = [UIImage imageWithContentsOfFile:iconPath]; | |
| 71 | +// UIImage *iconImage = [UIImage imageWithData:[NSData | |
| 72 | +// dataWithContentsOfURL:[NSURL URLWithString:[UserInformationModel manager].faceUrl]]]; | |
| 73 | 73 | [_iconView sd_setImageWithURL:[NSURL URLWithString:model.extensionIcon] placeholderImage:iconImage]; |
| 74 | 74 | |
| 75 | 75 | switch ([model.activityStatus intValue]) { | ... | ... |