Commit 27f84b4745f3ae105e7c4c8ac186249263cb98e6
1 parent
970d7db7
14系统图片不显示
Showing
4 changed files
with
23 additions
and
5 deletions
CNLiveScioLive/Pages/Home/新闻详情/OldController/OldVideoDetailViewController.m
| ... | ... | @@ -48,8 +48,8 @@ |
| 48 | 48 | self->bgImg = [UIImage imageWithData:data]; |
| 49 | 49 | dispatch_async(dispatch_get_main_queue(), ^{ |
| 50 | 50 | if (self.videoController && self->bgImg) { |
| 51 | - self.videoController.view.contentMode=UIViewContentModeScaleAspectFit; | |
| 52 | - [self.videoController.view setBackgroundColor:[UIColor colorWithPatternImage:self->bgImg]]; | |
| 51 | + self.videoController.view.contentMode=UIViewContentModeScaleToFill; | |
| 52 | + self.videoController.view.layer.contents = (__bridge id _Nullable) (self->bgImg.CGImage); | |
| 53 | 53 | |
| 54 | 54 | } |
| 55 | 55 | }); |
| ... | ... | @@ -341,13 +341,17 @@ |
| 341 | 341 | self.videoController = [[ZXVideoPlayerController alloc] initWithFrame:frame]; |
| 342 | 342 | //增加播放器背景图片 |
| 343 | 343 | if (!(nil==bgImg)) { |
| 344 | - self.videoController.view.contentMode=UIViewContentModeScaleAspectFit; | |
| 345 | - [self.videoController.view setBackgroundColor:[UIColor colorWithPatternImage:self->bgImg]]; | |
| 344 | + self.videoController.view.contentMode=UIViewContentModeScaleToFill; | |
| 345 | + self.videoController.view.layer.contents = (__bridge id _Nullable)(self->bgImg.CGImage); | |
| 346 | 346 | } |
| 347 | 347 | self.liveController.delegate = self; |
| 348 | 348 | [self.videoController showInView:self.view]; |
| 349 | 349 | |
| 350 | 350 | __weak typeof(self) weakSelf = self; |
| 351 | + self.videoController.videoPlayerShare = ^{ | |
| 352 | + __strong typeof(self) strongSelf = weakSelf; | |
| 353 | + [strongSelf shareButtonTaped:strongSelf->_shareBtn]; | |
| 354 | + }; | |
| 351 | 355 | self.videoController.videoPlayerGoBackBlock = ^{ |
| 352 | 356 | __strong typeof(self) strongSelf = weakSelf; |
| 353 | 357 | [[NSUserDefaults standardUserDefaults] setObject:@0 forKey:@"ZXVideoPlayer_DidLockScreen"]; | ... | ... |
CNLiveScioLive/Pages/Live/Controller/VideoPlayBackViewController.m
| ... | ... | @@ -308,6 +308,10 @@ |
| 308 | 308 | CGRect frame = CGRectMake(0, iPhoneX ? 44 : 0, MainScreenWidth, videoHeight); |
| 309 | 309 | self.videoController = [[ZXVideoPlayerController alloc] initWithFrame:frame]; |
| 310 | 310 | __weak typeof(self) weakSelf = self; |
| 311 | + self.videoController.videoPlayerShare = ^{ | |
| 312 | + __strong typeof(self) strongSelf = weakSelf; | |
| 313 | + [strongSelf shareButtonTaped:strongSelf->_shareButton]; | |
| 314 | + }; | |
| 311 | 315 | self.videoController.videoPlayerGoBackBlock = ^{ |
| 312 | 316 | __strong typeof(self) strongSelf = weakSelf; |
| 313 | 317 | [[NSUserDefaults standardUserDefaults] setObject:@0 forKey:@"ZXVideoPlayer_DidLockScreen"]; | ... | ... |
CNLiveScioLive/Pages/Tools/ZXVideoPlayer/Classes/ZXVideoPlayerController.h
| ... | ... | @@ -24,6 +24,8 @@ |
| 24 | 24 | @property (nonatomic, strong, readwrite) ZXVideo *video; |
| 25 | 25 | /// 竖屏模式下点击返回 |
| 26 | 26 | @property (nonatomic, copy) void(^videoPlayerGoBackBlock)(void); |
| 27 | + | |
| 28 | +@property (nonatomic, copy) void (^videoPlayerShare)(void); | |
| 27 | 29 | /// 将要切换到竖屏模式 |
| 28 | 30 | @property (nonatomic, copy) void(^videoPlayerWillChangeToOriginalScreenModeBlock)(void); |
| 29 | 31 | /// 将要切换到全屏模式 | ... | ... |
CNLiveScioLive/Pages/Tools/ZXVideoPlayer/Classes/ZXVideoPlayerController.m
No preview for this file type