Commit e1b8dc929be4b0af57395dd030a50685eed18522
1 parent
2ac6179d
no message
Showing
1 changed file
with
25 additions
and
3 deletions
LiveVideoCloud/LiveVideoCloud/Classes/Sections/homeSections/Controller/LVCUGCLivePlayerController.m
| @@ -11,6 +11,7 @@ | @@ -11,6 +11,7 @@ | ||
| 11 | #import "LVCUGCPlayerLoadingView.h" | 11 | #import "LVCUGCPlayerLoadingView.h" |
| 12 | #import "LVCUGCBackgroundView.h" | 12 | #import "LVCUGCBackgroundView.h" |
| 13 | #import "UIImage+LVCVagueImage.h" | 13 | #import "UIImage+LVCVagueImage.h" |
| 14 | +#import "LiveBaseView.h" | ||
| 14 | 15 | ||
| 15 | 16 | ||
| 16 | @interface LVCUGCLivePlayerController () { | 17 | @interface LVCUGCLivePlayerController () { |
| @@ -29,6 +30,7 @@ | @@ -29,6 +30,7 @@ | ||
| 29 | @property (nonatomic, strong) UIView *viewOne; | 30 | @property (nonatomic, strong) UIView *viewOne; |
| 30 | @property (nonatomic, strong) UIView *viewSecond; | 31 | @property (nonatomic, strong) UIView *viewSecond; |
| 31 | @property (nonatomic, strong) UIView *viewThird; | 32 | @property (nonatomic, strong) UIView *viewThird; |
| 33 | +@property (nonatomic ,strong) LiveBaseView * _Nullable liveBaseView; | ||
| 32 | 34 | ||
| 33 | @property (nonatomic, strong) CNLiveMoviePlayerController *player; // 播放器 | 35 | @property (nonatomic, strong) CNLiveMoviePlayerController *player; // 播放器 |
| 34 | 36 | ||
| @@ -82,6 +84,11 @@ | @@ -82,6 +84,11 @@ | ||
| 82 | } | 84 | } |
| 83 | } | 85 | } |
| 84 | 86 | ||
| 87 | +- (void)addLiveBaseView | ||
| 88 | +{ | ||
| 89 | + [_viewSecond addSubview:self.liveBaseView ]; | ||
| 90 | +} | ||
| 91 | + | ||
| 85 | - (void)setModel:(LVCUGCLivePlayerModel *)model { | 92 | - (void)setModel:(LVCUGCLivePlayerModel *)model { |
| 86 | 93 | ||
| 87 | if (_model != model) { | 94 | if (_model != model) { |
| @@ -92,7 +99,7 @@ | @@ -92,7 +99,7 @@ | ||
| 92 | [self installMovieNotificationObservers]; | 99 | [self installMovieNotificationObservers]; |
| 93 | 100 | ||
| 94 | if ([model.activityStatus isEqualToString:@"1"]) { | 101 | if ([model.activityStatus isEqualToString:@"1"]) { |
| 95 | - | 102 | + [self addLiveBaseView]; |
| 96 | _player = [[CNLiveMoviePlayerController alloc] initLivePlayWithChannelId:model.channelId | 103 | _player = [[CNLiveMoviePlayerController alloc] initLivePlayWithChannelId:model.channelId |
| 97 | authSuccess:^{ | 104 | authSuccess:^{ |
| 98 | 105 | ||
| @@ -205,7 +212,8 @@ | @@ -205,7 +212,8 @@ | ||
| 205 | 212 | ||
| 206 | } else if ([_playArray[_index].activityStatus isEqualToString:@"1"]) { | 213 | } else if ([_playArray[_index].activityStatus isEqualToString:@"1"]) { |
| 207 | 214 | ||
| 208 | - | 215 | + [self addLiveBaseView]; |
| 216 | + | ||
| 209 | _player = [[CNLiveMoviePlayerController alloc] initLivePlayWithChannelId:_playArray[_index].channelId | 217 | _player = [[CNLiveMoviePlayerController alloc] initLivePlayWithChannelId:_playArray[_index].channelId |
| 210 | authSuccess:^{ | 218 | authSuccess:^{ |
| 211 | 219 | ||
| @@ -292,7 +300,8 @@ | @@ -292,7 +300,8 @@ | ||
| 292 | }]; | 300 | }]; |
| 293 | 301 | ||
| 294 | } else if ([_playArray[_index].activityStatus isEqualToString:@"1"]) { | 302 | } else if ([_playArray[_index].activityStatus isEqualToString:@"1"]) { |
| 295 | - | 303 | + [self addLiveBaseView]; |
| 304 | + | ||
| 296 | _player = [[CNLiveMoviePlayerController alloc] initLivePlayWithChannelId:_playArray[_index].channelId | 305 | _player = [[CNLiveMoviePlayerController alloc] initLivePlayWithChannelId:_playArray[_index].channelId |
| 297 | authSuccess:^{ | 306 | authSuccess:^{ |
| 298 | 307 | ||
| @@ -536,6 +545,19 @@ | @@ -536,6 +545,19 @@ | ||
| 536 | } | 545 | } |
| 537 | 546 | ||
| 538 | #pragma mark - GetMethod !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | 547 | #pragma mark - GetMethod !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
| 548 | +- (LiveBaseView *)liveBaseView | ||
| 549 | +{ | ||
| 550 | + if (!_liveBaseView) | ||
| 551 | + { | ||
| 552 | + _liveBaseView = [LiveBaseView liveBaseView]; | ||
| 553 | + _liveBaseView.jumpType = JumpControllerTypePresent; | ||
| 554 | + _liveBaseView.viewController = self; | ||
| 555 | + _liveBaseView.backgroundColor = [UIColor clearColor]; | ||
| 556 | + [_liveBaseView.closeBtn addTarget:self action:@selector(quitBtnClick) forControlEvents:UIControlEventTouchUpInside]; | ||
| 557 | + } | ||
| 558 | + return _liveBaseView; | ||
| 559 | +} | ||
| 560 | + | ||
| 539 | - (LVCUGCBackgroundView *)bgView { | 561 | - (LVCUGCBackgroundView *)bgView { |
| 540 | 562 | ||
| 541 | if (!_bgView) { | 563 | if (!_bgView) { |