|
@@ -256,7 +256,7 @@ extension CommunityVideoListController: UICollectionViewDelegateFlowLayout,UICol
|
|
// MARK: -
|
|
// MARK: -
|
|
extension CommunityVideoListController {
|
|
extension CommunityVideoListController {
|
|
|
|
|
|
- func startPlay(_ cell: CommunityVideoCoverCollectionCell?) {
|
|
|
|
|
|
+ func startPlay(_ cell: CommunityVideoCoverCollectionCell?) {
|
|
cell?.play()
|
|
cell?.play()
|
|
}
|
|
}
|
|
|
|
|
|
@@ -267,12 +267,14 @@ extension CommunityVideoListController {
|
|
}
|
|
}
|
|
|
|
|
|
func playFirstVideoWhenViewDidAppeared() {
|
|
func playFirstVideoWhenViewDidAppeared() {
|
|
- let showCells = collectionView.visibleCells
|
|
|
|
- for tmpCell in showCells {
|
|
|
|
- let videoCell = tmpCell as? CommunityVideoCoverCollectionCell
|
|
|
|
- startPlay(videoCell)
|
|
|
|
- prePlayCell = videoCell
|
|
|
|
- break
|
|
|
|
|
|
+ DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + Double(Int64(0.2 * Double(NSEC_PER_SEC))) / Double(NSEC_PER_SEC)) { () -> Void in
|
|
|
|
+ let showCells = self.collectionView.visibleCells
|
|
|
|
+ for tmpCell in showCells {
|
|
|
|
+ let videoCell = tmpCell as? CommunityVideoCoverCollectionCell
|
|
|
|
+ self.startPlay(videoCell)
|
|
|
|
+ self.prePlayCell = videoCell
|
|
|
|
+ break
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|