|
@@ -256,22 +256,7 @@ class MVHomeController: MVBaseController {
|
|
|
let cell: MVBannerCell? = self?.viewListView.collectionView.cellForItem(at: self?.lastBnnerSelectIndex ?? IndexPath()) as? MVBannerCell
|
|
|
cell?.progressView.progress = playProgress / duration
|
|
|
}
|
|
|
- PQSingletoVideoPlayer.shared.playStatusBloc = { [weak self] status in
|
|
|
|
|
|
- // 播放完成 自动播放下一个
|
|
|
- if status == .PQVIDEO_PLAY_STATUS_END {
|
|
|
- PQSingletoVideoPlayer.shared.playVideoData!.playProgress = 0
|
|
|
- if (self?.lastBnnerSelectIndex.row ?? 0) < (self?.mAllVideos.count ?? 0) - 1 {
|
|
|
- self?.lastBnnerSelectIndex = IndexPath(row: (self?.lastBnnerSelectIndex.row ?? 0) + 1, section: 0)
|
|
|
- self?.playVideo(page: (self?.lastBnnerSelectIndex ?? IndexPath(row: 0, section: 0)).row)
|
|
|
-
|
|
|
- // 视频列表跳转
|
|
|
- self?.viewListView.currentIndex = (self?.lastBnnerSelectIndex ?? IndexPath(row: 0, section: 0)).row
|
|
|
- self?.viewListView.scrollToItem(at: (self?.lastBnnerSelectIndex ?? IndexPath(row: 0, section: 0)).row, animated: false)
|
|
|
-
|
|
|
- } else { BFLog(message: "已经是最后一个视频。") }
|
|
|
- }
|
|
|
- }
|
|
|
// 添加协议
|
|
|
let showProtocal: String? = getUserDefaults(key: cShowProtocal) as? String
|
|
|
if showProtocal == nil || showProtocal?.count ?? 0 <= 0 || showProtocal != "1" {
|
|
@@ -529,6 +514,28 @@ extension MVHomeController {
|
|
|
cell?.pauseView.isHidden = true
|
|
|
PQSingletoVideoPlayer.shared.configPlyer(videoData: (cell?.videoData)!, controllerView: cell!.converView)
|
|
|
PQSingletoVideoPlayer.shared.startPlayr()
|
|
|
+ PQSingletoVideoPlayer.shared.progressBloc = { [weak self] _, playProgress, duration in
|
|
|
+
|
|
|
+ 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 / duration
|
|
|
+ }
|
|
|
+ PQSingletoVideoPlayer.shared.playStatusBloc = { [weak self] status in
|
|
|
+
|
|
|
+ // 播放完成 自动播放下一个
|
|
|
+ if status == .PQVIDEO_PLAY_STATUS_END {
|
|
|
+ PQSingletoVideoPlayer.shared.playVideoData!.playProgress = 0
|
|
|
+ if (self?.lastBnnerSelectIndex.row ?? 0) < (self?.mAllVideos.count ?? 0) - 1 {
|
|
|
+ self?.lastBnnerSelectIndex = IndexPath(row: (self?.lastBnnerSelectIndex.row ?? 0) + 1, section: 0)
|
|
|
+ self?.playVideo(page: (self?.lastBnnerSelectIndex ?? IndexPath(row: 0, section: 0)).row)
|
|
|
+
|
|
|
+ // 视频列表跳转
|
|
|
+ self?.viewListView.currentIndex = (self?.lastBnnerSelectIndex ?? IndexPath(row: 0, section: 0)).row
|
|
|
+ self?.viewListView.scrollToItem(at: (self?.lastBnnerSelectIndex ?? IndexPath(row: 0, section: 0)).row, animated: false)
|
|
|
+
|
|
|
+ } else { BFLog(message: "已经是最后一个视频。") }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|