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 | 11 | #import "LVCUGCPlayerLoadingView.h" |
| 12 | 12 | #import "LVCUGCBackgroundView.h" |
| 13 | 13 | #import "UIImage+LVCVagueImage.h" |
| 14 | +#import "LiveBaseView.h" | |
| 14 | 15 | |
| 15 | 16 | |
| 16 | 17 | @interface LVCUGCLivePlayerController () { |
| ... | ... | @@ -29,6 +30,7 @@ |
| 29 | 30 | @property (nonatomic, strong) UIView *viewOne; |
| 30 | 31 | @property (nonatomic, strong) UIView *viewSecond; |
| 31 | 32 | @property (nonatomic, strong) UIView *viewThird; |
| 33 | +@property (nonatomic ,strong) LiveBaseView * _Nullable liveBaseView; | |
| 32 | 34 | |
| 33 | 35 | @property (nonatomic, strong) CNLiveMoviePlayerController *player; // 播放器 |
| 34 | 36 | |
| ... | ... | @@ -82,6 +84,11 @@ |
| 82 | 84 | } |
| 83 | 85 | } |
| 84 | 86 | |
| 87 | +- (void)addLiveBaseView | |
| 88 | +{ | |
| 89 | + [_viewSecond addSubview:self.liveBaseView ]; | |
| 90 | +} | |
| 91 | + | |
| 85 | 92 | - (void)setModel:(LVCUGCLivePlayerModel *)model { |
| 86 | 93 | |
| 87 | 94 | if (_model != model) { |
| ... | ... | @@ -92,7 +99,7 @@ |
| 92 | 99 | [self installMovieNotificationObservers]; |
| 93 | 100 | |
| 94 | 101 | if ([model.activityStatus isEqualToString:@"1"]) { |
| 95 | - | |
| 102 | + [self addLiveBaseView]; | |
| 96 | 103 | _player = [[CNLiveMoviePlayerController alloc] initLivePlayWithChannelId:model.channelId |
| 97 | 104 | authSuccess:^{ |
| 98 | 105 | |
| ... | ... | @@ -205,7 +212,8 @@ |
| 205 | 212 | |
| 206 | 213 | } else if ([_playArray[_index].activityStatus isEqualToString:@"1"]) { |
| 207 | 214 | |
| 208 | - | |
| 215 | + [self addLiveBaseView]; | |
| 216 | + | |
| 209 | 217 | _player = [[CNLiveMoviePlayerController alloc] initLivePlayWithChannelId:_playArray[_index].channelId |
| 210 | 218 | authSuccess:^{ |
| 211 | 219 | |
| ... | ... | @@ -292,7 +300,8 @@ |
| 292 | 300 | }]; |
| 293 | 301 | |
| 294 | 302 | } else if ([_playArray[_index].activityStatus isEqualToString:@"1"]) { |
| 295 | - | |
| 303 | + [self addLiveBaseView]; | |
| 304 | + | |
| 296 | 305 | _player = [[CNLiveMoviePlayerController alloc] initLivePlayWithChannelId:_playArray[_index].channelId |
| 297 | 306 | authSuccess:^{ |
| 298 | 307 | |
| ... | ... | @@ -536,6 +545,19 @@ |
| 536 | 545 | } |
| 537 | 546 | |
| 538 | 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 | 561 | - (LVCUGCBackgroundView *)bgView { |
| 540 | 562 | |
| 541 | 563 | if (!_bgView) { | ... | ... |