|
@@ -14,7 +14,7 @@ class MVHomeController: MVBaseController {
|
|
|
let maxWidth: CGFloat = 9.0 / 16.0 * maxHeight
|
|
|
let margin = (cScreenWidth - maxWidth) / 2
|
|
|
let lineSpacing = margin - cDefaultMargin * 3
|
|
|
- let videoListView = MVBanner(frame: .zero, margin: margin, lineSpacing: lineSpacing, minScale: MVBanner.Scale(scale: 1))
|
|
|
+ let videoListView = MVBanner(frame: .zero, margin: margin, lineSpacing: 15, minScale: MVBanner.Scale(scale: 1))
|
|
|
videoListView.backgroundColor = UIColor.white
|
|
|
videoListView.register(classCellType: MVBannerCell.self)
|
|
|
return videoListView
|
|
@@ -57,7 +57,7 @@ class MVHomeController: MVBaseController {
|
|
|
let flowLayout = UICollectionViewFlowLayout()
|
|
|
flowLayout.sectionInset = UIEdgeInsets(top: 0, left: 11, bottom: 0, right: 11)
|
|
|
flowLayout.minimumLineSpacing = 0
|
|
|
- flowLayout.minimumInteritemSpacing = 10
|
|
|
+ flowLayout.minimumInteritemSpacing = 0
|
|
|
flowLayout.scrollDirection = .horizontal
|
|
|
let collectionView = UICollectionView(frame: CGRect(x: 0, y: 0, width: view.frame.width, height: 45), collectionViewLayout: flowLayout)
|
|
|
collectionView.showsVerticalScrollIndicator = false
|
|
@@ -183,10 +183,9 @@ class MVHomeController: MVBaseController {
|
|
|
// 播放器进度和状态回调
|
|
|
PQSingletoVideoPlayer.shared.progressBloc = { [weak self] loadProgress, playProgress, duration in
|
|
|
|
|
|
- BFLog(message: "loadProgress \(loadProgress) playProgress\(playProgress) \(duration)")
|
|
|
+ BFLog(message: "duration \(duration) playProgress\(playProgress) \(duration) 进度\(playProgress / duration)")
|
|
|
let cell: MVBannerCell? = self?.viewListView.collectionView.cellForItem(at: self?.lastBnnerSelectIndex ?? IndexPath()) as? MVBannerCell
|
|
|
-
|
|
|
- cell?.progressView.progress = playProgress / loadProgress
|
|
|
+ cell?.progressView.progress = playProgress / duration
|
|
|
}
|
|
|
PQSingletoVideoPlayer.shared.playStatusBloc = { [weak self] status in
|
|
|
|
|
@@ -366,13 +365,13 @@ class MVHomeController: MVBaseController {
|
|
|
|
|
|
// 卡点模块消失
|
|
|
@objc func stuckPointDismiss() {
|
|
|
- DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 0.5) { [weak self] in
|
|
|
+ DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 1) { [weak self] in
|
|
|
self?.controlPlayrPasueOrResume(isPause: false)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/// 获取用户状态信息
|
|
|
- /// - Returns: <#description#>
|
|
|
+ /// - Returns: description
|
|
|
func getUserInfo() {
|
|
|
PQMineViewModel.userStatus { _, _ in
|
|
|
}
|
|
@@ -390,6 +389,7 @@ extension MVHomeController {
|
|
|
let showProtocal: String? = getUserDefaults(key: cShowProtocal) as? String
|
|
|
if self.mVideos.count > 0, cell != nil, showProtocal != nil, showProtocal == "1" {
|
|
|
cell?.pauseView.isHidden = true
|
|
|
+ cell?.progressView.progress = 0
|
|
|
let videoInfo = self.mAllVideos[page]
|
|
|
videoInfo.playProgress = 0
|
|
|
PQSingletoVideoPlayer.shared.configPlyer(videoData: videoInfo, controllerView: cell!.converView)
|
|
@@ -419,6 +419,7 @@ extension MVHomeController {
|
|
|
// 控制播放器的暂停或恢复
|
|
|
func controlPlayrPasueOrResume(isPause: Bool) {
|
|
|
let cell: MVBannerCell? = viewListView.collectionView.cellForItem(at: lastBnnerSelectIndex) as? MVBannerCell
|
|
|
+ BFLog(message: " player isPause is \(isPause)")
|
|
|
if isPause {
|
|
|
cell?.pauseView.isHidden = false
|
|
|
PQSingletoVideoPlayer.shared.pausePlayer()
|
|
@@ -427,6 +428,7 @@ extension MVHomeController {
|
|
|
if rootViewController is UINavigationController {
|
|
|
rootViewController = (rootViewController as? UINavigationController)?.visibleViewController
|
|
|
}
|
|
|
+ BFLog(message: "rootViewController is \(rootViewController)")
|
|
|
if rootViewController is MVHomeController {
|
|
|
cell?.pauseView.isHidden = true
|
|
|
PQSingletoVideoPlayer.shared.resumePlayer()
|
|
@@ -485,9 +487,9 @@ extension MVHomeController: UICollectionViewDelegate, UICollectionViewDataSource
|
|
|
|
|
|
func collectionView(_ collectionView: UICollectionView, layout _: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
|
|
|
let itemData: MVHotVideoModel = mVideos[indexPath.item]
|
|
|
- let width: CGFloat = CGFloat(CGFloat(itemData.categoryName.ga_widthForComment(font: UIFont.boldSystemFont(ofSize: 17), height: 17.0)) + 36.0 + 20.0)
|
|
|
+ let width: CGFloat = CGFloat(CGFloat(itemData.categoryName.ga_widthForComment(font: UIFont.boldSystemFont(ofSize: 17), height: 17.0)) + 43)
|
|
|
|
|
|
- return CGSize(width: width, height: collectionView.frame.height - cDefaultMargin)
|
|
|
+ return CGSize(width: width, height: collectionView.frame.height - 14)
|
|
|
}
|
|
|
|
|
|
func collectionView(_: UICollectionView, didSelectItemAt indexPath: IndexPath) {
|