Commit 62a45592dc0cbe5e8228b33f54e0301cd64e6764

Authored by 王军波
1 parent 14ba2e3c

加载图更换

LiveVideoCloud/LiveVideoCloud/Classes/Sections/homeSections/Controller/LVCUGCLivePlayerController.m
@@ -20,6 +20,7 @@ @@ -20,6 +20,7 @@
20 float _SecondY; 20 float _SecondY;
21 float _ThirdY; 21 float _ThirdY;
22 UIView *_tempView; 22 UIView *_tempView;
  23 + LVCUGCPlayerLoadingView *_tempImageView;
23 UIPanGestureRecognizer *_pan; 24 UIPanGestureRecognizer *_pan;
24 LVCUGCPlayerLoadingView *_firstLoadView; 25 LVCUGCPlayerLoadingView *_firstLoadView;
25 LVCUGCPlayerLoadingView *_secondLoadView; 26 LVCUGCPlayerLoadingView *_secondLoadView;
@@ -208,14 +209,23 @@ @@ -208,14 +209,23 @@
208 [_player.view removeFromSuperview]; 209 [_player.view removeFromSuperview];
209 [_player stop]; 210 [_player stop];
210 _player = nil; 211 _player = nil;
211 - // 停止后的视图,拿到自己的加载图来显示  
212 - [_viewSecond addSubview:_secondLoadView];  
213 212
  213 + //加载图调整.
  214 + if (_index > 0) {
  215 + [_thirdLoadView.bgImageView sd_setImageWithURL:[NSURL URLWithString:_playArray[_index - 1].coverImgUrl] placeholderImage:_blurImage];
  216 + }
  217 + _tempImageView = _firstLoadView;
  218 + _firstLoadView = _thirdLoadView;
  219 + _thirdLoadView = _secondLoadView;
  220 + _secondLoadView = _tempImageView;
  221 + // 视图调整
214 _viewThird.frame = CGRectMake(0, -SCREEN_HEIGHT, SCREEN_WIDTH, SCREEN_HEIGHT); 222 _viewThird.frame = CGRectMake(0, -SCREEN_HEIGHT, SCREEN_WIDTH, SCREEN_HEIGHT);
215 _tempView = _viewOne; 223 _tempView = _viewOne;
216 _viewOne = _viewThird; 224 _viewOne = _viewThird;
217 _viewThird = _viewSecond; 225 _viewThird = _viewSecond;
218 _viewSecond = _tempView; 226 _viewSecond = _tempView;
  227 + // 停止后的视图,拿到自己的加载图来显示
  228 + [self adjustViewWithLoadView];
219 229
220 //往下滑 播放上一个 230 //往下滑 播放上一个
221 if (_index >= 0) { 231 if (_index >= 0) {
@@ -301,14 +311,23 @@ @@ -301,14 +311,23 @@
301 [_player.view removeFromSuperview]; 311 [_player.view removeFromSuperview];
302 [_player stop]; 312 [_player stop];
303 _player = nil; 313 _player = nil;
304 - // 停止后的视图,拿到自己的加载图来显示  
305 - [_viewSecond addSubview:_secondLoadView];  
306 314
  315 + //加载图调整
  316 + if (_index < _playArray.count - 1) {
  317 + [_firstLoadView.bgImageView sd_setImageWithURL:[NSURL URLWithString:_playArray[_index + 1].coverImgUrl] placeholderImage:_blurImage];
  318 + }
  319 + _tempImageView = _firstLoadView;
  320 + _firstLoadView = _secondLoadView;
  321 + _secondLoadView = _thirdLoadView;
  322 + _thirdLoadView = _tempImageView;
  323 + // 视图调整
307 _viewOne.frame = CGRectMake(0, SCREEN_HEIGHT, SCREEN_WIDTH, SCREEN_HEIGHT); 324 _viewOne.frame = CGRectMake(0, SCREEN_HEIGHT, SCREEN_WIDTH, SCREEN_HEIGHT);
308 _tempView = _viewOne; 325 _tempView = _viewOne;
309 _viewOne = _viewSecond; 326 _viewOne = _viewSecond;
310 _viewSecond = _viewThird; 327 _viewSecond = _viewThird;
311 _viewThird = _tempView; 328 _viewThird = _tempView;
  329 + // 停止后的视图,拿到自己的加载图来显示
  330 + [self adjustViewWithLoadView];
312 331
313 //往上滑 播放下一个 332 //往上滑 播放下一个
314 if (_index < _playArray.count) { // 判越界 333 if (_index < _playArray.count) { // 判越界
@@ -398,6 +417,15 @@ @@ -398,6 +417,15 @@
398 } 417 }
399 } 418 }
400 419
  420 +- (void)adjustViewWithLoadView {
  421 + [_firstLoadView removeFromSuperview];
  422 + [_secondLoadView removeFromSuperview];
  423 + [_thirdLoadView removeFromSuperview];
  424 + [_viewOne addSubview:_firstLoadView];
  425 + [_viewSecond addSubview:_secondLoadView];
  426 + [_viewThird addSubview:_thirdLoadView];
  427 +}
  428 +
401 #pragma mark - Action !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 429 #pragma mark - Action !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
402 -(void)installMovieNotificationObservers //添加视频播放通知监听 430 -(void)installMovieNotificationObservers //添加视频播放通知监听
403 { 431 {