Commit 796ecda92d3511af25e4714ac75d8c039f5c8719
1 parent
fe9de0de
剧集播放器数据源 , 实时热榜切换短剧播放器和剧集播放器
Showing
3 changed files
with
231 additions
and
9 deletions
metaCode/Classes/Main/VideoPage/Controller/CNLiveShortVideoViewController.swift
| @@ -43,6 +43,27 @@ class CNLiveShortVideoViewController : CNLiveBaseViewController, UITableViewDele | @@ -43,6 +43,27 @@ class CNLiveShortVideoViewController : CNLiveBaseViewController, UITableViewDele | ||
| 43 | var realHotArr = NSMutableArray() | 43 | var realHotArr = NSMutableArray() |
| 44 | return realHotArr | 44 | return realHotArr |
| 45 | }() | 45 | }() |
| 46 | + //实时热榜所有短剧第一集的列表 | ||
| 47 | + lazy var realHotAllFirstArr: NSMutableArray = { | ||
| 48 | + var realHotArr = NSMutableArray() | ||
| 49 | + return realHotArr | ||
| 50 | + }() | ||
| 51 | + //实时热榜所有短剧全部集数的列表 | ||
| 52 | + lazy var realHotAllTotalArr: NSMutableArray = { | ||
| 53 | + var realHotArr = NSMutableArray() | ||
| 54 | + return realHotArr | ||
| 55 | + }() | ||
| 56 | + //实时热榜所有短剧全部集数videoUrl的列表 | ||
| 57 | + lazy var realHotAllTotalVideoUrlArr: NSMutableArray = { | ||
| 58 | + var realHotArr = NSMutableArray() | ||
| 59 | + return realHotArr | ||
| 60 | + }() | ||
| 61 | + //实时热榜所有短剧第一集videoUrl的列表 | ||
| 62 | + lazy var realHotAllFirstVideoUrlArr: NSMutableArray = { | ||
| 63 | + var realHotArr = NSMutableArray() | ||
| 64 | + return realHotArr | ||
| 65 | + }() | ||
| 66 | + | ||
| 46 | let kRealHotListCollectionViewCellIdentifier = "kRealHotListCollectionViewCellIdentifier" | 67 | let kRealHotListCollectionViewCellIdentifier = "kRealHotListCollectionViewCellIdentifier" |
| 47 | lazy var realHotCollectionView: UICollectionView = { | 68 | lazy var realHotCollectionView: UICollectionView = { |
| 48 | let layout = UICollectionViewFlowLayout() | 69 | let layout = UICollectionViewFlowLayout() |
| @@ -141,6 +162,13 @@ class CNLiveShortVideoViewController : CNLiveBaseViewController, UITableViewDele | @@ -141,6 +162,13 @@ class CNLiveShortVideoViewController : CNLiveBaseViewController, UITableViewDele | ||
| 141 | var playerManager = ZFAVPlayerManager.init() | 162 | var playerManager = ZFAVPlayerManager.init() |
| 142 | var previousOffset:CGFloat = 50000.0 | 163 | var previousOffset:CGFloat = 50000.0 |
| 143 | 164 | ||
| 165 | + | ||
| 166 | + let group = DispatchGroup() | ||
| 167 | + let queue = DispatchQueue.global(qos: .default) | ||
| 168 | + var currentDuanJuIndex: NSInteger! = 0//播放短剧index | ||
| 169 | + var isDuanJuPlayer = false//是否 短剧播放器 | ||
| 170 | + var isTempDuanJuPlayer = false//临时是否 短剧播放器 | ||
| 171 | + | ||
| 144 | /// 初始化播放器 | 172 | /// 初始化播放器 |
| 145 | /// - Parameters: | 173 | /// - Parameters: |
| 146 | /// - aid: 专辑 id | 174 | /// - aid: 专辑 id |
| @@ -174,6 +202,18 @@ class CNLiveShortVideoViewController : CNLiveBaseViewController, UITableViewDele | @@ -174,6 +202,18 @@ class CNLiveShortVideoViewController : CNLiveBaseViewController, UITableViewDele | ||
| 174 | self.aid = aid | 202 | self.aid = aid |
| 175 | self.isSelectable = false | 203 | self.isSelectable = false |
| 176 | self.currentIndex = currentIndex | 204 | self.currentIndex = currentIndex |
| 205 | + | ||
| 206 | + | ||
| 207 | + if let mdl = slideModel{ | ||
| 208 | + self.isDuanJuPlayer = true | ||
| 209 | + for (idx,model) in mdl.contents.enumerated() { | ||
| 210 | + if model.contentId == aid{ | ||
| 211 | + self.currentDuanJuIndex = idx | ||
| 212 | + break | ||
| 213 | + } | ||
| 214 | + } | ||
| 215 | + } | ||
| 216 | + | ||
| 177 | super.init(nibName:nil, bundle:nil) | 217 | super.init(nibName:nil, bundle:nil) |
| 178 | var page = (self.roundUpToNearestTen(currentIndex))/10 | 218 | var page = (self.roundUpToNearestTen(currentIndex))/10 |
| 179 | if page == 0 { | 219 | if page == 0 { |
| @@ -194,8 +234,12 @@ class CNLiveShortVideoViewController : CNLiveBaseViewController, UITableViewDele | @@ -194,8 +234,12 @@ class CNLiveShortVideoViewController : CNLiveBaseViewController, UITableViewDele | ||
| 194 | override func viewDidAppear(_ animated: Bool) { | 234 | override func viewDidAppear(_ animated: Bool) { |
| 195 | super.viewDidAppear(animated) | 235 | super.viewDidAppear(animated) |
| 196 | self.player.currentPlayerManager.play() | 236 | self.player.currentPlayerManager.play() |
| 197 | - DispatchQueue.main.asyncAfter(deadline: .now() + 1) { | ||
| 198 | - self.player.scrollView?.setContentOffset(CGPoint(x: 0, y:CGFloat(self.currentIndex!)*KSreenHeight), animated: true)//校正偏移量 | 237 | + if self.isDuanJuPlayer{ |
| 238 | + | ||
| 239 | + }else{ | ||
| 240 | + DispatchQueue.main.asyncAfter(deadline: .now() + 1) { | ||
| 241 | + self.player.scrollView?.setContentOffset(CGPoint(x: 0, y:CGFloat(self.currentIndex!)*KSreenHeight), animated: true)//校正偏移量 | ||
| 242 | + } | ||
| 199 | } | 243 | } |
| 200 | } | 244 | } |
| 201 | 245 | ||
| @@ -225,12 +269,18 @@ class CNLiveShortVideoViewController : CNLiveBaseViewController, UITableViewDele | @@ -225,12 +269,18 @@ class CNLiveShortVideoViewController : CNLiveBaseViewController, UITableViewDele | ||
| 225 | self.updateHotListView(isShow: self.slideModel == nil ? false : true) | 269 | self.updateHotListView(isShow: self.slideModel == nil ? false : true) |
| 226 | view.addSubview(self.totalHotListBtn) | 270 | view.addSubview(self.totalHotListBtn) |
| 227 | self.totalHotListBtn.isHidden = false | 271 | self.totalHotListBtn.isHidden = false |
| 272 | + | ||
| 273 | + self.requestAllHotListData { noMore in | ||
| 274 | + | ||
| 275 | + } | ||
| 276 | + }else{ | ||
| 277 | + if self.dataArray.count == 0 { | ||
| 278 | + requestData {noMore in } | ||
| 279 | + } | ||
| 228 | } | 280 | } |
| 229 | 281 | ||
| 230 | view.addSubview(backBtn) | 282 | view.addSubview(backBtn) |
| 231 | - if self.dataArray.count == 0 { | ||
| 232 | - requestData {noMore in } | ||
| 233 | - } | 283 | + |
| 234 | 284 | ||
| 235 | addRefreshView() | 285 | addRefreshView() |
| 236 | 286 | ||
| @@ -359,7 +409,11 @@ class CNLiveShortVideoViewController : CNLiveBaseViewController, UITableViewDele | @@ -359,7 +409,11 @@ class CNLiveShortVideoViewController : CNLiveBaseViewController, UITableViewDele | ||
| 359 | 409 | ||
| 360 | @objc func headerRefresh() { | 410 | @objc func headerRefresh() { |
| 361 | self.pageNum = 1 | 411 | self.pageNum = 1 |
| 362 | - self.requestData {noMore in } | 412 | + if self.isDuanJuPlayer{ |
| 413 | + self.requestAllHotListData { noMore in } | ||
| 414 | + }else{ | ||
| 415 | + self.requestData {noMore in } | ||
| 416 | + } | ||
| 363 | } | 417 | } |
| 364 | 418 | ||
| 365 | @objc func removePlayerAction() { | 419 | @objc func removePlayerAction() { |
| @@ -379,6 +433,114 @@ class CNLiveShortVideoViewController : CNLiveBaseViewController, UITableViewDele | @@ -379,6 +433,114 @@ class CNLiveShortVideoViewController : CNLiveBaseViewController, UITableViewDele | ||
| 379 | self.hotListBtn.frame = CGRectMake((KSreenWidth-144)/2.0, self.hotListView.bottom+19, 144, 28) | 433 | self.hotListBtn.frame = CGRectMake((KSreenWidth-144)/2.0, self.hotListView.bottom+19, 144, 28) |
| 380 | } | 434 | } |
| 381 | 435 | ||
| 436 | + // MARK: - 请求实时热榜的所有短剧,全部集数数据 | ||
| 437 | + func requestAllHotListData(resultBlock: @escaping (_ noMore: Bool) -> Void) { | ||
| 438 | + self.realHotAllFirstArr.removeAllObjects() | ||
| 439 | + self.realHotAllTotalArr.removeAllObjects() | ||
| 440 | + self.dataArray.removeAllObjects() | ||
| 441 | + self.dataURLArray.removeAllObjects() | ||
| 442 | + | ||
| 443 | + showLoading(message: "") | ||
| 444 | + let tempRealHotArr = Array(self.realHotArr) | ||
| 445 | + tempRealHotArr.forEach { contMdl in | ||
| 446 | + if let contentsModel = contMdl as? CNLiveDownSlideContentsModel{ | ||
| 447 | + self.group.enter() | ||
| 448 | + | ||
| 449 | + CNLiveShortVideoViewModel.requstWithShortVideo(aid: contentsModel.contentId, page: 1, pageSize: "10") { [weak self] result, respStatue in | ||
| 450 | + guard let self = self else { return } | ||
| 451 | + if respStatue == .success { | ||
| 452 | + | ||
| 453 | + let listArray = (result as! [Any]).first as! [CNLiveAlbumListModel] | ||
| 454 | + | ||
| 455 | + self.realHotAllTotalArr.add(listArray) | ||
| 456 | + let urlArray = (result as! [Any]).last as! [String] | ||
| 457 | + self.realHotAllTotalVideoUrlArr.add(urlArray) | ||
| 458 | + | ||
| 459 | + self.group.leave() | ||
| 460 | + } else { | ||
| 461 | +// if self.tableView.mj_footer != nil { | ||
| 462 | +// self.tableView.mj_footer?.endRefreshing() | ||
| 463 | +// } | ||
| 464 | +// self.tableView.contentOffset = CGPoint.zero | ||
| 465 | +// self.tableView.refreshControl?.endRefreshing() | ||
| 466 | +// if self.dataArray.count == 0 { | ||
| 467 | +// self.tableView.reloadEmptyDataSet() | ||
| 468 | +// } | ||
| 469 | + | ||
| 470 | + | ||
| 471 | + self.group.leave() | ||
| 472 | + } | ||
| 473 | + } | ||
| 474 | + } | ||
| 475 | + | ||
| 476 | + } | ||
| 477 | + | ||
| 478 | + | ||
| 479 | + self.group.notify(queue: .main) { | ||
| 480 | + // 所有网络请求都已完成,在这里执行你的任务 | ||
| 481 | + | ||
| 482 | + var aidToModelIndex: [String : Int] = [:] | ||
| 483 | + for (index, arr) in self.realHotAllTotalArr.enumerated() { | ||
| 484 | + let juArr = arr as! [CNLiveAlbumListModel] | ||
| 485 | + if juArr.count > 0{ | ||
| 486 | + let model = juArr.first | ||
| 487 | + let albumId = model!.albumMsgModel!.albumId | ||
| 488 | + aidToModelIndex[albumId] = index | ||
| 489 | + } | ||
| 490 | + } | ||
| 491 | + let sortedModels = NSMutableArray() | ||
| 492 | + let sortedUrlModels = NSMutableArray() | ||
| 493 | + for contMdl in self.realHotArr { | ||
| 494 | + let model = contMdl as! CNLiveDownSlideContentsModel | ||
| 495 | + if let index = aidToModelIndex[model.contentId] { | ||
| 496 | + sortedModels.add(self.realHotAllTotalArr[index] as! [CNLiveAlbumListModel]) | ||
| 497 | + sortedUrlModels.add(self.realHotAllTotalVideoUrlArr[index] as! [String]) | ||
| 498 | +// if self.aid == model.contentId{ | ||
| 499 | +// self.currentDuanJuIndex = index | ||
| 500 | +// } | ||
| 501 | + } | ||
| 502 | + | ||
| 503 | + } | ||
| 504 | + self.realHotAllTotalArr = NSMutableArray(array: sortedModels) | ||
| 505 | + self.realHotAllTotalVideoUrlArr = NSMutableArray(array: sortedUrlModels) | ||
| 506 | + | ||
| 507 | + self.realHotAllTotalArr.forEach { arr in | ||
| 508 | + let juArr = arr as! [CNLiveAlbumListModel] | ||
| 509 | + if juArr.count > 0{ | ||
| 510 | + let model = juArr.first | ||
| 511 | + self.realHotAllFirstArr.add(model!) | ||
| 512 | + } | ||
| 513 | + } | ||
| 514 | + | ||
| 515 | + self.realHotAllTotalVideoUrlArr.forEach{ arr in | ||
| 516 | + let urlArr = arr as! [String] | ||
| 517 | + if urlArr.count > 0{ | ||
| 518 | + let url = urlArr.first | ||
| 519 | + self.realHotAllFirstVideoUrlArr.add(url!) | ||
| 520 | + } | ||
| 521 | + } | ||
| 522 | + | ||
| 523 | + //等全部数据弄好了再设置 | ||
| 524 | + self.dataArray.addObjects(from: self.realHotAllFirstArr as! [CNLiveAlbumListModel]) | ||
| 525 | + | ||
| 526 | + self.dataURLArray.addObjects(from: self.realHotAllFirstVideoUrlArr as! [String]) | ||
| 527 | + if self.tableView.mj_footer != nil { | ||
| 528 | + self.tableView.mj_footer?.endRefreshing() | ||
| 529 | + } | ||
| 530 | + if self.pickerView != nil { | ||
| 531 | + let arr = self.realHotAllTotalArr[self.currentDuanJuIndex] as! NSMutableArray | ||
| 532 | + self.pickerView.setupWithArray(dataArray: arr) | ||
| 533 | + } | ||
| 534 | + self.tableView.refreshControl?.endRefreshing() | ||
| 535 | + self.tableView.reloadData() | ||
| 536 | + | ||
| 537 | + | ||
| 538 | + self.playTheIndex(index: self.currentDuanJuIndex) | ||
| 539 | + } | ||
| 540 | + | ||
| 541 | + } | ||
| 542 | + | ||
| 543 | + //请求一个短剧的全部集数数据 | ||
| 382 | func requestData(resultBlock: @escaping (_ noMore: Bool) -> Void) { | 544 | func requestData(resultBlock: @escaping (_ noMore: Bool) -> Void) { |
| 383 | CNLiveShortVideoViewModel.requstWithShortVideo(aid: self.aid, page: self.pageNum, pageSize: "10") { [weak self] result, respStatue in | 545 | CNLiveShortVideoViewModel.requstWithShortVideo(aid: self.aid, page: self.pageNum, pageSize: "10") { [weak self] result, respStatue in |
| 384 | guard let self = self else { return } | 546 | guard let self = self else { return } |
| @@ -444,12 +606,18 @@ class CNLiveShortVideoViewController : CNLiveBaseViewController, UITableViewDele | @@ -444,12 +606,18 @@ class CNLiveShortVideoViewController : CNLiveBaseViewController, UITableViewDele | ||
| 444 | // 指定到某一行播放 | 606 | // 指定到某一行播放 |
| 445 | let indexPath = IndexPath(row: index, section: 0) | 607 | let indexPath = IndexPath(row: index, section: 0) |
| 446 | tableView.scrollToRow(at: indexPath, at: .none, animated: false) | 608 | tableView.scrollToRow(at: indexPath, at: .none, animated: false) |
| 609 | + DispatchQueue.main.asyncAfter(deadline: .now() + 1) { | ||
| 610 | + self.player.scrollView?.setContentOffset(CGPoint(x: 0, y:CGFloat(index)*KSreenHeight), animated: true)//校正偏移量 | ||
| 611 | + } | ||
| 447 | 612 | ||
| 448 | // 使用zf_filterShouldPlayCellWhileScrolled过滤播放 | 613 | // 使用zf_filterShouldPlayCellWhileScrolled过滤播放 |
| 449 | self.player.zf_filterShouldPlayCellWhileScrolled { [weak self] indexPath in | 614 | self.player.zf_filterShouldPlayCellWhileScrolled { [weak self] indexPath in |
| 450 | guard let self = self else { return } | 615 | guard let self = self else { return } |
| 451 | self.playVideo(at: indexPath) | 616 | self.playVideo(at: indexPath) |
| 452 | } | 617 | } |
| 618 | + | ||
| 619 | + //隐藏实时热榜view | ||
| 620 | + self.hotListBtn.isHidden = !self.isDuanJuPlayer | ||
| 453 | } | 621 | } |
| 454 | 622 | ||
| 455 | override var shouldAutorotate: Bool { | 623 | override var shouldAutorotate: Bool { |
| @@ -496,6 +664,23 @@ class CNLiveShortVideoViewController : CNLiveBaseViewController, UITableViewDele | @@ -496,6 +664,23 @@ class CNLiveShortVideoViewController : CNLiveBaseViewController, UITableViewDele | ||
| 496 | 664 | ||
| 497 | 665 | ||
| 498 | func playVideo(at indexPath: IndexPath) { | 666 | func playVideo(at indexPath: IndexPath) { |
| 667 | + | ||
| 668 | + if self.isDuanJuPlayer{ | ||
| 669 | + self.currentDuanJuIndex = indexPath.row | ||
| 670 | + let arr1 = self.realHotAllTotalArr[self.currentDuanJuIndex] as! Array<Any> | ||
| 671 | + let arr = NSMutableArray() | ||
| 672 | + arr1.forEach { obj in | ||
| 673 | + let duanjuMdl = obj as! CNLiveAlbumListModel | ||
| 674 | + arr.add(duanjuMdl) | ||
| 675 | + } | ||
| 676 | + if self.pickerView != nil { | ||
| 677 | + self.pickerView.setupWithArray(dataArray: arr) | ||
| 678 | + } | ||
| 679 | + }else{ | ||
| 680 | + if self.pickerView != nil { | ||
| 681 | + self.pickerView.setupWithArray(dataArray: self.dataArray) | ||
| 682 | + } | ||
| 683 | + } | ||
| 499 | let data: CNLiveAlbumListModel = dataArray[indexPath.row] as! CNLiveAlbumListModel | 684 | let data: CNLiveAlbumListModel = dataArray[indexPath.row] as! CNLiveAlbumListModel |
| 500 | self.player.playTheIndexPath(indexPath, assetURL: URL(string: data.videoUrl)!) | 685 | self.player.playTheIndexPath(indexPath, assetURL: URL(string: data.videoUrl)!) |
| 501 | controlView.resetControlView() | 686 | controlView.resetControlView() |
| @@ -576,21 +761,56 @@ extension CNLiveShortVideoViewController { | @@ -576,21 +761,56 @@ extension CNLiveShortVideoViewController { | ||
| 576 | } | 761 | } |
| 577 | } | 762 | } |
| 578 | func listActionMethod(viewcell: CNLiveShortVideoListTableViewCell, button: UIButton) { | 763 | func listActionMethod(viewcell: CNLiveShortVideoListTableViewCell, button: UIButton) { |
| 579 | - pickerView = CNLiveShortVideoContentListView.showVideoContentListView(aid: viewcell.homeModel.albumMsgModel!.albumId,pageNum: self.pageNum,title: viewcell.homeModel.albumMsgModel!.albumName,dataArray: dataArray, episodeNow: viewcell.homeModel.albumMsgModel!.episodeNow, result: {[weak self] listModel in | 764 | + var arr = NSMutableArray() |
| 765 | + var pageNum:NSInteger = 1 | ||
| 766 | + if self.isDuanJuPlayer{ | ||
| 767 | + let listArr = self.realHotAllTotalArr[self.currentDuanJuIndex] as! [CNLiveAlbumListModel] | ||
| 768 | + arr.addObjects(from: listArr) | ||
| 769 | + pageNum = 1 | ||
| 770 | + }else{ | ||
| 771 | + arr.addObjects(from: self.dataArray as! [Any]) | ||
| 772 | + pageNum = self.pageNum | ||
| 773 | + } | ||
| 774 | + | ||
| 775 | + self.isTempDuanJuPlayer = self.isDuanJuPlayer | ||
| 776 | + self.isDuanJuPlayer = false | ||
| 777 | + pickerView = CNLiveShortVideoContentListView.showVideoContentListView(aid: viewcell.homeModel.albumMsgModel!.albumId,pageNum: pageNum,title: viewcell.homeModel.albumMsgModel!.albumName,dataArray: arr, episodeNow: viewcell.homeModel.albumMsgModel!.episodeNow, result: {[weak self] listModel in | ||
| 580 | guard let self = self else { return } | 778 | guard let self = self else { return } |
| 581 | - let index = self.dataArray.index(of: listModel) as NSInteger | ||
| 582 | - self.playTheIndex(index: index) | 779 | + |
| 780 | + if listModel is String{ | ||
| 781 | + //点击了x | ||
| 782 | + self.isDuanJuPlayer = self.isTempDuanJuPlayer | ||
| 783 | + }else{ | ||
| 784 | + //点击了cell | ||
| 785 | + //切换为剧集播放器 | ||
| 786 | + self.isDuanJuPlayer = false | ||
| 787 | + self.isTempDuanJuPlayer = false | ||
| 788 | + //更改数据源 | ||
| 789 | + self.dataArray.removeAllObjects() | ||
| 790 | + self.dataURLArray.removeAllObjects() | ||
| 791 | + let arr = self.realHotAllTotalArr[self.currentDuanJuIndex] as! [CNLiveAlbumListModel] | ||
| 792 | + self.dataArray.addObjects(from: arr) | ||
| 793 | + let urlArr = self.realHotAllTotalVideoUrlArr [self.currentDuanJuIndex] as! [String] | ||
| 794 | + self.dataURLArray.addObjects(from: urlArr) | ||
| 795 | + self.tableView.reloadData() | ||
| 796 | + let index = self.dataArray.index(of: listModel) as NSInteger | ||
| 797 | + self.playTheIndex(index: index) | ||
| 798 | + | ||
| 799 | + } | ||
| 583 | }, reload: {[weak self] page in | 800 | }, reload: {[weak self] page in |
| 584 | guard let self = self else { return } | 801 | guard let self = self else { return } |
| 585 | self.player.stopCurrentPlayingCell() | 802 | self.player.stopCurrentPlayingCell() |
| 586 | self.currentIndex = 0 | 803 | self.currentIndex = 0 |
| 587 | self.pageNum = page | 804 | self.pageNum = page |
| 805 | + | ||
| 806 | + | ||
| 588 | self.requestData { noMore in | 807 | self.requestData { noMore in |
| 589 | self.pickerView.tableView.mj_footer?.endRefreshing() | 808 | self.pickerView.tableView.mj_footer?.endRefreshing() |
| 590 | if noMore { | 809 | if noMore { |
| 591 | self.pickerView.tableView.mj_footer?.endRefreshingWithNoMoreData() | 810 | self.pickerView.tableView.mj_footer?.endRefreshingWithNoMoreData() |
| 592 | } | 811 | } |
| 593 | } | 812 | } |
| 813 | + | ||
| 594 | }) | 814 | }) |
| 595 | } | 815 | } |
| 596 | func payActionMethod(viewcell: CNLiveShortVideoListTableViewCell, button: UIButton) { | 816 | func payActionMethod(viewcell: CNLiveShortVideoListTableViewCell, button: UIButton) { |
metaCode/Classes/Main/VideoPage/View/CNLiveShortVideoContentListView.swift
| @@ -179,6 +179,7 @@ class CNLiveShortVideoContentListView: UIView, UITableViewDelegate, UITableViewD | @@ -179,6 +179,7 @@ class CNLiveShortVideoContentListView: UIView, UITableViewDelegate, UITableViewD | ||
| 179 | } | 179 | } |
| 180 | 180 | ||
| 181 | @objc func closeMethod() { | 181 | @objc func closeMethod() { |
| 182 | + self.resultBlock("") | ||
| 182 | removeFromSuperview() | 183 | removeFromSuperview() |
| 183 | } | 184 | } |
| 184 | 185 |
metaCode/Classes/Main/VideoPage/ViewModel/CNLiveShortVideoViewModel.swift
| @@ -50,6 +50,7 @@ class CNLiveShortVideoViewModel: NSObject { | @@ -50,6 +50,7 @@ class CNLiveShortVideoViewModel: NSObject { | ||
| 50 | tempArray.add(listModel) | 50 | tempArray.add(listModel) |
| 51 | tempUrlArray.add(listModel.videoUrl as String) | 51 | tempUrlArray.add(listModel.videoUrl as String) |
| 52 | } | 52 | } |
| 53 | + | ||
| 53 | reultShortVideoBlock([tempArray, resp_dict["hasNextPage"], tempUrlArray], .success) | 54 | reultShortVideoBlock([tempArray, resp_dict["hasNextPage"], tempUrlArray], .success) |
| 54 | } else { | 55 | } else { |
| 55 | let resp_dict = resp["data"] as! NSDictionary | 56 | let resp_dict = resp["data"] as! NSDictionary |