Commit 8ed365b8108f39f50dc6912e1d1bdb8c2b08b274

Authored by “张旭”
1 parent 925cdc0d

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

push点播页时增加loading ,防止多次点击
深色模式--点播页详情展开黑色问题 ,tabbar边缘黑色问题
metaCode.xcodeproj/project.pbxproj
... ... @@ -2956,7 +2956,7 @@
2956 2956 CODE_SIGN_ENTITLEMENTS = metaCode/metaCode.entitlements;
2957 2957 CODE_SIGN_IDENTITY = "Apple Development";
2958 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 2960 DEBUG_INFORMATION_FORMAT = dwarf;
2961 2961 DEVELOPMENT_TEAM = 94X49GG3ZW;
2962 2962 ENABLE_BITCODE = NO;
... ... @@ -3029,7 +3029,7 @@
3029 3029 "$(inherited)",
3030 3030 "@executable_path/Frameworks",
3031 3031 );
3032   - MARKETING_VERSION = 1.1.6;
  3032 + MARKETING_VERSION = 1.1.7;
3033 3033 OTHER_LDFLAGS = (
3034 3034 "$(inherited)",
3035 3035 "-all_load",
... ... @@ -3212,7 +3212,7 @@
3212 3212 CODE_SIGN_ENTITLEMENTS = metaCode/metaCode.entitlements;
3213 3213 CODE_SIGN_IDENTITY = "Apple Development";
3214 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 3216 DEVELOPMENT_TEAM = 94X49GG3ZW;
3217 3217 ENABLE_BITCODE = NO;
3218 3218 ENABLE_MODULE_VERIFIER = NO;
... ... @@ -3284,7 +3284,7 @@
3284 3284 "$(inherited)",
3285 3285 "@executable_path/Frameworks",
3286 3286 );
3287   - MARKETING_VERSION = 1.1.6;
  3287 + MARKETING_VERSION = 1.1.7;
3288 3288 OTHER_LDFLAGS = (
3289 3289 "$(inherited)",
3290 3290 "-all_load",
... ...
metaCode/Classes/Common/Base/CNLiveBaseTabBarViewController.swift
... ... @@ -81,8 +81,8 @@ class CNLiveBaseTabBarViewController: UITabBarController
81 81 if #available(iOS 13.0, *) {
82 82 let appearance: UITabBarAppearance = UITabBarAppearance.init()
83 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 86 if #available(iOS 15.0, *) {
87 87 tabBar.scrollEdgeAppearance = appearance
88 88 } else {
... ... @@ -91,8 +91,8 @@ class CNLiveBaseTabBarViewController: UITabBarController
91 91 }
92 92  
93 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 28 let appDelegate = UIApplication.shared.delegate
29 29 let userDefaults = UserDefaults.standard
30 30 let notificationCenter = NotificationCenter.default
  31 +let metaAppDelegate = UIApplication.shared.delegate as! AppDelegate
31 32  
32 33  
33 34 // MARK: - 打印输出
... ...
metaCode/Classes/Main/HuBiLieHomePage/Controller/CNLiveTVPlayerViewController.swift
... ... @@ -168,10 +168,12 @@ class CNLiveTVPlayerViewController:UIViewController, UITableViewDataSource, UITa
168 168  
169 169 override func viewDidAppear(_ animated: Bool) {
170 170 super.viewDidAppear(animated)
  171 + self.handleScreenCaptureChange()
171 172 navigationController?.interactivePopGestureRecognizer?.isEnabled = false
172 173 }
173 174 override func viewDidDisappear(_ animated: Bool) {
174 175 super.viewDidDisappear(animated)
  176 + print("1111111viewDidDisappear:\(metaAppDelegate.isCaptured)")
175 177 self.player.currentPlayerManager.pause()
176 178 // 恢复手势识别
177 179 // self.navigationController?.interactivePopGestureRecognizer?.isEnabled = true
... ... @@ -263,44 +265,112 @@ class CNLiveTVPlayerViewController:UIViewController, UITableViewDataSource, UITa
263 265 }
264 266  
265 267 @objc func appDidEnterBackground() {
266   - self.player.currentPlayerManager.pause()
  268 + self.pausePlayerIfNeed()
267 269 }
268 270 @objc func appDidEnterPlayGround() {
  271 + self.playPlayerIfNeed()
  272 + }
  273 + func pausePlayerIfNeed(){
  274 + //如果录屏中 或后台 暂停
  275 + self.player.currentPlayerManager.pause()
  276 + }
  277 + func playPlayerIfNeed(){
  278 + //如果没录屏 且 当前不是需要付费内容 可以播放
269 279 if !self.currentPlayIsNeedPay{
270 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 315 @objc private func handleScreenCaptureChange() {
275   - if UIScreen.main.isCaptured {
  316 + if metaAppDelegate.isCaptured {
276 317 showPrivacyProtection()
277   - self.player.allowOrentitaionRotation = false
278 318 } else {
279 319 hidePrivacyProtection()
280   - self.player.allowOrentitaionRotation = true
281 320 }
282 321 }
283 322 // 显示保护层(模糊效果)
284 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 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 484  
415 485 self.player.orientationDidChanged = {[weak self] player,isFullScreen in
416 486 guard let self = self else { return }
417   -
  487 + self.handleScreenCaptureChange()
  488 +// self.playHandleScreenCaptureChange(isFullScreen: isFullScreen)
418 489 }
419 490 var endAssetURL:URL?
420 491 /// 播放完成
... ... @@ -1674,6 +1745,7 @@ class CNLiveTVPlayerViewController:UIViewController, UITableViewDataSource, UITa
1674 1745  
1675 1746 let descLbl = UITextView()
1676 1747 descLbl.font = Font_13
  1748 + descLbl.backgroundColor = .white
1677 1749 descLbl.textColor = HexColor("#999999")
1678 1750 descLbl.text = vodMdl.desc
1679 1751 descLbl.width = KSreenWidth-20
... ...
metaCode/Classes/Main/HuBiLieHomePage/Util/CNLiveDownSlideTool.swift
... ... @@ -13,7 +13,7 @@ typealias downSlideVodResultBlock = (_ vodPlayModel:CNLiveVodPlayModel,_ content
13 13 class CNLiveDownSlideTool:NSObject{
14 14  
15 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 17 if (model == kCNDownSlideContentsModelModel1) {
18 18  
19 19 let queryItem = URLQueryItem(name: "contentId", value: contentId)
... ... @@ -28,6 +28,7 @@ class CNLiveDownSlideTool:NSObject{
28 28 }else{
29 29 navigationViewController().visibleViewController?.navigationController?.pushViewController(webVC, animated: pushAnimated)
30 30 }
  31 + hiddenLoading()
31 32 }else if (model == kCNDownSlideContentsModelModel2){
32 33  
33 34 let queryItem = URLQueryItem(name: "contentId", value: contentId)
... ... @@ -44,6 +45,7 @@ class CNLiveDownSlideTool:NSObject{
44 45 }else{
45 46 navigationViewController().visibleViewController?.navigationController?.pushViewController(webVC, animated: pushAnimated)
46 47 }
  48 + hiddenLoading()
47 49 }else if (model == kCNDownSlideContentsModelModel3) || (model == kCNDownSlideContentsModelModel4){
48 50 let webVC = CNWebViewController()
49 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 55 }else{
54 56 navigationViewController().visibleViewController?.navigationController?.pushViewController(webVC, animated: pushAnimated)
55 57 }
  58 + hiddenLoading()
56 59 }else if (model == kCNDownSlideContentsModelModelAlbum){
57 60  
58 61 let urlString = "http://wjjh5.cnlive.com/cnYmAlbumVideoList.html"
... ... @@ -68,6 +71,7 @@ class CNLiveDownSlideTool:NSObject{
68 71 }else{
69 72 navigationViewController().visibleViewController?.navigationController?.pushViewController(webVC, animated: pushAnimated)
70 73 }
  74 + hiddenLoading()
71 75 }else if (model == kCNDownSlideContentsModelModelAlbum_video){
72 76 let urlString = "http://wjjh5.cnlive.com/cnYjzgAlbumVideo.html"
73 77 let queryItem = URLQueryItem(name: "aid", value: contentId)
... ... @@ -85,6 +89,7 @@ class CNLiveDownSlideTool:NSObject{
85 89 }else{
86 90 navigationViewController().visibleViewController?.navigationController?.pushViewController(webVC, animated: pushAnimated)
87 91 }
  92 + hiddenLoading()
88 93 }else if (model == kCNDownSlideContentsModelModelAlbum_ugc){
89 94 showLoading(message: "")
90 95 self.pushShortVideoController(contentId: contentId, navigationVC: navigationViewController().visibleViewController?.navigationController, slideModel: slideModel)
... ... @@ -103,6 +108,7 @@ class CNLiveDownSlideTool:NSObject{
103 108 } else {
104 109 print("无法将字符串转换为数据")
105 110 }
  111 + hiddenLoading()
106 112 }else if (model == kCNDownSlideContentsModelModelProduct){
107 113 //电商h5--跳转商品页
108 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 121 }else{
116 122 navigationViewController().visibleViewController?.navigationController?.pushViewController(webVC, animated: pushAnimated)
117 123 }
  124 + hiddenLoading()
118 125  
119 126 }else{
120 127 return
... ... @@ -124,6 +131,7 @@ class CNLiveDownSlideTool:NSObject{
124 131 class func pushShortVideoController(contentId:String,navigationVC:UINavigationController?,slideModel:CNLiveDownSlideModel?){
125 132 //请求getAlbumMsg获取上次播放集数
126 133 //获取专辑详情(简介等)
  134 + showLoading(message: "")
127 135 CNLiveHomePageViewModel.getAlbumMsg(aid: contentId) { result, status in
128 136 hiddenLoading()
129 137 if status == .success{
... ... @@ -141,6 +149,7 @@ class CNLiveDownSlideTool:NSObject{
141 149 class func pushShortVideoController(aid:String,page: NSInteger, currentIndex: NSInteger, dataArray: [CNLiveAlbumListModel],navigationVC:UINavigationController?){
142 150 //请求getAlbumMsg获取上次播放集数
143 151 //获取专辑详情(简介等)
  152 + showLoading(message: "")
144 153 CNLiveHomePageViewModel.getAlbumMsg(aid: aid) { result, status in
145 154 hiddenLoading()
146 155 if status == .success{
... ... @@ -160,7 +169,7 @@ class CNLiveDownSlideTool:NSObject{
160 169  
161 170 // MARK: - 跳转点播或者h5
162 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 173 if (model == kCNDownSlideContentsModelModel1) {//点播-单集
165 174 self.pushVodController(contentId: contentId, navigationVC: navigationViewController().visibleViewController?.navigationController, isAblumVideo: false)
166 175  
... ... @@ -174,6 +183,7 @@ class CNLiveDownSlideTool:NSObject{
174 183 let regURL = urlComponents.url
175 184 let webVC = CNWebViewController()
176 185 webVC.url = regURL
  186 + hiddenLoading()
177 187 if controller != nil{
178 188 controller!.navigationController?.pushViewController(webVC, animated: pushAnimated)
179 189 }else{
... ... @@ -188,6 +198,7 @@ class CNLiveDownSlideTool:NSObject{
188 198 }else{
189 199 navigationViewController().visibleViewController?.navigationController?.pushViewController(webVC, animated: pushAnimated)
190 200 }
  201 + hiddenLoading()
191 202 }else if (model == kCNDownSlideContentsModelModelAlbum_video){
192 203 //点播-专辑
193 204 self.pushVodController(albumId: contentId, navigationVC: navigationViewController().visibleViewController?.navigationController)
... ... @@ -208,6 +219,7 @@ class CNLiveDownSlideTool:NSObject{
208 219 }else{
209 220 navigationViewController().visibleViewController?.navigationController?.pushViewController(webVC, animated: pushAnimated)
210 221 }
  222 + hiddenLoading()
211 223 }else if (model == kCNDownSlideContentsModelModelAlbum){
212 224 let urlString = "http://wjjh5.cnlive.com/cnYjzgAlbumVideo.html"
213 225 let queryItem = URLQueryItem(name: "aid", value: contentId)
... ... @@ -225,10 +237,12 @@ class CNLiveDownSlideTool:NSObject{
225 237 }else{
226 238 navigationViewController().visibleViewController?.navigationController?.pushViewController(webVC, animated: pushAnimated)
227 239 }
  240 + hiddenLoading()
228 241 }else if (model == kCNDownSlideContentsModelModelAlbum_ugc){
229 242 showLoading(message: "")
230 243 self.pushShortVideoController(contentId: contentId, navigationVC: navigationViewController().visibleViewController?.navigationController, slideModel: slideModel)
231 244 }else if model == kCNDownSlideContentsModelModelServing{
  245 + hiddenLoading()
232 246 //跳转微信小程序
233 247 if let data = s_to.data(using: .utf8) {
234 248 do {
... ...
metaCode/Classes/Main/HuBiLieHomePage/View/Home/Home/CNLiveHomeADCell.swift
... ... @@ -180,6 +180,7 @@ class CNLiveHomeADCell: UITableViewCell ,FSPagerViewDataSource,FSPagerViewDelega
180 180 return
181 181 }
182 182 if let bannerMdl = self.slideModel?.contents[index]{
  183 +
183 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 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 548 let imageView = ges.view as! UIImageView
549 549 let i = imageView.tag-1000
550 550 if let contentMdl = self.slideModel?.contents[i]{
  551 +
551 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 561 currentViewController()?.navigationController?.pushViewController(vc, animated: true)
561 562 }else if self.slideModel?.moreType == "3"{
562 563 //webView moreurl
  564 +
563 565 CNLiveDownSlideTool.pushWebVCWithContentsMdl(model: "3", contentId: "", pid: "", shareUrl: "", thirdUrl: self.slideModel?.moreUrl ?? "", title: "", s_to: "", trailerId: "", controller: nil, slideModel: nil)
564 566 }else{
565 567  
... ... @@ -568,6 +570,7 @@ class CNLiveHomeOneBigTwoSmallCell:UITableViewCell{
568 570 // MARK: - 点击视频
569 571 func iconImgViewAction(index:Int){
570 572 if let bannerMdl = self.slideModel?.contents[index]{
  573 +
571 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 190 let imageView = ges.view as! UIImageView
191 191 let i = imageView.tag-1000
192 192 if let contentMdl = self.slideModel?.contents[i]{
  193 +
193 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 108 return
109 109 }
110 110 if let bannerMdl = self.slideModel?.contents[index]{
  111 +
111 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 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 107 }
108 108  
109 109 @objc func imgTapAction(ges: UITapGestureRecognizer){
  110 + showLoading(message: "")
110 111 let imageView = ges.view as! UIImageView
111 112 let i = imageView.tag
112 113 if let contentMdl = self.slideModel?[i]{
... ...
metaCode/Classes/Other/AppDelegate.swift
... ... @@ -19,6 +19,7 @@ import ZFPlayer
19 19 @main
20 20 class AppDelegate: UIResponder, UIApplicationDelegate {
21 21 var window: UIWindow?
  22 + var isCaptured = false //是否录屏中
22 23  
23 24 // var orientationLock = UIInterfaceOrientationMask.allButUpsideDown // 默认支持方向
24 25 // func application(_ application: UIApplication, supportedInterfaceOrientationsFor window: UIWindow?) -> UIInterfaceOrientationMask {
... ... @@ -27,6 +28,14 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
27 28  
28 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 39 JFHeroBrowserGlobalConfig.default.networkImageProvider = HeroNetworkImageProvider.shared
31 40  
32 41 // Override point for customization after application launch.
... ... @@ -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 183 // MARK: - 键盘处理
166 184 func AppDelegate_configIQKeyboardManager() {
167 185 IQKeyboardManager.shared.enable = true
... ...