Commit a150b5fc57c5c1abec5f0c89425e2f1e2e5546df
1 parent
3f467ab3
no message
Showing
1 changed file
with
2 additions
and
3 deletions
CNLivePlayer/Classes/Player/CNLivePlayer.m
| ... | ... | @@ -134,9 +134,7 @@ |
| 134 | 134 | _player.playerView.frame = CGRectMake(0, 0, self.frame.size.width, self.frame.size.height); |
| 135 | 135 | _player.playerView.contentMode = UIViewContentModeScaleAspectFit; |
| 136 | 136 | _player.launchView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"cnlive_player_bg"]]; |
| 137 | - if(!_player.isPlaying){ | |
| 138 | - [_player play]; | |
| 139 | - } | |
| 137 | + [_player play]; | |
| 140 | 138 | [self.view addSubview:self.player.playerView]; |
| 141 | 139 | } |
| 142 | 140 | } |
| ... | ... | @@ -230,6 +228,7 @@ |
| 230 | 228 | } |
| 231 | 229 | break; |
| 232 | 230 | } |
| 231 | + // 预加载2s | |
| 233 | 232 | int64_t seconds = self.player.currentTime.value+2*self.player.currentTime.timescale; |
| 234 | 233 | int32_t timeScale = self.player.currentTime.timescale; |
| 235 | 234 | _switchRateTime = CMTimeMake(seconds, timeScale); | ... | ... |