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