Commit 40b163dc8fe3847566485850372f883708442006

Authored by 王军波
1 parent 62a45592

点播播放暂停按钮,错误信息

LiveVideoCloud/LiveVideoCloud/Classes/Sections/LiveSections/Controller/LVCLiveViewController.m
@@ -388,7 +388,7 @@ @@ -388,7 +388,7 @@
388 [_kitCN stopStream]; 388 [_kitCN stopStream];
389 389
390 [_kitCN startStream:^{ 390 [_kitCN startStream:^{
391 - NSLog(@"开启推流成功 ------- success"); 391 + NSLog(@"重试开启推流成功 ------- success");
392 392
393 } failure:^(NSDictionary *errorDic) { 393 } failure:^(NSDictionary *errorDic) {
394 [self toast:errorDic[@"errorMessage"]]; 394 [self toast:errorDic[@"errorMessage"]];
LiveVideoCloud/LiveVideoCloud/Classes/Sections/homeSections/Controller/LVCUGCLivePlayerController.m
@@ -248,6 +248,7 @@ @@ -248,6 +248,7 @@
248 [_player.view addSubview:self.bottomView]; 248 [_player.view addSubview:self.bottomView];
249 249
250 } authFailed:^(NSDictionary *errorInfo) { 250 } authFailed:^(NSDictionary *errorInfo) {
  251 +
251 NSLog(@"初始化点播播放器失败%@", errorInfo); 252 NSLog(@"初始化点播播放器失败%@", errorInfo);
252 }]; 253 }];
253 254
@@ -503,16 +504,17 @@ @@ -503,16 +504,17 @@
503 504
504 switch (reason) 505 switch (reason)
505 { 506 {
  507 + //1)播放完毕。
506 case MPMovieFinishReasonPlaybackEnded: 508 case MPMovieFinishReasonPlaybackEnded:
507 - _bgView.anchorStatus = 3; // 点播播放结束 509 + _bgView.anchorStatus = 3;
508 [_currentTimer invalidate]; 510 [_currentTimer invalidate];
509 NSLog(@"playbackStateDidChange: MPMovieFinishReasonPlaybackEnded: %d\n", reason); 511 NSLog(@"playbackStateDidChange: MPMovieFinishReasonPlaybackEnded: %d\n", reason);
510 break; 512 break;
511 - 513 + //2)播放出现错误后结束播放
512 case MPMovieFinishReasonUserExited: 514 case MPMovieFinishReasonUserExited:
513 NSLog(@"playbackStateDidChange: MPMovieFinishReasonUserExited: %d\n", reason); 515 NSLog(@"playbackStateDidChange: MPMovieFinishReasonUserExited: %d\n", reason);
514 break; 516 break;
515 - 517 + //3)用户点击done完成播放
516 case MPMovieFinishReasonPlaybackError: 518 case MPMovieFinishReasonPlaybackError:
517 NSLog(@"playbackStateDidChange: MPMovieFinishReasonPlaybackError: %d\n", reason); 519 NSLog(@"playbackStateDidChange: MPMovieFinishReasonPlaybackError: %d\n", reason);
518 [self toast:@"MPMovieFinishReasonPlaybackError"]; 520 [self toast:@"MPMovieFinishReasonPlaybackError"];
@@ -701,11 +703,11 @@ @@ -701,11 +703,11 @@
701 if (!_bottomView) { 703 if (!_bottomView) {
702 _bottomView = [[UIView alloc] initWithFrame:CGRectMake(0, SCREEN_HEIGHT - 50, SCREEN_WIDTH, 50)]; 704 _bottomView = [[UIView alloc] initWithFrame:CGRectMake(0, SCREEN_HEIGHT - 50, SCREEN_WIDTH, 50)];
703 _bottomView.backgroundColor = [UIColor colorWithWhite:0 alpha:0.7]; 705 _bottomView.backgroundColor = [UIColor colorWithWhite:0 alpha:0.7];
704 - [_bottomView addSubview:self.playPauseBtn];  
705 [_bottomView addSubview:self.currentTimeLabel]; 706 [_bottomView addSubview:self.currentTimeLabel];
706 [_bottomView addSubview:self.durationLabel]; 707 [_bottomView addSubview:self.durationLabel];
707 [_bottomView addSubview:self.bufferProgress]; 708 [_bottomView addSubview:self.bufferProgress];
708 [_bottomView addSubview:self.timeSlide]; 709 [_bottomView addSubview:self.timeSlide];
  710 + [_bottomView addSubview:self.playPauseBtn];
709 } 711 }
710 return _bottomView; 712 return _bottomView;
711 } 713 }
@@ -714,9 +716,8 @@ @@ -714,9 +716,8 @@
714 if (!_playPauseBtn) { 716 if (!_playPauseBtn) {
715 _playPauseBtn = [UIButton buttonWithType:UIButtonTypeCustom]; 717 _playPauseBtn = [UIButton buttonWithType:UIButtonTypeCustom];
716 _playPauseBtn.frame = CGRectMake(0, 5, 40, 40); 718 _playPauseBtn.frame = CGRectMake(0, 5, 40, 40);
717 - [_playPauseBtn addTarget:self action:@selector(playPause) forControlEvents:UIControlEventTouchUpInside];  
718 [_playPauseBtn setImage:[UIImage imageNamed:@"play"] forState:UIControlStateNormal]; 719 [_playPauseBtn setImage:[UIImage imageNamed:@"play"] forState:UIControlStateNormal];
719 - _playPauseBtn.userInteractionEnabled = NO; 720 + [_playPauseBtn addTarget:self action:@selector(playPause) forControlEvents:UIControlEventTouchUpInside];
720 } 721 }
721 return _playPauseBtn; 722 return _playPauseBtn;
722 } 723 }