Commit 8ed365b8108f39f50dc6912e1d1bdb8c2b08b274

Authored by “张旭”
1 parent 925cdc0d

完善横竖屏点播页 限制录屏逻辑

push点播页时增加loading ,防止多次点击
深色模式--点播页详情展开黑色问题 ,tabbar边缘黑色问题
metaCode.xcodeproj/project.pbxproj
@@ -2956,7 +2956,7 @@ @@ -2956,7 +2956,7 @@
2956 CODE_SIGN_ENTITLEMENTS = metaCode/metaCode.entitlements; 2956 CODE_SIGN_ENTITLEMENTS = metaCode/metaCode.entitlements;
2957 CODE_SIGN_IDENTITY = "Apple Development"; 2957 CODE_SIGN_IDENTITY = "Apple Development";
2958 CODE_SIGN_STYLE = Automatic; 2958 CODE_SIGN_STYLE = Automatic;
2959 - CURRENT_PROJECT_VERSION = 1.1.6.25.04.24.19; 2959 + CURRENT_PROJECT_VERSION = 1.1.7.25.04.25.16;
2960 DEBUG_INFORMATION_FORMAT = dwarf; 2960 DEBUG_INFORMATION_FORMAT = dwarf;
2961 DEVELOPMENT_TEAM = 94X49GG3ZW; 2961 DEVELOPMENT_TEAM = 94X49GG3ZW;
2962 ENABLE_BITCODE = NO; 2962 ENABLE_BITCODE = NO;
@@ -3029,7 +3029,7 @@ @@ -3029,7 +3029,7 @@
3029 "$(inherited)", 3029 "$(inherited)",
3030 "@executable_path/Frameworks", 3030 "@executable_path/Frameworks",
3031 ); 3031 );
3032 - MARKETING_VERSION = 1.1.6; 3032 + MARKETING_VERSION = 1.1.7;
3033 OTHER_LDFLAGS = ( 3033 OTHER_LDFLAGS = (
3034 "$(inherited)", 3034 "$(inherited)",
3035 "-all_load", 3035 "-all_load",
@@ -3212,7 +3212,7 @@ @@ -3212,7 +3212,7 @@
3212 CODE_SIGN_ENTITLEMENTS = metaCode/metaCode.entitlements; 3212 CODE_SIGN_ENTITLEMENTS = metaCode/metaCode.entitlements;
3213 CODE_SIGN_IDENTITY = "Apple Development"; 3213 CODE_SIGN_IDENTITY = "Apple Development";
3214 CODE_SIGN_STYLE = Automatic; 3214 CODE_SIGN_STYLE = Automatic;
3215 - CURRENT_PROJECT_VERSION = 1.1.6.25.04.24.19; 3215 + CURRENT_PROJECT_VERSION = 1.1.7.25.04.25.16;
3216 DEVELOPMENT_TEAM = 94X49GG3ZW; 3216 DEVELOPMENT_TEAM = 94X49GG3ZW;
3217 ENABLE_BITCODE = NO; 3217 ENABLE_BITCODE = NO;
3218 ENABLE_MODULE_VERIFIER = NO; 3218 ENABLE_MODULE_VERIFIER = NO;
@@ -3284,7 +3284,7 @@ @@ -3284,7 +3284,7 @@
3284 "$(inherited)", 3284 "$(inherited)",
3285 "@executable_path/Frameworks", 3285 "@executable_path/Frameworks",
3286 ); 3286 );
3287 - MARKETING_VERSION = 1.1.6; 3287 + MARKETING_VERSION = 1.1.7;
3288 OTHER_LDFLAGS = ( 3288 OTHER_LDFLAGS = (
3289 "$(inherited)", 3289 "$(inherited)",
3290 "-all_load", 3290 "-all_load",
metaCode/Classes/Common/Base/CNLiveBaseTabBarViewController.swift
@@ -81,8 +81,8 @@ class CNLiveBaseTabBarViewController: UITabBarController @@ -81,8 +81,8 @@ class CNLiveBaseTabBarViewController: UITabBarController
81 if #available(iOS 13.0, *) { 81 if #available(iOS 13.0, *) {
82 let appearance: UITabBarAppearance = UITabBarAppearance.init() 82 let appearance: UITabBarAppearance = UITabBarAppearance.init()
83 appearance.configureWithTransparentBackground() 83 appearance.configureWithTransparentBackground()
84 - appearance.backgroundColor = UIColor.clear  
85 - appearance.backgroundImage = UIImage(named: "tabbar_backgroup") 84 + appearance.backgroundColor = UIColor.white
  85 +// appearance.backgroundImage = UIImage(named: "tabbar_backgroup")
86 if #available(iOS 15.0, *) { 86 if #available(iOS 15.0, *) {
87 tabBar.scrollEdgeAppearance = appearance 87 tabBar.scrollEdgeAppearance = appearance
88 } else { 88 } else {
@@ -91,8 +91,8 @@ class CNLiveBaseTabBarViewController: UITabBarController @@ -91,8 +91,8 @@ class CNLiveBaseTabBarViewController: UITabBarController
91 } 91 }
92 92
93 } else { 93 } else {
94 - tabBar.backgroundColor = .clear  
95 - tabBar.backgroundImage = UIImage(named: "tabbar_backgroup") 94 + tabBar.backgroundColor = .white
  95 +// tabBar.backgroundImage = UIImage(named: "tabbar_backgroup")
96 } 96 }
97 } 97 }
98 98
metaCode/Classes/Config/CNLiveConfigMacro.swift
@@ -28,6 +28,7 @@ let keyWindow = UIApplication.shared.keyWindow @@ -28,6 +28,7 @@ let keyWindow = UIApplication.shared.keyWindow
28 let appDelegate = UIApplication.shared.delegate 28 let appDelegate = UIApplication.shared.delegate
29 let userDefaults = UserDefaults.standard 29 let userDefaults = UserDefaults.standard
30 let notificationCenter = NotificationCenter.default 30 let notificationCenter = NotificationCenter.default
  31 +let metaAppDelegate = UIApplication.shared.delegate as! AppDelegate
31 32
32 33
33 // MARK: - 打印输出 34 // MARK: - 打印输出
metaCode/Classes/Main/HuBiLieHomePage/Controller/CNLiveTVPlayerViewController.swift
@@ -168,10 +168,12 @@ class CNLiveTVPlayerViewController:UIViewController, UITableViewDataSource, UITa @@ -168,10 +168,12 @@ class CNLiveTVPlayerViewController:UIViewController, UITableViewDataSource, UITa
168 168
169 override func viewDidAppear(_ animated: Bool) { 169 override func viewDidAppear(_ animated: Bool) {
170 super.viewDidAppear(animated) 170 super.viewDidAppear(animated)
  171 + self.handleScreenCaptureChange()
171 navigationController?.interactivePopGestureRecognizer?.isEnabled = false 172 navigationController?.interactivePopGestureRecognizer?.isEnabled = false
172 } 173 }
173 override func viewDidDisappear(_ animated: Bool) { 174 override func viewDidDisappear(_ animated: Bool) {
174 super.viewDidDisappear(animated) 175 super.viewDidDisappear(animated)
  176 + print("1111111viewDidDisappear:\(metaAppDelegate.isCaptured)")
175 self.player.currentPlayerManager.pause() 177 self.player.currentPlayerManager.pause()
176 // 恢复手势识别 178 // 恢复手势识别
177 // self.navigationController?.interactivePopGestureRecognizer?.isEnabled = true 179 // self.navigationController?.interactivePopGestureRecognizer?.isEnabled = true
@@ -263,44 +265,112 @@ class CNLiveTVPlayerViewController:UIViewController, UITableViewDataSource, UITa @@ -263,44 +265,112 @@ class CNLiveTVPlayerViewController:UIViewController, UITableViewDataSource, UITa
263 } 265 }
264 266
265 @objc func appDidEnterBackground() { 267 @objc func appDidEnterBackground() {
266 - self.player.currentPlayerManager.pause() 268 + self.pausePlayerIfNeed()
267 } 269 }
268 @objc func appDidEnterPlayGround() { 270 @objc func appDidEnterPlayGround() {
  271 + self.playPlayerIfNeed()
  272 + }
  273 + func pausePlayerIfNeed(){
  274 + //如果录屏中 或后台 暂停
  275 + self.player.currentPlayerManager.pause()
  276 + }
  277 + func playPlayerIfNeed(){
  278 + //如果没录屏 且 当前不是需要付费内容 可以播放
269 if !self.currentPlayIsNeedPay{ 279 if !self.currentPlayIsNeedPay{
270 self.player.currentPlayerManager.play() 280 self.player.currentPlayerManager.play()
271 } 281 }
272 } 282 }
  283 +
273 // 响应录屏状态变化 284 // 响应录屏状态变化
  285 +// func playHandleScreenCaptureChange(isFullScreen:Bool) {
  286 +// if isFullScreen{
  287 +// if metaAppDelegate.isCaptured {
  288 +// hidePrivacyProtection()
  289 +//
  290 +// let blurView = UIVisualEffectView(effect: UIBlurEffect(style: .regular))
  291 +// blurView.frame = self.controlView.landScapeControlView.bounds
  292 +// blurView.tag = 10001
  293 +// self.controlView.landScapeControlView.addSubview(blurView)
  294 +//
  295 +// let vc = self.controlView.landScapeControlView.viewController
  296 +// if let preVC = vc?.presentedViewController as? UIAlertController {
  297 +// vc?.dismiss(animated: false)
  298 +// }
  299 +// // 显示警告提示
  300 +// let alert = UIAlertController(
  301 +// title: "录屏已开启",
  302 +// message: "当前功能禁止屏幕录制",
  303 +// preferredStyle: .alert
  304 +// )
  305 +// vc?.present(alert, animated: false)
  306 +// } else {
  307 +// hidePrivacyProtection()
  308 +// }
  309 +//
  310 +// }else{
  311 +// self.handleScreenCaptureChange()
  312 +// }
  313 +//
  314 +// }
274 @objc private func handleScreenCaptureChange() { 315 @objc private func handleScreenCaptureChange() {
275 - if UIScreen.main.isCaptured { 316 + if metaAppDelegate.isCaptured {
276 showPrivacyProtection() 317 showPrivacyProtection()
277 - self.player.allowOrentitaionRotation = false  
278 } else { 318 } else {
279 hidePrivacyProtection() 319 hidePrivacyProtection()
280 - self.player.allowOrentitaionRotation = true  
281 } 320 }
282 } 321 }
283 // 显示保护层(模糊效果) 322 // 显示保护层(模糊效果)
284 private func showPrivacyProtection() { 323 private func showPrivacyProtection() {
285 - let blurView = UIVisualEffectView(effect: UIBlurEffect(style: .regular))  
286 - blurView.frame = view.bounds  
287 - view.addSubview(blurView) 324 + self.hidePrivacyProtection()
  325 +
  326 + if self.player.isFullScreen{
  327 + //全屏 横屏
  328 + let blurView = UIVisualEffectView(effect: UIBlurEffect(style: .regular))
  329 + blurView.frame = self.controlView.landScapeControlView.bounds
  330 + blurView.tag = 10001
  331 + self.controlView.landScapeControlView.addSubview(blurView)
  332 +
  333 + let vc = self.controlView.landScapeControlView.viewController
  334 + if let preVC = vc?.presentedViewController as? UIAlertController {
  335 + vc?.dismiss(animated: false)
  336 + }
  337 + // 显示警告提示
  338 + let alert = UIAlertController(
  339 + title: "录屏已开启",
  340 + message: "当前功能禁止屏幕录制",
  341 + preferredStyle: .alert
  342 + )
  343 + vc?.present(alert, animated: false)
  344 + }else{
  345 + //竖屏
  346 + let blurView = UIVisualEffectView(effect: UIBlurEffect(style: .regular))
  347 + blurView.frame = view.bounds
  348 + blurView.tag = 10001
  349 + view.addSubview(blurView)
  350 +
  351 + // 显示警告提示
  352 + let alert = UIAlertController(
  353 + title: "录屏已开启",
  354 + message: "当前功能禁止屏幕录制",
  355 + preferredStyle: .alert
  356 + )
  357 + present(alert, animated: false)
  358 + }
288 359
289 - // 显示警告提示  
290 - let alert = UIAlertController(  
291 - title: "录屏已开启",  
292 - message: "当前功能禁止屏幕录制",  
293 - preferredStyle: .alert  
294 - )  
295 - present(alert, animated: true)  
296 } 360 }
297 361
298 // 移除保护层 362 // 移除保护层
299 private func hidePrivacyProtection() { 363 private func hidePrivacyProtection() {
300 - view.subviews  
301 - .filter { $0 is UIVisualEffectView }  
302 - .forEach { $0.removeFromSuperview() }  
303 - dismiss(animated: true) {} 364 + view.viewWithTag(10001)?.removeFromSuperview()
  365 + self.controlView.landScapeControlView.viewWithTag(10001)?.removeFromSuperview()
  366 + if let preVC = self.presentedViewController as? UIAlertController {
  367 + self.dismiss(animated: false)
  368 + }
  369 +
  370 + let vc = self.controlView.landScapeControlView.viewController
  371 + if let preVC = vc?.presentedViewController as? UIAlertController {
  372 + vc?.dismiss(animated: false)
  373 + }
304 } 374 }
305 375
306 376
@@ -414,7 +484,8 @@ class CNLiveTVPlayerViewController:UIViewController, UITableViewDataSource, UITa @@ -414,7 +484,8 @@ class CNLiveTVPlayerViewController:UIViewController, UITableViewDataSource, UITa
414 484
415 self.player.orientationDidChanged = {[weak self] player,isFullScreen in 485 self.player.orientationDidChanged = {[weak self] player,isFullScreen in
416 guard let self = self else { return } 486 guard let self = self else { return }
417 - 487 + self.handleScreenCaptureChange()
  488 +// self.playHandleScreenCaptureChange(isFullScreen: isFullScreen)
418 } 489 }
419 var endAssetURL:URL? 490 var endAssetURL:URL?
420 /// 播放完成 491 /// 播放完成
@@ -1674,6 +1745,7 @@ class CNLiveTVPlayerViewController:UIViewController, UITableViewDataSource, UITa @@ -1674,6 +1745,7 @@ class CNLiveTVPlayerViewController:UIViewController, UITableViewDataSource, UITa
1674 1745
1675 let descLbl = UITextView() 1746 let descLbl = UITextView()
1676 descLbl.font = Font_13 1747 descLbl.font = Font_13
  1748 + descLbl.backgroundColor = .white
1677 descLbl.textColor = HexColor("#999999") 1749 descLbl.textColor = HexColor("#999999")
1678 descLbl.text = vodMdl.desc 1750 descLbl.text = vodMdl.desc
1679 descLbl.width = KSreenWidth-20 1751 descLbl.width = KSreenWidth-20
metaCode/Classes/Main/HuBiLieHomePage/Util/CNLiveDownSlideTool.swift
@@ -13,7 +13,7 @@ typealias downSlideVodResultBlock = (_ vodPlayModel:CNLiveVodPlayModel,_ content @@ -13,7 +13,7 @@ typealias downSlideVodResultBlock = (_ vodPlayModel:CNLiveVodPlayModel,_ content
13 class CNLiveDownSlideTool:NSObject{ 13 class CNLiveDownSlideTool:NSObject{
14 14
15 class func pushWebVCWithContentsMdl(model:String,contentId:String,pid:String,shareUrl:String,thirdUrl:String,title:String,s_to:String,trailerId:String,controller:UIViewController?,slideModel:CNLiveDownSlideModel?){//contentMdl:CNLiveDownSlideContentsModel 15 class func pushWebVCWithContentsMdl(model:String,contentId:String,pid:String,shareUrl:String,thirdUrl:String,title:String,s_to:String,trailerId:String,controller:UIViewController?,slideModel:CNLiveDownSlideModel?){//contentMdl:CNLiveDownSlideContentsModel
16 - 16 + showLoading(message: "")
17 if (model == kCNDownSlideContentsModelModel1) { 17 if (model == kCNDownSlideContentsModelModel1) {
18 18
19 let queryItem = URLQueryItem(name: "contentId", value: contentId) 19 let queryItem = URLQueryItem(name: "contentId", value: contentId)
@@ -28,6 +28,7 @@ class CNLiveDownSlideTool:NSObject{ @@ -28,6 +28,7 @@ class CNLiveDownSlideTool:NSObject{
28 }else{ 28 }else{
29 navigationViewController().visibleViewController?.navigationController?.pushViewController(webVC, animated: pushAnimated) 29 navigationViewController().visibleViewController?.navigationController?.pushViewController(webVC, animated: pushAnimated)
30 } 30 }
  31 + hiddenLoading()
31 }else if (model == kCNDownSlideContentsModelModel2){ 32 }else if (model == kCNDownSlideContentsModelModel2){
32 33
33 let queryItem = URLQueryItem(name: "contentId", value: contentId) 34 let queryItem = URLQueryItem(name: "contentId", value: contentId)
@@ -44,6 +45,7 @@ class CNLiveDownSlideTool:NSObject{ @@ -44,6 +45,7 @@ class CNLiveDownSlideTool:NSObject{
44 }else{ 45 }else{
45 navigationViewController().visibleViewController?.navigationController?.pushViewController(webVC, animated: pushAnimated) 46 navigationViewController().visibleViewController?.navigationController?.pushViewController(webVC, animated: pushAnimated)
46 } 47 }
  48 + hiddenLoading()
47 }else if (model == kCNDownSlideContentsModelModel3) || (model == kCNDownSlideContentsModelModel4){ 49 }else if (model == kCNDownSlideContentsModelModel3) || (model == kCNDownSlideContentsModelModel4){
48 let webVC = CNWebViewController() 50 let webVC = CNWebViewController()
49 // webVC.url = URL(string: "http://wjjh5.cnlive.com/cnBlockMore.html?channelName=yjzg&pageId=&isShowTitle=true&blockType=28&contentType=13&title=%E5%9B%AD%E9%95%BF%E8%AF%BE%E7%A8%8B&pageName=&moreUrl=https%3A%2F%2Fcmsapi.cnlive.com%2FcontentApi%2FgetBlockContents%3FblockId%3D12165")//"https://managemall.cnlive.com/html/mall/1/#/pages/main/goodsList/goodsList?scene=app") 51 // webVC.url = URL(string: "http://wjjh5.cnlive.com/cnBlockMore.html?channelName=yjzg&pageId=&isShowTitle=true&blockType=28&contentType=13&title=%E5%9B%AD%E9%95%BF%E8%AF%BE%E7%A8%8B&pageName=&moreUrl=https%3A%2F%2Fcmsapi.cnlive.com%2FcontentApi%2FgetBlockContents%3FblockId%3D12165")//"https://managemall.cnlive.com/html/mall/1/#/pages/main/goodsList/goodsList?scene=app")
@@ -53,6 +55,7 @@ class CNLiveDownSlideTool:NSObject{ @@ -53,6 +55,7 @@ class CNLiveDownSlideTool:NSObject{
53 }else{ 55 }else{
54 navigationViewController().visibleViewController?.navigationController?.pushViewController(webVC, animated: pushAnimated) 56 navigationViewController().visibleViewController?.navigationController?.pushViewController(webVC, animated: pushAnimated)
55 } 57 }
  58 + hiddenLoading()
56 }else if (model == kCNDownSlideContentsModelModelAlbum){ 59 }else if (model == kCNDownSlideContentsModelModelAlbum){
57 60
58 let urlString = "http://wjjh5.cnlive.com/cnYmAlbumVideoList.html" 61 let urlString = "http://wjjh5.cnlive.com/cnYmAlbumVideoList.html"
@@ -68,6 +71,7 @@ class CNLiveDownSlideTool:NSObject{ @@ -68,6 +71,7 @@ class CNLiveDownSlideTool:NSObject{
68 }else{ 71 }else{
69 navigationViewController().visibleViewController?.navigationController?.pushViewController(webVC, animated: pushAnimated) 72 navigationViewController().visibleViewController?.navigationController?.pushViewController(webVC, animated: pushAnimated)
70 } 73 }
  74 + hiddenLoading()
71 }else if (model == kCNDownSlideContentsModelModelAlbum_video){ 75 }else if (model == kCNDownSlideContentsModelModelAlbum_video){
72 let urlString = "http://wjjh5.cnlive.com/cnYjzgAlbumVideo.html" 76 let urlString = "http://wjjh5.cnlive.com/cnYjzgAlbumVideo.html"
73 let queryItem = URLQueryItem(name: "aid", value: contentId) 77 let queryItem = URLQueryItem(name: "aid", value: contentId)
@@ -85,6 +89,7 @@ class CNLiveDownSlideTool:NSObject{ @@ -85,6 +89,7 @@ class CNLiveDownSlideTool:NSObject{
85 }else{ 89 }else{
86 navigationViewController().visibleViewController?.navigationController?.pushViewController(webVC, animated: pushAnimated) 90 navigationViewController().visibleViewController?.navigationController?.pushViewController(webVC, animated: pushAnimated)
87 } 91 }
  92 + hiddenLoading()
88 }else if (model == kCNDownSlideContentsModelModelAlbum_ugc){ 93 }else if (model == kCNDownSlideContentsModelModelAlbum_ugc){
89 showLoading(message: "") 94 showLoading(message: "")
90 self.pushShortVideoController(contentId: contentId, navigationVC: navigationViewController().visibleViewController?.navigationController, slideModel: slideModel) 95 self.pushShortVideoController(contentId: contentId, navigationVC: navigationViewController().visibleViewController?.navigationController, slideModel: slideModel)
@@ -103,6 +108,7 @@ class CNLiveDownSlideTool:NSObject{ @@ -103,6 +108,7 @@ class CNLiveDownSlideTool:NSObject{
103 } else { 108 } else {
104 print("无法将字符串转换为数据") 109 print("无法将字符串转换为数据")
105 } 110 }
  111 + hiddenLoading()
106 }else if (model == kCNDownSlideContentsModelModelProduct){ 112 }else if (model == kCNDownSlideContentsModelModelProduct){
107 //电商h5--跳转商品页 113 //电商h5--跳转商品页
108 // let urlString = "https://managemall.cnlive.com/html/mall/1/#/pages/main/detail/detail?"+"id=\(contentId)&uid=\(UserInfoManager.shared.userInfo.uid)" 114 // let urlString = "https://managemall.cnlive.com/html/mall/1/#/pages/main/detail/detail?"+"id=\(contentId)&uid=\(UserInfoManager.shared.userInfo.uid)"
@@ -115,6 +121,7 @@ class CNLiveDownSlideTool:NSObject{ @@ -115,6 +121,7 @@ class CNLiveDownSlideTool:NSObject{
115 }else{ 121 }else{
116 navigationViewController().visibleViewController?.navigationController?.pushViewController(webVC, animated: pushAnimated) 122 navigationViewController().visibleViewController?.navigationController?.pushViewController(webVC, animated: pushAnimated)
117 } 123 }
  124 + hiddenLoading()
118 125
119 }else{ 126 }else{
120 return 127 return
@@ -124,6 +131,7 @@ class CNLiveDownSlideTool:NSObject{ @@ -124,6 +131,7 @@ class CNLiveDownSlideTool:NSObject{
124 class func pushShortVideoController(contentId:String,navigationVC:UINavigationController?,slideModel:CNLiveDownSlideModel?){ 131 class func pushShortVideoController(contentId:String,navigationVC:UINavigationController?,slideModel:CNLiveDownSlideModel?){
125 //请求getAlbumMsg获取上次播放集数 132 //请求getAlbumMsg获取上次播放集数
126 //获取专辑详情(简介等) 133 //获取专辑详情(简介等)
  134 + showLoading(message: "")
127 CNLiveHomePageViewModel.getAlbumMsg(aid: contentId) { result, status in 135 CNLiveHomePageViewModel.getAlbumMsg(aid: contentId) { result, status in
128 hiddenLoading() 136 hiddenLoading()
129 if status == .success{ 137 if status == .success{
@@ -141,6 +149,7 @@ class CNLiveDownSlideTool:NSObject{ @@ -141,6 +149,7 @@ class CNLiveDownSlideTool:NSObject{
141 class func pushShortVideoController(aid:String,page: NSInteger, currentIndex: NSInteger, dataArray: [CNLiveAlbumListModel],navigationVC:UINavigationController?){ 149 class func pushShortVideoController(aid:String,page: NSInteger, currentIndex: NSInteger, dataArray: [CNLiveAlbumListModel],navigationVC:UINavigationController?){
142 //请求getAlbumMsg获取上次播放集数 150 //请求getAlbumMsg获取上次播放集数
143 //获取专辑详情(简介等) 151 //获取专辑详情(简介等)
  152 + showLoading(message: "")
144 CNLiveHomePageViewModel.getAlbumMsg(aid: aid) { result, status in 153 CNLiveHomePageViewModel.getAlbumMsg(aid: aid) { result, status in
145 hiddenLoading() 154 hiddenLoading()
146 if status == .success{ 155 if status == .success{
@@ -160,7 +169,7 @@ class CNLiveDownSlideTool:NSObject{ @@ -160,7 +169,7 @@ class CNLiveDownSlideTool:NSObject{
160 169
161 // MARK: - 跳转点播或者h5 170 // MARK: - 跳转点播或者h5
162 class func pushWebAndVodVCWithContentsMdl(model:String,contentId:String,pid:String,shareUrl:String,thirdUrl:String,title:String,s_to:String,trailerId:String,controller:UIViewController?,slideModel:CNLiveDownSlideModel?){//contentMdl:CNLiveDownSlideContentsModel 171 class func pushWebAndVodVCWithContentsMdl(model:String,contentId:String,pid:String,shareUrl:String,thirdUrl:String,title:String,s_to:String,trailerId:String,controller:UIViewController?,slideModel:CNLiveDownSlideModel?){//contentMdl:CNLiveDownSlideContentsModel
163 - 172 + showLoading(message: "")
164 if (model == kCNDownSlideContentsModelModel1) {//点播-单集 173 if (model == kCNDownSlideContentsModelModel1) {//点播-单集
165 self.pushVodController(contentId: contentId, navigationVC: navigationViewController().visibleViewController?.navigationController, isAblumVideo: false) 174 self.pushVodController(contentId: contentId, navigationVC: navigationViewController().visibleViewController?.navigationController, isAblumVideo: false)
166 175
@@ -174,6 +183,7 @@ class CNLiveDownSlideTool:NSObject{ @@ -174,6 +183,7 @@ class CNLiveDownSlideTool:NSObject{
174 let regURL = urlComponents.url 183 let regURL = urlComponents.url
175 let webVC = CNWebViewController() 184 let webVC = CNWebViewController()
176 webVC.url = regURL 185 webVC.url = regURL
  186 + hiddenLoading()
177 if controller != nil{ 187 if controller != nil{
178 controller!.navigationController?.pushViewController(webVC, animated: pushAnimated) 188 controller!.navigationController?.pushViewController(webVC, animated: pushAnimated)
179 }else{ 189 }else{
@@ -188,6 +198,7 @@ class CNLiveDownSlideTool:NSObject{ @@ -188,6 +198,7 @@ class CNLiveDownSlideTool:NSObject{
188 }else{ 198 }else{
189 navigationViewController().visibleViewController?.navigationController?.pushViewController(webVC, animated: pushAnimated) 199 navigationViewController().visibleViewController?.navigationController?.pushViewController(webVC, animated: pushAnimated)
190 } 200 }
  201 + hiddenLoading()
191 }else if (model == kCNDownSlideContentsModelModelAlbum_video){ 202 }else if (model == kCNDownSlideContentsModelModelAlbum_video){
192 //点播-专辑 203 //点播-专辑
193 self.pushVodController(albumId: contentId, navigationVC: navigationViewController().visibleViewController?.navigationController) 204 self.pushVodController(albumId: contentId, navigationVC: navigationViewController().visibleViewController?.navigationController)
@@ -208,6 +219,7 @@ class CNLiveDownSlideTool:NSObject{ @@ -208,6 +219,7 @@ class CNLiveDownSlideTool:NSObject{
208 }else{ 219 }else{
209 navigationViewController().visibleViewController?.navigationController?.pushViewController(webVC, animated: pushAnimated) 220 navigationViewController().visibleViewController?.navigationController?.pushViewController(webVC, animated: pushAnimated)
210 } 221 }
  222 + hiddenLoading()
211 }else if (model == kCNDownSlideContentsModelModelAlbum){ 223 }else if (model == kCNDownSlideContentsModelModelAlbum){
212 let urlString = "http://wjjh5.cnlive.com/cnYjzgAlbumVideo.html" 224 let urlString = "http://wjjh5.cnlive.com/cnYjzgAlbumVideo.html"
213 let queryItem = URLQueryItem(name: "aid", value: contentId) 225 let queryItem = URLQueryItem(name: "aid", value: contentId)
@@ -225,10 +237,12 @@ class CNLiveDownSlideTool:NSObject{ @@ -225,10 +237,12 @@ class CNLiveDownSlideTool:NSObject{
225 }else{ 237 }else{
226 navigationViewController().visibleViewController?.navigationController?.pushViewController(webVC, animated: pushAnimated) 238 navigationViewController().visibleViewController?.navigationController?.pushViewController(webVC, animated: pushAnimated)
227 } 239 }
  240 + hiddenLoading()
228 }else if (model == kCNDownSlideContentsModelModelAlbum_ugc){ 241 }else if (model == kCNDownSlideContentsModelModelAlbum_ugc){
229 showLoading(message: "") 242 showLoading(message: "")
230 self.pushShortVideoController(contentId: contentId, navigationVC: navigationViewController().visibleViewController?.navigationController, slideModel: slideModel) 243 self.pushShortVideoController(contentId: contentId, navigationVC: navigationViewController().visibleViewController?.navigationController, slideModel: slideModel)
231 }else if model == kCNDownSlideContentsModelModelServing{ 244 }else if model == kCNDownSlideContentsModelModelServing{
  245 + hiddenLoading()
232 //跳转微信小程序 246 //跳转微信小程序
233 if let data = s_to.data(using: .utf8) { 247 if let data = s_to.data(using: .utf8) {
234 do { 248 do {
metaCode/Classes/Main/HuBiLieHomePage/View/Home/Home/CNLiveHomeADCell.swift
@@ -180,6 +180,7 @@ class CNLiveHomeADCell: UITableViewCell ,FSPagerViewDataSource,FSPagerViewDelega @@ -180,6 +180,7 @@ class CNLiveHomeADCell: UITableViewCell ,FSPagerViewDataSource,FSPagerViewDelega
180 return 180 return
181 } 181 }
182 if let bannerMdl = self.slideModel?.contents[index]{ 182 if let bannerMdl = self.slideModel?.contents[index]{
  183 +
183 CNLiveDownSlideTool.pushWebAndVodVCWithContentsMdl(model: bannerMdl.model, contentId: bannerMdl.contentId, pid: bannerMdl.pid, shareUrl: bannerMdl.shareUrl, thirdUrl: bannerMdl.thirdUrl, title: bannerMdl.title, s_to: bannerMdl.s_to, trailerId: bannerMdl.trailerId, controller: navigationViewController().visibleViewController, slideModel: nil) 184 CNLiveDownSlideTool.pushWebAndVodVCWithContentsMdl(model: bannerMdl.model, contentId: bannerMdl.contentId, pid: bannerMdl.pid, shareUrl: bannerMdl.shareUrl, thirdUrl: bannerMdl.thirdUrl, title: bannerMdl.title, s_to: bannerMdl.s_to, trailerId: bannerMdl.trailerId, controller: navigationViewController().visibleViewController, slideModel: nil)
184 } 185 }
185 // if bannerMdl?.model == "1" || bannerMdl?.model == "album_video"{ 186 // if bannerMdl?.model == "1" || bannerMdl?.model == "album_video"{
metaCode/Classes/Main/HuBiLieHomePage/View/Home/Home/CNLiveHomeOneBigTwoSmallCell.swift
@@ -548,6 +548,7 @@ class CNLiveHomeOneBigTwoSmallCell:UITableViewCell{ @@ -548,6 +548,7 @@ class CNLiveHomeOneBigTwoSmallCell:UITableViewCell{
548 let imageView = ges.view as! UIImageView 548 let imageView = ges.view as! UIImageView
549 let i = imageView.tag-1000 549 let i = imageView.tag-1000
550 if let contentMdl = self.slideModel?.contents[i]{ 550 if let contentMdl = self.slideModel?.contents[i]{
  551 +
551 CNLiveDownSlideTool.pushWebAndVodVCWithContentsMdl(model: contentMdl.model , contentId: contentMdl.contentId , pid: contentMdl.pid , shareUrl: contentMdl.shareUrl , thirdUrl: contentMdl.thirdUrl , title: contentMdl.title , s_to: contentMdl.s_to ,trailerId: contentMdl.trailerId , controller: nil, slideModel: nil) 552 CNLiveDownSlideTool.pushWebAndVodVCWithContentsMdl(model: contentMdl.model , contentId: contentMdl.contentId , pid: contentMdl.pid , shareUrl: contentMdl.shareUrl , thirdUrl: contentMdl.thirdUrl , title: contentMdl.title , s_to: contentMdl.s_to ,trailerId: contentMdl.trailerId , controller: nil, slideModel: nil)
552 } 553 }
553 } 554 }
@@ -560,6 +561,7 @@ class CNLiveHomeOneBigTwoSmallCell:UITableViewCell{ @@ -560,6 +561,7 @@ class CNLiveHomeOneBigTwoSmallCell:UITableViewCell{
560 currentViewController()?.navigationController?.pushViewController(vc, animated: true) 561 currentViewController()?.navigationController?.pushViewController(vc, animated: true)
561 }else if self.slideModel?.moreType == "3"{ 562 }else if self.slideModel?.moreType == "3"{
562 //webView moreurl 563 //webView moreurl
  564 +
563 CNLiveDownSlideTool.pushWebVCWithContentsMdl(model: "3", contentId: "", pid: "", shareUrl: "", thirdUrl: self.slideModel?.moreUrl ?? "", title: "", s_to: "", trailerId: "", controller: nil, slideModel: nil) 565 CNLiveDownSlideTool.pushWebVCWithContentsMdl(model: "3", contentId: "", pid: "", shareUrl: "", thirdUrl: self.slideModel?.moreUrl ?? "", title: "", s_to: "", trailerId: "", controller: nil, slideModel: nil)
564 }else{ 566 }else{
565 567
@@ -568,6 +570,7 @@ class CNLiveHomeOneBigTwoSmallCell:UITableViewCell{ @@ -568,6 +570,7 @@ class CNLiveHomeOneBigTwoSmallCell:UITableViewCell{
568 // MARK: - 点击视频 570 // MARK: - 点击视频
569 func iconImgViewAction(index:Int){ 571 func iconImgViewAction(index:Int){
570 if let bannerMdl = self.slideModel?.contents[index]{ 572 if let bannerMdl = self.slideModel?.contents[index]{
  573 +
571 CNLiveDownSlideTool.pushWebAndVodVCWithContentsMdl(model: bannerMdl.model, contentId: bannerMdl.contentId, pid: bannerMdl.pid, shareUrl: bannerMdl.shareUrl, thirdUrl: bannerMdl.thirdUrl, title: bannerMdl.title, s_to: bannerMdl.s_to, trailerId: bannerMdl.trailerId, controller: navigationViewController().visibleViewController, slideModel: nil) 574 CNLiveDownSlideTool.pushWebAndVodVCWithContentsMdl(model: bannerMdl.model, contentId: bannerMdl.contentId, pid: bannerMdl.pid, shareUrl: bannerMdl.shareUrl, thirdUrl: bannerMdl.thirdUrl, title: bannerMdl.title, s_to: bannerMdl.s_to, trailerId: bannerMdl.trailerId, controller: navigationViewController().visibleViewController, slideModel: nil)
572 } 575 }
573 } 576 }
metaCode/Classes/Main/HuBiLieHomePage/View/Home/Home/CNLiveHomeTwoDuanjuCell.swift
@@ -190,6 +190,7 @@ class CNLiveHomeTwoDuanjuCell:UITableViewCell{ @@ -190,6 +190,7 @@ class CNLiveHomeTwoDuanjuCell:UITableViewCell{
190 let imageView = ges.view as! UIImageView 190 let imageView = ges.view as! UIImageView
191 let i = imageView.tag-1000 191 let i = imageView.tag-1000
192 if let contentMdl = self.slideModel?.contents[i]{ 192 if let contentMdl = self.slideModel?.contents[i]{
  193 +
193 CNLiveDownSlideTool.pushWebAndVodVCWithContentsMdl(model: contentMdl.model , contentId: contentMdl.contentId , pid: contentMdl.pid , shareUrl: contentMdl.shareUrl , thirdUrl: contentMdl.thirdUrl , title: contentMdl.title , s_to: contentMdl.s_to ,trailerId: contentMdl.trailerId , controller: nil, slideModel: nil) 194 CNLiveDownSlideTool.pushWebAndVodVCWithContentsMdl(model: contentMdl.model , contentId: contentMdl.contentId , pid: contentMdl.pid , shareUrl: contentMdl.shareUrl , thirdUrl: contentMdl.thirdUrl , title: contentMdl.title , s_to: contentMdl.s_to ,trailerId: contentMdl.trailerId , controller: nil, slideModel: nil)
194 } 195 }
195 } 196 }
metaCode/Classes/Main/HuBiLieHomePage/View/Home/Home/CNLiveHomeYingshiBannerCell.swift
@@ -108,6 +108,7 @@ class CNLiveHomeYingshiBannerCell: UITableViewCell ,FSPagerViewDataSource,FSPage @@ -108,6 +108,7 @@ class CNLiveHomeYingshiBannerCell: UITableViewCell ,FSPagerViewDataSource,FSPage
108 return 108 return
109 } 109 }
110 if let bannerMdl = self.slideModel?.contents[index]{ 110 if let bannerMdl = self.slideModel?.contents[index]{
  111 +
111 CNLiveDownSlideTool.pushWebAndVodVCWithContentsMdl(model: bannerMdl.model, contentId: bannerMdl.contentId, pid: bannerMdl.pid, shareUrl: bannerMdl.shareUrl, thirdUrl: bannerMdl.thirdUrl, title: bannerMdl.title, s_to: bannerMdl.s_to, trailerId: bannerMdl.trailerId, controller: navigationViewController().visibleViewController, slideModel: nil) 112 CNLiveDownSlideTool.pushWebAndVodVCWithContentsMdl(model: bannerMdl.model, contentId: bannerMdl.contentId, pid: bannerMdl.pid, shareUrl: bannerMdl.shareUrl, thirdUrl: bannerMdl.thirdUrl, title: bannerMdl.title, s_to: bannerMdl.s_to, trailerId: bannerMdl.trailerId, controller: navigationViewController().visibleViewController, slideModel: nil)
112 } 113 }
113 // if bannerMdl?.model == "1" || bannerMdl?.model == "album_video"{ 114 // if bannerMdl?.model == "1" || bannerMdl?.model == "album_video"{
metaCode/Classes/Main/HuBiLieHomePage/View/Home/Lanmu/CNLiveHomeLanmuThreeImgCell.swift
@@ -107,6 +107,7 @@ class CNLiveHomeLanmuThreeImgCell: UITableViewCell { @@ -107,6 +107,7 @@ class CNLiveHomeLanmuThreeImgCell: UITableViewCell {
107 } 107 }
108 108
109 @objc func imgTapAction(ges: UITapGestureRecognizer){ 109 @objc func imgTapAction(ges: UITapGestureRecognizer){
  110 + showLoading(message: "")
110 let imageView = ges.view as! UIImageView 111 let imageView = ges.view as! UIImageView
111 let i = imageView.tag 112 let i = imageView.tag
112 if let contentMdl = self.slideModel?[i]{ 113 if let contentMdl = self.slideModel?[i]{
metaCode/Classes/Other/AppDelegate.swift
@@ -19,6 +19,7 @@ import ZFPlayer @@ -19,6 +19,7 @@ import ZFPlayer
19 @main 19 @main
20 class AppDelegate: UIResponder, UIApplicationDelegate { 20 class AppDelegate: UIResponder, UIApplicationDelegate {
21 var window: UIWindow? 21 var window: UIWindow?
  22 + var isCaptured = false //是否录屏中
22 23
23 // var orientationLock = UIInterfaceOrientationMask.allButUpsideDown // 默认支持方向 24 // var orientationLock = UIInterfaceOrientationMask.allButUpsideDown // 默认支持方向
24 // func application(_ application: UIApplication, supportedInterfaceOrientationsFor window: UIWindow?) -> UIInterfaceOrientationMask { 25 // func application(_ application: UIApplication, supportedInterfaceOrientationsFor window: UIWindow?) -> UIInterfaceOrientationMask {
@@ -27,6 +28,14 @@ class AppDelegate: UIResponder, UIApplicationDelegate { @@ -27,6 +28,14 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
27 28
28 func application(_ appUITableViewRowDatalication: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { 29 func application(_ appUITableViewRowDatalication: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
29 30
  31 + //录屏状态实时检测‌ 监听
  32 + NotificationCenter.default.addObserver(
  33 + self,
  34 + selector: #selector(handleScreenCaptureChange),
  35 + name: UIScreen.capturedDidChangeNotification,
  36 + object: nil
  37 + )
  38 +
30 JFHeroBrowserGlobalConfig.default.networkImageProvider = HeroNetworkImageProvider.shared 39 JFHeroBrowserGlobalConfig.default.networkImageProvider = HeroNetworkImageProvider.shared
31 40
32 // Override point for customization after application launch. 41 // Override point for customization after application launch.
@@ -161,7 +170,16 @@ class AppDelegate: UIResponder, UIApplicationDelegate { @@ -161,7 +170,16 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
161 170
162 } 171 }
163 172
164 - 173 + // MARK: - 响应录屏状态变化
  174 + @objc private func handleScreenCaptureChange() {
  175 + if UIScreen.main.isCaptured {
  176 + self.isCaptured = true
  177 + } else {
  178 + self.isCaptured = false
  179 + }
  180 + print("1111111appdelegateisCaptured:\(self.isCaptured) ")
  181 + }
  182 +
165 // MARK: - 键盘处理 183 // MARK: - 键盘处理
166 func AppDelegate_configIQKeyboardManager() { 184 func AppDelegate_configIQKeyboardManager() {
167 IQKeyboardManager.shared.enable = true 185 IQKeyboardManager.shared.enable = true