|
@@ -45,12 +45,12 @@ class MVPlayViewController: PQBaseViewController {
|
|
} else {
|
|
} else {
|
|
automaticallyAdjustsScrollViewInsets = false
|
|
automaticallyAdjustsScrollViewInsets = false
|
|
}
|
|
}
|
|
- collectionView.addRefreshView(type: .REFRESH_TYPE_HEADER) { [weak self] isRefresh in
|
|
|
|
- self?.loadRequestData(isRefresh: isRefresh)
|
|
|
|
|
|
+ collectionView.addRefreshView(type: .REFRESH_TYPE_HEADER) { [weak self] _ in
|
|
|
|
+ self?.loadRequestData(isRefresh: true)
|
|
}
|
|
}
|
|
- // MJRefreshBackNormalFooter 不会附在上面
|
|
|
|
- // MJRefreshAutoFooter 不会便宜
|
|
|
|
- let footer = MJRefreshBackNormalFooter.init {[weak self] in
|
|
|
|
|
|
+ // MJRefreshAutoNormalFooter,MJRefreshAutoFooter,MJRefreshBackFooter
|
|
|
|
+ // MJRefreshFooter 无法显示noMoreData文字
|
|
|
|
+ let footer = MJRefreshAutoStateFooter.init { [weak self] in
|
|
self?.loadRequestData(isRefresh: false)
|
|
self?.loadRequestData(isRefresh: false)
|
|
}
|
|
}
|
|
footer.setTitle("暂时没有更多了", for: .noMoreData)
|
|
footer.setTitle("暂时没有更多了", for: .noMoreData)
|
|
@@ -90,7 +90,7 @@ class MVPlayViewController: PQBaseViewController {
|
|
if (self?.currentIndex?.item ?? 0) >= ((self?.itemsList.count ?? 0) - 2) {
|
|
if (self?.currentIndex?.item ?? 0) >= ((self?.itemsList.count ?? 0) - 2) {
|
|
self?.loadRequestData(isRefresh: false)
|
|
self?.loadRequestData(isRefresh: false)
|
|
}
|
|
}
|
|
- }else if status == .PQVIDEO_PLAY_STATUS_BEGIN{
|
|
|
|
|
|
+ } else if status == .PQVIDEO_PLAY_STATUS_BEGIN {
|
|
self?.isPlayEnd = false
|
|
self?.isPlayEnd = false
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -116,7 +116,7 @@ class MVPlayViewController: PQBaseViewController {
|
|
/// 请求网络数据
|
|
/// 请求网络数据
|
|
/// - Parameter isRefresh: <#isRefresh description#>
|
|
/// - Parameter isRefresh: <#isRefresh description#>
|
|
/// - Returns: <#description#>
|
|
/// - Returns: <#description#>
|
|
- func loadRequestData(isRefresh: Bool = true,isAutoPlay:Bool = false) {
|
|
|
|
|
|
+ func loadRequestData(isRefresh: Bool = true, isAutoPlay _: Bool = false) {
|
|
if isRequesting {
|
|
if isRequesting {
|
|
return
|
|
return
|
|
}
|
|
}
|
|
@@ -137,7 +137,7 @@ class MVPlayViewController: PQBaseViewController {
|
|
self?.collectionView.reloadData()
|
|
self?.collectionView.reloadData()
|
|
if self?.currentIndex == nil {
|
|
if self?.currentIndex == nil {
|
|
self?.scrollViewDidEndDecelerating(self!.collectionView)
|
|
self?.scrollViewDidEndDecelerating(self!.collectionView)
|
|
- }else if (self?.isPlayEnd ?? false), ((self?.currentIndex?.item ?? 0) + 1) < (self?.itemsList.count ?? 0) {
|
|
|
|
|
|
+ } else if self?.isPlayEnd ?? false, ((self?.currentIndex?.item ?? 0) + 1) < (self?.itemsList.count ?? 0) {
|
|
self?.collectionView.contentOffset = CGPoint(x: 0, y: CGFloat((self?.currentIndex?.item ?? 0) + 1) * (self!.collectionView.frame.height))
|
|
self?.collectionView.contentOffset = CGPoint(x: 0, y: CGFloat((self?.currentIndex?.item ?? 0) + 1) * (self!.collectionView.frame.height))
|
|
DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 0.2) { [weak self] in
|
|
DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 0.2) { [weak self] in
|
|
self?.scrollViewDidEndDecelerating(self!.collectionView)
|
|
self?.scrollViewDidEndDecelerating(self!.collectionView)
|
|
@@ -146,15 +146,15 @@ class MVPlayViewController: PQBaseViewController {
|
|
} else {
|
|
} else {
|
|
self?.pageNum = (self?.pageNum ?? 1) - 1
|
|
self?.pageNum = (self?.pageNum ?? 1) - 1
|
|
}
|
|
}
|
|
-// if isRefresh {
|
|
|
|
-// self?.collectionView.mj_header?.endRefreshing()
|
|
|
|
-// self?.collectionView.mj_footer?.resetNoMoreData()
|
|
|
|
-// } else {
|
|
|
|
-// self?.collectionView.mj_footer?.endRefreshing()
|
|
|
|
-// }
|
|
|
|
-// if (videoList?.count ?? 0) < 20 && videoList != nil {
|
|
|
|
-// self?.collectionView.mj_footer?.endRefreshingWithNoMoreData()
|
|
|
|
-// }
|
|
|
|
|
|
+ if isRefresh {
|
|
|
|
+ self?.collectionView.mj_header?.endRefreshing()
|
|
|
|
+ self?.collectionView.mj_footer?.resetNoMoreData()
|
|
|
|
+ } else {
|
|
|
|
+ self?.collectionView.mj_footer?.endRefreshing()
|
|
|
|
+ }
|
|
|
|
+ if (videoList?.count ?? 0) < 20, videoList != nil {
|
|
|
|
+ self?.collectionView.mj_footer?.endRefreshingWithNoMoreData()
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -191,7 +191,7 @@ extension MVPlayViewController: UICollectionViewDelegate, UICollectionViewDataSo
|
|
return
|
|
return
|
|
}
|
|
}
|
|
let indexPath = collectionView.indexPath(for: cell!)
|
|
let indexPath = collectionView.indexPath(for: cell!)
|
|
- if currentIndex != nil, currentIndex?.item == indexPath?.item,PQSingletoVideoPlayer.shared.playControllerView != nil {
|
|
|
|
|
|
+ if currentIndex != nil, currentIndex?.item == indexPath?.item, PQSingletoVideoPlayer.shared.playControllerView != nil {
|
|
// PQSingletoVideoPlayer.shared.resumePlayer()
|
|
// PQSingletoVideoPlayer.shared.resumePlayer()
|
|
return
|
|
return
|
|
}
|
|
}
|
|
@@ -243,6 +243,8 @@ extension MVPlayViewController: UICollectionViewDelegate, UICollectionViewDataSo
|
|
}
|
|
}
|
|
cHiddenHUB(superView: nil)
|
|
cHiddenHUB(superView: nil)
|
|
}
|
|
}
|
|
|
|
+ // 分享好友上报
|
|
|
|
+ reportUpload(isFriend: true, openId: "", shareId: shareId, videoData: videoData)
|
|
case 5: // 分享朋友圈
|
|
case 5: // 分享朋友圈
|
|
if !PQSingletoWXApiUtil.shared.isInstallWX() {
|
|
if !PQSingletoWXApiUtil.shared.isInstallWX() {
|
|
cShowHUB(superView: nil, msg: "您还未安装微信客户端!")
|
|
cShowHUB(superView: nil, msg: "您还未安装微信客户端!")
|
|
@@ -260,11 +262,24 @@ extension MVPlayViewController: UICollectionViewDelegate, UICollectionViewDataSo
|
|
cShowHUB(superView: nil, msg: "网络不佳哦")
|
|
cShowHUB(superView: nil, msg: "网络不佳哦")
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ // 分享朋友圈上报
|
|
|
|
+ reportUpload(isFriend: false, openId: "", shareId: shareId, videoData: videoData)
|
|
default:
|
|
default:
|
|
break
|
|
break
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ func reportUpload(isFriend: Bool, openId _: String, shareId: String, videoData: PQVideoListModel?) {
|
|
|
|
+ // 分享上报
|
|
|
|
+ PQEventTrackViewModel.videoRelationReportUpload(reportLogType: .reportLogType_Action, videoData: videoData, pageSource: nil, businessType: isFriend ? .bt_videoShareFriend : .bt_videoShareH5, objectType: nil, extParams: nil, shareId: shareId, videoIds: nil, playId: PQSingletoVideoPlayer.shared.playId)
|
|
|
|
+ if isFriend {
|
|
|
|
+ PQEventTrackViewModel.shareReportUpload(videoId: videoData?.uniqueId ?? "0", pageSource: videoData!.pageSource, recommendId: videoData?.recommendId, recommendLogVO: videoData?.recommendLogVO, abInfoData: videoData?.abInfoData, measureType: videoData?.measureType, measureId: videoData?.measureId, businessType: isFriend ? .bt_videoShareFriend : .bt_videoShareH5, targetUid: videoData?.userInfo?.uid, shareId: shareId)
|
|
|
|
+ PQEventTrackViewModel.shareReportUpload(screenType: 3, videoId: videoData?.uniqueId ?? "0", pageSource: videoData!.pageSource, recommendId: videoData?.recommendId, recommendLogVO: videoData?.recommendLogVO, abInfoData: videoData?.abInfoData, measureType: videoData?.measureType, measureId: videoData?.measureId, businessType: isFriend ? .bt_videoShareFriend : .bt_videoShareH5, targetUid: videoData?.userInfo?.uid, shareId: shareId)
|
|
|
|
+ } else {
|
|
|
|
+ PQEventTrackViewModel.shareReportUpload(screenType: 2, videoId: videoData?.uniqueId ?? "0", pageSource: videoData!.pageSource, recommendId: videoData?.recommendId, recommendLogVO: videoData?.recommendLogVO, abInfoData: videoData?.abInfoData, measureType: videoData?.measureType, measureId: videoData?.measureId, businessType: isFriend ? .bt_videoShareFriend : .bt_videoShareH5, targetUid: videoData?.userInfo?.uid, shareId: shareId)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
@objc func didBecomeActiveNotification() {
|
|
@objc func didBecomeActiveNotification() {
|
|
if currentActionBtn != nil {
|
|
if currentActionBtn != nil {
|
|
DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 1) {
|
|
DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 1) {
|