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