Commit c17da37f98680ca7dc8d381662279d76046fdc3d
1 parent
99a8b6b2
横屏状态滑动返回取消
Showing
3 changed files
with
22 additions
and
44 deletions
CNLiveScioLive/Pages/Home/新闻详情/OldController/OldVideoDetailViewController.m
| ... | ... | @@ -283,23 +283,15 @@ |
| 283 | 283 | [bgView removeFromSuperview]; |
| 284 | 284 | [self.liveController configPlayerWithFrame:frame isLiving:NO]; |
| 285 | 285 | [self.liveController showInView:self.view]; |
| 286 | - // 点播 | |
| 287 | -// self.liveController = [[CNLivePlayerController alloc] initVodPlayWithVId:_dictionary[@"uuid"] authSuccess:^{ | |
| 288 | -// [self.liveController reload:[NSURL URLWithString:self->url]]; | |
| 289 | -// NSError *error = nil; | |
| 290 | -// [[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback error: &error]; | |
| 291 | -// [[AVAudioSession sharedInstance] setActive:YES error:nil]; | |
| 292 | -// | |
| 293 | -// [bgView removeFromSuperview]; | |
| 294 | -// [self.liveController configPlayerWithFrame:frame isLiving:NO]; | |
| 295 | -// [self.liveController showInView:self.view]; | |
| 296 | -// } authFailed:^(NSDictionary *errorInfo) { | |
| 297 | -// NSLog(@"初始化点播播放器失败%@", errorInfo); | |
| 298 | -// }]; | |
| 299 | 286 | self.liveController.delegate = self; |
| 300 | - | |
| 287 | + MJWeakSelf | |
| 288 | + self.liveController.videoPlayerWillChangeToFullScreenModeBlock = ^{ | |
| 289 | + weakSelf.navigationController.interactivePopGestureRecognizer.enabled = NO; | |
| 290 | + }; | |
| 291 | + self.liveController.videoPlayerWillChangeToOriginalScreenModeBlock = ^{ | |
| 292 | + weakSelf.navigationController.interactivePopGestureRecognizer.enabled = YES; | |
| 293 | + }; | |
| 301 | 294 | [[NSUserDefaults standardUserDefaults] setObject:@0 forKey:@"ZXVideoPlayer_DidLockScreen"]; |
| 302 | - __weak typeof(self) weakSelf = self; | |
| 303 | 295 | self.liveController.videoPlayerGoBackBlock = ^{ |
| 304 | 296 | __strong typeof(self) strongSelf = weakSelf; |
| 305 | 297 | [[NSUserDefaults standardUserDefaults] setObject:@0 forKey:@"ZXVideoPlayer_DidLockScreen"]; | ... | ... |
CNLiveScioLive/Pages/Live/Controller/GraphicLiveViewController.m
| ... | ... | @@ -302,6 +302,13 @@ |
| 302 | 302 | [strongSelf Pop:nil]; |
| 303 | 303 | }; |
| 304 | 304 | } |
| 305 | + MJWeakSelf | |
| 306 | + self.liveController.videoPlayerWillChangeToFullScreenModeBlock = ^{ | |
| 307 | + weakSelf.navigationController.interactivePopGestureRecognizer.enabled = NO; | |
| 308 | + }; | |
| 309 | + self.liveController.videoPlayerWillChangeToOriginalScreenModeBlock = ^{ | |
| 310 | + weakSelf.navigationController.interactivePopGestureRecognizer.enabled = YES; | |
| 311 | + }; | |
| 305 | 312 | ZXVideo *video = [[ZXVideo alloc] init]; |
| 306 | 313 | video.title = _dictionary[@"title"]; |
| 307 | 314 | self.liveController.video = video; |
| ... | ... | @@ -535,10 +542,7 @@ |
| 535 | 542 | } |
| 536 | 543 | |
| 537 | 544 | - (BOOL)shouldAutorotate { |
| 538 | - if (!isPlay) { | |
| 539 | - return [[[NSUserDefaults standardUserDefaults] objectForKey:@"GraphicLive_DidLockScreen"] boolValue]; | |
| 540 | - } | |
| 541 | - return ![[[NSUserDefaults standardUserDefaults] objectForKey:@"ZXVideoPlayer_DidLockScreen"] boolValue]; | |
| 545 | + return isPlay; | |
| 542 | 546 | } |
| 543 | 547 | |
| 544 | 548 | - (UIInterfaceOrientationMask)supportedInterfaceOrientations { | ... | ... |
CNLiveScioLive/Pages/Live/Controller/VideoPlayBackViewController.m
| ... | ... | @@ -273,7 +273,6 @@ |
| 273 | 273 | [self loadMovieView]; |
| 274 | 274 | } else { |
| 275 | 275 | [self addCNLivePlayerWithURL:movieUrl]; |
| 276 | -// [self addVideoPlayerWithURL:movieUrl]; | |
| 277 | 276 | } |
| 278 | 277 | |
| 279 | 278 | fontIndex = (int)[[NSUserDefaults standardUserDefaults] integerForKey:@"FontSize"]; |
| ... | ... | @@ -304,30 +303,6 @@ |
| 304 | 303 | [self.view addSubview:backButton]; |
| 305 | 304 | } |
| 306 | 305 | |
| 307 | -- (void)addVideoPlayerWithURL:(NSURL *)videoUrl{ | |
| 308 | - if (!self.videoController) { | |
| 309 | - CGRect frame = CGRectMake(0, iPhoneX ? 44 : 0, MainScreenWidth, videoHeight); | |
| 310 | - self.videoController = [[ZXVideoPlayerController alloc] initWithFrame:frame]; | |
| 311 | - __weak typeof(self) weakSelf = self; | |
| 312 | - self.videoController.videoPlayerShare = ^{ | |
| 313 | - __strong typeof(self) strongSelf = weakSelf; | |
| 314 | - [strongSelf shareButtonTaped:strongSelf->_shareButton]; | |
| 315 | - }; | |
| 316 | - self.videoController.videoPlayerGoBackBlock = ^{ | |
| 317 | - __strong typeof(self) strongSelf = weakSelf; | |
| 318 | - [[NSUserDefaults standardUserDefaults] setObject:@0 forKey:@"ZXVideoPlayer_DidLockScreen"]; | |
| 319 | - strongSelf.videoController = nil; | |
| 320 | - [strongSelf Pop:nil]; | |
| 321 | - }; | |
| 322 | - self.liveController.delegate = self; | |
| 323 | - [self.videoController showInView:self.view]; | |
| 324 | - } | |
| 325 | - ZXVideo *video = [[ZXVideo alloc] init]; | |
| 326 | - video.playUrl = url; | |
| 327 | - video.title = _dictionary[@"title"]; | |
| 328 | - self.videoController.video = video; | |
| 329 | -} | |
| 330 | - | |
| 331 | 306 | // CNLivePlayer |
| 332 | 307 | - (void)addCNLivePlayerWithURL:(NSURL *)videoUrl { |
| 333 | 308 | if (!self.liveController) { |
| ... | ... | @@ -356,6 +331,13 @@ |
| 356 | 331 | self.liveController.delegate = self; |
| 357 | 332 | |
| 358 | 333 | } |
| 334 | + MJWeakSelf | |
| 335 | + self.liveController.videoPlayerWillChangeToFullScreenModeBlock = ^{ | |
| 336 | + weakSelf.navigationController.interactivePopGestureRecognizer.enabled = NO; | |
| 337 | + }; | |
| 338 | + self.liveController.videoPlayerWillChangeToOriginalScreenModeBlock = ^{ | |
| 339 | + weakSelf.navigationController.interactivePopGestureRecognizer.enabled = YES; | |
| 340 | + }; | |
| 359 | 341 | ZXVideo *video = [[ZXVideo alloc] init]; |
| 360 | 342 | video.title = _dictionary[@"title"]; |
| 361 | 343 | self.liveController.video = video; | ... | ... |