Commit 1adbbb749593da5217f62b29d6ef870e48d3dbe1

Authored by “张旭”
1 parent 528c245e

修复高清超清等按钮没居中问题

修复列表进入播放详情页,横屏选集是空的问题
metaCode/Classes/Main/HuBiLieHomePage/Controller/CNLiveTVPlayerViewController.swift
@@ -172,8 +172,6 @@ class CNLiveTVPlayerViewController:UIViewController, UITableViewDataSource, UITa @@ -172,8 +172,6 @@ class CNLiveTVPlayerViewController:UIViewController, UITableViewDataSource, UITa
172 backBtn.frame = CGRect(x: 15, y: KStatusBarHeight, width: backBtn.width, height: backBtn.height) 172 backBtn.frame = CGRect(x: 15, y: KStatusBarHeight, width: backBtn.width, height: backBtn.height)
173 self.view.addSubview(backBtn) 173 self.view.addSubview(backBtn)
174 // backBtn.backgroundColor = .red 174 // backBtn.backgroundColor = .red
175 -  
176 - self.setupPlayer()  
177 175
178 view.addSubview(tableView) 176 view.addSubview(tableView)
179 tableView.frame = CGRect(x: 0, y: self.containerView.bottom, width: KSreenWidth, height: KSreenHeight-self.containerView.bottom-KTabBarSafeHeight-60) 177 tableView.frame = CGRect(x: 0, y: self.containerView.bottom, width: KSreenWidth, height: KSreenHeight-self.containerView.bottom-KTabBarSafeHeight-60)
@@ -207,7 +205,6 @@ class CNLiveTVPlayerViewController:UIViewController, UITableViewDataSource, UITa @@ -207,7 +205,6 @@ class CNLiveTVPlayerViewController:UIViewController, UITableViewDataSource, UITa
207 } 205 }
208 bottomCommentShowContainView.isHidden = true 206 bottomCommentShowContainView.isHidden = true
209 // self.addRefreshView() 207 // self.addRefreshView()
210 - self.configDataArray()  
211 self.isAblumVideo = false 208 self.isAblumVideo = false
212 self.isPlayAblumOrKandian = false 209 self.isPlayAblumOrKandian = false
213 210
@@ -221,6 +218,8 @@ class CNLiveTVPlayerViewController:UIViewController, UITableViewDataSource, UITa @@ -221,6 +218,8 @@ class CNLiveTVPlayerViewController:UIViewController, UITableViewDataSource, UITa
221 self.isAblumVideo = false 218 self.isAblumVideo = false
222 self.isPlayAblumOrKandian = false 219 self.isPlayAblumOrKandian = false
223 } 220 }
  221 + self.configDataArray()
  222 + self.setupPlayer()
224 } 223 }
225 224
226 func configDataArray(){ 225 func configDataArray(){
@@ -255,6 +254,7 @@ class CNLiveTVPlayerViewController:UIViewController, UITableViewDataSource, UITa @@ -255,6 +254,7 @@ class CNLiveTVPlayerViewController:UIViewController, UITableViewDataSource, UITa
255 //专辑有值-专辑列表 254 //专辑有值-专辑列表
256 if let vodAlbumListBaseModel = self.vodAlbumListBaseModel{//专辑有值-专辑列表 255 if let vodAlbumListBaseModel = self.vodAlbumListBaseModel{//专辑有值-专辑列表
257 tempDataArray.add(vodAlbumListBaseModel) 256 tempDataArray.add(vodAlbumListBaseModel)
  257 + self.albumListArr = NSMutableArray(array: vodAlbumListBaseModel.list)
258 } 258 }
259 //看点 259 //看点
260 ///**blockList.type 1/2/3/4/5 商品入口/片花资讯/活动推荐/相关推荐/点播详情 */ 260 ///**blockList.type 1/2/3/4/5 商品入口/片花资讯/活动推荐/相关推荐/点播详情 */
@@ -263,6 +263,7 @@ class CNLiveTVPlayerViewController:UIViewController, UITableViewDataSource, UITa @@ -263,6 +263,7 @@ class CNLiveTVPlayerViewController:UIViewController, UITableViewDataSource, UITa
263 if mdl.type == "2"{//看点list数据 263 if mdl.type == "2"{//看点list数据
264 //CNLiveVodPlayBlockListModel 264 //CNLiveVodPlayBlockListModel
265 tempDataArray.add(mdl) 265 tempDataArray.add(mdl)
  266 + self.kanDianListArr = NSMutableArray(array: mdl.list)
266 } 267 }
267 } 268 }
268 } 269 }
@@ -353,15 +354,15 @@ class CNLiveTVPlayerViewController:UIViewController, UITableViewDataSource, UITa @@ -353,15 +354,15 @@ class CNLiveTVPlayerViewController:UIViewController, UITableViewDataSource, UITa
353 self.isPlayAblumOrKandian = false 354 self.isPlayAblumOrKandian = false
354 self.kanDianIndex = seleIndex 355 self.kanDianIndex = seleIndex
355 self.kanDianOrAlbumChangeContentApi(contentId: vodPlayBlockListListModel.contentId, title: vodPlayBlockListListModel.title, isAlbum: isAblumVideo, activeId: vodPlayBlockListListModel.pid, isRefreshPlayer:true ) 356 self.kanDianOrAlbumChangeContentApi(contentId: vodPlayBlockListListModel.contentId, title: vodPlayBlockListListModel.title, isAlbum: isAblumVideo, activeId: vodPlayBlockListListModel.pid, isRefreshPlayer:true )
356 - 357 +
357 } 358 }
358 359
359 -// var title = ""  
360 -// if let blockListModel = self.vodPlayModel?.blockList.first as? CNLiveVodPlayBlockListModel{  
361 -// if let blockListListModel = blockListModel.list.first{  
362 -// title = blockListListModel.title  
363 -// }  
364 -// } 360 + // var title = ""
  361 + // if let blockListModel = self.vodPlayModel?.blockList.first as? CNLiveVodPlayBlockListModel{
  362 + // if let blockListListModel = blockListModel.list.first{
  363 + // title = blockListListModel.title
  364 + // }
  365 + // }
365 var title = "" 366 var title = ""
366 if self.vodPlayModel?.blockList.count ?? 0 > 0{ 367 if self.vodPlayModel?.blockList.count ?? 0 > 0{
367 for mdl in self.vodPlayModel!.blockList{ 368 for mdl in self.vodPlayModel!.blockList{
@@ -373,20 +374,22 @@ class CNLiveTVPlayerViewController:UIViewController, UITableViewDataSource, UITa @@ -373,20 +374,22 @@ class CNLiveTVPlayerViewController:UIViewController, UITableViewDataSource, UITa
373 } 374 }
374 } 375 }
375 } 376 }
376 - 377 +
  378 + var yuanString = ""
377 let isPaid = CNLivePlayerTool.isPaid(product: self.vodPlayModel?.product) 379 let isPaid = CNLivePlayerTool.isPaid(product: self.vodPlayModel?.product)
378 if isPaid{ 380 if isPaid{
379 - var yuanString = ""  
380 //需要付费 381 //需要付费
381 - self.controlView.payBgView.isHidden = false  
382 - isPayZhuanJi = false 382 +
383 var urls = [URL]() 383 var urls = [URL]()
384 urls.append(self.url!) 384 urls.append(self.url!)
385 self.player.assetURLs = urls 385 self.player.assetURLs = urls
386 self.player.playTheIndex(0) 386 self.player.playTheIndex(0)
387 self.player.currentPlayerManager.pause() 387 self.player.currentPlayerManager.pause()
  388 +
  389 + self.controlView.payBgView.isHidden = false
  390 + isPayZhuanJi = false
388 //分转元,没有小数点 391 //分转元,没有小数点
389 - let fenString = self.vodPlayModel!.product!.iosRmb 392 + let fenString = self.vodPlayModel?.product!.iosRmb ?? "100"
390 // 将字符串转换为整数 393 // 将字符串转换为整数
391 // 使用guard语句确保字符串可以转换为整数 394 // 使用guard语句确保字符串可以转换为整数
392 guard let fen = Int(fenString) else { 395 guard let fen = Int(fenString) else {
@@ -400,74 +403,124 @@ class CNLiveTVPlayerViewController:UIViewController, UITableViewDataSource, UITa @@ -400,74 +403,124 @@ class CNLiveTVPlayerViewController:UIViewController, UITableViewDataSource, UITa
400 } 403 }
401 // 将结果转换为字符串 404 // 将结果转换为字符串
402 yuanString = String(yuan) 405 yuanString = String(yuan)
403 -  
404 - //true当前播放的专辑 false看点  
405 -// let isAblumVideo = false// (model.album?.albumId.count ?? 0 > 0) ? true : false  
406 - let isAblumVideo = (self.vodPlayModel?.album?.albumId.count ?? 0 > 0) ? true : false  
407 - var vodAlbumListModel:CNLiveVodAlbumListModel?  
408 - if self.albumListArr.count > 0{  
409 - if let vodAlbumListMdl = self.albumListArr[0] as? CNLiveVodAlbumListModel{  
410 - vodAlbumListModel = vodAlbumListMdl  
411 - }  
412 - }  
413 - self.selectKanDianOrAlbum(isPayZhuanJi: isPayZhuanJi, mdlProduct: self.vodPlayModel?.product, mdlContentId: self.vodPlayModel?.contentId ?? "", isAblumVideo: isAblumVideo, albumSelectIndex: 0, albumListArray: albumListArr, kanDianSelectIndex: -1, kanDianListArray: NSMutableArray(), isPlayAblumOrKandian: isAblumVideo, xuanjiBgViewCurrSeleIdx: 0, xuanjiBgViewKanDianListArr: NSMutableArray(), modelTitle: title, mdlActiveId: self.vodPlayModel?.contentId ?? "", mdlModel: self.vodPlayModel?.model ?? "", yuanString: yuanString, payVodAlbumListModel: vodAlbumListModel, vodAlbumListBaseModel: self.vodAlbumListBaseModel)  
414 -  
415 -// if isPayZhuanJi{  
416 -// //已经付费  
417 -// self.controlView.payBgView.isHidden = true  
418 -// self.contentId = self.vodPlayModel?.contentId ?? ""  
419 -// self.albumListArr = albumListArr  
420 -// self.albumIndex = 0  
421 -// self.kanDianIndex = -1  
422 -// self.isPlayAblumOrKandian = true  
423 -// self.kanDianOrAlbumChangeContentApi(contentId: self.vodPlayModel?.contentId ?? "", title: title, isAlbum: true, activeId: self.vodPlayModel?.contentId ?? "", isRefreshPlayer: true)  
424 -// self.player.allowOrentitaionRotation = true  
425 -// }else{  
426 -// //没付费  
427 -// //显示付费页面  
428 -// let vodMdl = CNLiveVodPlayModel()  
429 -// vodMdl.product = self.vodPlayModel?.product  
430 -// vodMdl.contentId = self.vodPlayModel?.contentId ?? ""  
431 -// vodMdl.model = self.vodPlayModel?.model ?? ""  
432 -// self.controlView.vodPlayModel = vodMdl  
433 -// self.controlView.payBgView.isHidden = false  
434 -// self.controlView.payBgView.payBtn.setTitle("\(yuanString)元购买本专辑", for: .normal)  
435 -//  
436 -// //成功用pay参数 刷新页面  
437 -// self.albumListArr = NSMutableArray(array: self.vodAlbumListBaseModel?.list ?? [CNLiveVodAlbumListModel]())  
438 -// if self.albumListArr.count > 0{  
439 -// if let vodAlbumListModel = self.albumListArr[0] as? CNLiveVodAlbumListModel{  
440 -// self.payVodAlbumListModel = vodAlbumListModel  
441 -// self.payAid = vodAlbumListModel.albumId//.contentId  
442 -// self.payContentId = vodAlbumListModel.contentId  
443 -// self.payAlbumListArr = albumListArr  
444 -// self.payIndex = 0  
445 -// self.payTitle = title  
446 -// self.payIsAlbum = true  
447 -// self.payActivityId = vodAlbumListModel.activityId  
448 -// self.player.allowOrentitaionRotation = false  
449 -//  
450 -// self.contentId = self.vodPlayModel?.contentId ?? ""  
451 -// self.albumListArr = albumListArr  
452 -// self.albumIndex = 0  
453 -// self.kanDianIndex = -1  
454 -// self.isPlayAblumOrKandian = true  
455 -// self.kanDianOrAlbumChangeContentApi(contentId: self.vodPlayModel?.contentId ?? "", title: title, isAlbum: true, activeId: self.vodPlayModel?.contentId ?? "", isRefreshPlayer: false)  
456 -// }  
457 -// }  
458 -// }  
459 }else{ 406 }else{
460 - //免费 407 + //免费或者付过费了
461 self.controlView.payBgView.isHidden = true 408 self.controlView.payBgView.isHidden = true
462 isPayZhuanJi = true 409 isPayZhuanJi = true
463 - self.playWithUrlAndTitle(url: self.url!.absoluteString, title: title)  
464 -  
465 -// var urls = [URL]()  
466 -// urls.append(self.url!)  
467 -// self.player.assetURLs = urls  
468 -// self.player.playTheIndex(0)  
469 - 410 +// self.playWithUrlAndTitle(url: self.url!.absoluteString, title: title)
470 } 411 }
  412 + //true当前播放的专辑 false看点
  413 + let isAblumVideo = (self.vodPlayModel?.album?.albumId.count ?? 0 > 0) ? true : false
  414 + var vodAlbumListModel:CNLiveVodAlbumListModel?
  415 + if self.albumListArr.count > 0{
  416 + if let vodAlbumListMdl = self.albumListArr[0] as? CNLiveVodAlbumListModel{
  417 + vodAlbumListModel = vodAlbumListMdl
  418 + }
  419 + }
  420 + let xuanjiBgViewKanDianListArr = isAblumVideo ? (self.albumListArr.count > 0 ? self.albumListArr : self.kanDianListArr) : self.kanDianListArr
  421 + self.selectKanDianOrAlbum(isPayZhuanJi: isPayZhuanJi, mdlProduct: self.vodPlayModel?.product, mdlContentId: self.vodPlayModel?.cid ?? (self.vodPlayModel?.contentId ?? ""), isAblumVideo: isAblumVideo, albumSelectIndex: self.albumIndex, albumListArray: self.albumListArr, kanDianSelectIndex: self.kanDianIndex, kanDianListArray: self.kanDianListArr, isPlayAblumOrKandian: isAblumVideo, xuanjiBgViewCurrSeleIdx: isAblumVideo ? self.albumIndex : self.kanDianIndex , xuanjiBgViewKanDianListArr: xuanjiBgViewKanDianListArr, modelTitle: title, mdlActiveId: self.vodPlayModel?.contentId ?? "", mdlModel: self.vodPlayModel?.model ?? "1", yuanString: yuanString, payVodAlbumListModel: vodAlbumListModel, vodAlbumListBaseModel: self.vodAlbumListBaseModel)
  422 + //mdlActiveId: self.vodPlayModel?.contentId
  423 +
  424 +
  425 +
  426 + // let isPaid = CNLivePlayerTool.isPaid(product: self.vodPlayModel?.product)
  427 + // if isPaid{
  428 + // var yuanString = ""
  429 + // //需要付费
  430 + // self.controlView.payBgView.isHidden = false
  431 + // isPayZhuanJi = false
  432 + // var urls = [URL]()
  433 + // urls.append(self.url!)
  434 + // self.player.assetURLs = urls
  435 + // self.player.playTheIndex(0)
  436 + // self.player.currentPlayerManager.pause()
  437 + // //分转元,没有小数点
  438 + // let fenString = self.vodPlayModel!.product!.iosRmb
  439 + // // 将字符串转换为整数
  440 + // // 使用guard语句确保字符串可以转换为整数
  441 + // guard let fen = Int(fenString) else {
  442 + // print("无法将字符串转换为整数")
  443 + // return
  444 + // }
  445 + // // 计算元值(整数除法,自动舍去小数部分)
  446 + // var yuan = fen / 100
  447 + // if yuan <= 0{//如果是测试0.1元 ,线上默认设置为1元
  448 + // yuan = 1
  449 + // }
  450 + // // 将结果转换为字符串
  451 + // yuanString = String(yuan)
  452 + //
  453 + // //true当前播放的专辑 false看点
  454 + //// let isAblumVideo = false// (model.album?.albumId.count ?? 0 > 0) ? true : false
  455 + // let isAblumVideo = (self.vodPlayModel?.album?.albumId.count ?? 0 > 0) ? true : false
  456 + // var vodAlbumListModel:CNLiveVodAlbumListModel?
  457 + // if self.albumListArr.count > 0{
  458 + // if let vodAlbumListMdl = self.albumListArr[0] as? CNLiveVodAlbumListModel{
  459 + // vodAlbumListModel = vodAlbumListMdl
  460 + // }
  461 + // }
  462 + // self.selectKanDianOrAlbum(isPayZhuanJi: isPayZhuanJi, mdlProduct: self.vodPlayModel?.product, mdlContentId: self.vodPlayModel?.contentId ?? "", isAblumVideo: isAblumVideo, albumSelectIndex: 0, albumListArray: albumListArr, kanDianSelectIndex: -1, kanDianListArray: NSMutableArray(), isPlayAblumOrKandian: isAblumVideo, xuanjiBgViewCurrSeleIdx: 0, xuanjiBgViewKanDianListArr: NSMutableArray(), modelTitle: title, mdlActiveId: self.vodPlayModel?.contentId ?? "", mdlModel: self.vodPlayModel?.model ?? "", yuanString: yuanString, payVodAlbumListModel: vodAlbumListModel, vodAlbumListBaseModel: self.vodAlbumListBaseModel)
  463 +
  464 +
  465 + // if isPayZhuanJi{
  466 + // //已经付费
  467 + // self.controlView.payBgView.isHidden = true
  468 + // self.contentId = self.vodPlayModel?.contentId ?? ""
  469 + // self.albumListArr = albumListArr
  470 + // self.albumIndex = 0
  471 + // self.kanDianIndex = -1
  472 + // self.isPlayAblumOrKandian = true
  473 + // self.kanDianOrAlbumChangeContentApi(contentId: self.vodPlayModel?.contentId ?? "", title: title, isAlbum: true, activeId: self.vodPlayModel?.contentId ?? "", isRefreshPlayer: true)
  474 + // self.player.allowOrentitaionRotation = true
  475 + // }else{
  476 + // //没付费
  477 + // //显示付费页面
  478 + // let vodMdl = CNLiveVodPlayModel()
  479 + // vodMdl.product = self.vodPlayModel?.product
  480 + // vodMdl.contentId = self.vodPlayModel?.contentId ?? ""
  481 + // vodMdl.model = self.vodPlayModel?.model ?? ""
  482 + // self.controlView.vodPlayModel = vodMdl
  483 + // self.controlView.payBgView.isHidden = false
  484 + // self.controlView.payBgView.payBtn.setTitle("\(yuanString)元购买本专辑", for: .normal)
  485 + //
  486 + // //成功用pay参数 刷新页面
  487 + // self.albumListArr = NSMutableArray(array: self.vodAlbumListBaseModel?.list ?? [CNLiveVodAlbumListModel]())
  488 + // if self.albumListArr.count > 0{
  489 + // if let vodAlbumListModel = self.albumListArr[0] as? CNLiveVodAlbumListModel{
  490 + // self.payVodAlbumListModel = vodAlbumListModel
  491 + // self.payAid = vodAlbumListModel.albumId//.contentId
  492 + // self.payContentId = vodAlbumListModel.contentId
  493 + // self.payAlbumListArr = albumListArr
  494 + // self.payIndex = 0
  495 + // self.payTitle = title
  496 + // self.payIsAlbum = true
  497 + // self.payActivityId = vodAlbumListModel.activityId
  498 + // self.player.allowOrentitaionRotation = false
  499 + //
  500 + // self.contentId = self.vodPlayModel?.contentId ?? ""
  501 + // self.albumListArr = albumListArr
  502 + // self.albumIndex = 0
  503 + // self.kanDianIndex = -1
  504 + // self.isPlayAblumOrKandian = true
  505 + // self.kanDianOrAlbumChangeContentApi(contentId: self.vodPlayModel?.contentId ?? "", title: title, isAlbum: true, activeId: self.vodPlayModel?.contentId ?? "", isRefreshPlayer: false)
  506 + // }
  507 + // }
  508 + // }
  509 +
  510 +
  511 +// }else{
  512 +// //免费
  513 +//
  514 +// self.controlView.payBgView.isHidden = true
  515 +// isPayZhuanJi = true
  516 +// self.playWithUrlAndTitle(url: self.url!.absoluteString, title: title)
  517 +//
  518 +//// var urls = [URL]()
  519 +//// urls.append(self.url!)
  520 +//// self.player.assetURLs = urls
  521 +//// self.player.playTheIndex(0)
  522 +//
  523 +// }
471 524
472 self.controlView.showTitle(title, cover: UIImage.imageWithColor(color: .darkGray, size: CGSize(width: 50, height: 50)), fullScreenMode: .landscape) 525 self.controlView.showTitle(title, cover: UIImage.imageWithColor(color: .darkGray, size: CGSize(width: 50, height: 50)), fullScreenMode: .landscape)
473 self.playTitle = title 526 self.playTitle = title
metaCode/Classes/Main/HuBiLieHomePage/View/VodDetail/HengPing/CNLiveVodLandscapeGaoqingView.swift
@@ -83,7 +83,7 @@ class CNLiveVodLandscapeGaoqingView:UIView{ @@ -83,7 +83,7 @@ class CNLiveVodLandscapeGaoqingView:UIView{
83 titleLbl.text = title 83 titleLbl.text = title
84 expandBtn.addSubview(titleLbl) 84 expandBtn.addSubview(titleLbl)
85 titleLbl.snp.makeConstraints { make in 85 titleLbl.snp.makeConstraints { make in
86 - make.centerX.equalToSuperview().offset(10) 86 + make.centerX.equalToSuperview()
87 make.top.equalToSuperview().offset(30) 87 make.top.equalToSuperview().offset(30)
88 } 88 }
89 89
@@ -92,7 +92,7 @@ class CNLiveVodLandscapeGaoqingView:UIView{ @@ -92,7 +92,7 @@ class CNLiveVodLandscapeGaoqingView:UIView{
92 subTitleLbl.text = subTitle 92 subTitleLbl.text = subTitle
93 expandBtn.addSubview(subTitleLbl) 93 expandBtn.addSubview(subTitleLbl)
94 subTitleLbl.snp.makeConstraints { make in 94 subTitleLbl.snp.makeConstraints { make in
95 - make.centerX.equalToSuperview().offset(10) 95 + make.centerX.equalToSuperview()
96 make.top.equalTo(titleLbl.snp.bottom).offset(3) 96 make.top.equalTo(titleLbl.snp.bottom).offset(3)
97 } 97 }
98 98
metaCode/Classes/Main/HuBiLieHomePage/View/VodDetail/HengPing/CNLiveVodPayView.swift
@@ -46,7 +46,48 @@ class CNLiveVodPayView:UIView{ @@ -46,7 +46,48 @@ class CNLiveVodPayView:UIView{
46 self.backgroundColor = HexColor("#000000", alpha: 0.7) 46 self.backgroundColor = HexColor("#000000", alpha: 0.7)
47 self.isUserInteractionEnabled = true 47 self.isUserInteractionEnabled = true
48 self.initUI() 48 self.initUI()
49 - self.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(tapAction))) 49 + self.isMultipleTouchEnabled = true
  50 +
  51 + // 双击手势
  52 + var doubleTapGesture = UILongPressGestureRecognizer(target: self, action: #selector(doubleTapAction))
  53 +// doubleTapGesture.numberOfTapsRequired = 2 // 双击触发
  54 + doubleTapGesture.delaysTouchesBegan = true
  55 + doubleTapGesture.delaysTouchesEnded = true
  56 + doubleTapGesture.numberOfTouchesRequired = 1
  57 + doubleTapGesture.numberOfTapsRequired = 2
  58 +
  59 + var panGesture = UIPanGestureRecognizer(target: self, action: #selector(panAction))
  60 + panGesture.delaysTouchesBegan = true
  61 + panGesture.delaysTouchesEnded = true
  62 + panGesture.maximumNumberOfTouches = 1
  63 + panGesture.cancelsTouchesInView = true
  64 +
  65 + var tapGesture = UITapGestureRecognizer(target: self, action: #selector(tapAction))
  66 + tapGesture.delaysTouchesBegan = true
  67 + tapGesture.delaysTouchesEnded = true
  68 + tapGesture.numberOfTouchesRequired = 1
  69 + tapGesture.numberOfTapsRequired = 1
  70 + tapGesture.require(toFail: doubleTapGesture)
  71 + tapGesture.require(toFail: panGesture)
  72 + self.addGestureRecognizer(tapGesture)
  73 + self.addGestureRecognizer(doubleTapGesture)
  74 + self.addGestureRecognizer(panGesture)
  75 +
  76 + var pinchGesture = UIPinchGestureRecognizer(target: self, action: #selector(pinchAction))
  77 + pinchGesture.delaysTouchesBegan = true
  78 + self.addGestureRecognizer(pinchGesture)
  79 +
  80 + // 长按手势
  81 + var longGesture = UILongPressGestureRecognizer(target: self, action: #selector(longPressAction))
  82 + longGesture.minimumPressDuration = 0.5// 长按触发时间(秒)
  83 + self.addGestureRecognizer(longGesture)
  84 +
  85 +
  86 +
  87 +// // 滑动手势(支持四个方向)
  88 +// var swipeGesture = UISwipeGestureRecognizer(target: self, action: #selector(swipeAction))
  89 +// swipeGesture.direction = [.left, .right , .up , .down]
  90 +// self.addGestureRecognizer(swipeGesture)
50 } 91 }
51 92
52 required init?(coder: NSCoder) { 93 required init?(coder: NSCoder) {
@@ -78,8 +119,26 @@ class CNLiveVodPayView:UIView{ @@ -78,8 +119,26 @@ class CNLiveVodPayView:UIView{
78 119
79 @objc func tapAction(){ 120 @objc func tapAction(){
80 // self.isHidden = true 121 // self.isHidden = true
  122 + print("tapAction")
  123 + }
  124 + @objc func pinchAction(){
  125 +// self.isHidden = true
  126 + print("pinchAction")
  127 + }
  128 + @objc func longPressAction(){
  129 +// self.isHidden = true
  130 + print("longPressAction")
  131 + }
  132 + @objc func doubleTapAction(){
  133 +// self.isHidden = true
  134 + print("doubleTapAction")
81 } 135 }
82 136
  137 + @objc func panAction(){
  138 +// self.isHidden = true
  139 + print("panAction")
  140 + }
  141 +
83 @objc func landscapeBackBtnAction(){ 142 @objc func landscapeBackBtnAction(){
84 let viewControllers = navigationViewController().viewControllers 143 let viewControllers = navigationViewController().viewControllers
85 if viewControllers.count > 1 { 144 if viewControllers.count > 1 {