Commit 172df967 authored by shenyong's avatar shenyong

fix bus

parent 5c70d6fe
......@@ -100,6 +100,11 @@ class HomeView:UIView {
weakSelf.reloadHeadSize()
}
}
NotificationCenter.default.addObserver(forName: Notification.Name("applicationDidBecomeActive"), object: nil, queue: nil) {[weak self] _ in
guard let weakSelf = self else { return }
weakSelf.collectionView.reloadData()
}
}
func reloadHeadSize(){
......
......@@ -60,6 +60,12 @@ class HomeVideoCoverCell: UICollectionViewCell {
self.sizeLabel.text = String(format: "(%.2lf) GB" ,sizeKB/(1000 * 1000))
}
if videoPlayer.rate == 0,videoPlayer.currentItem != nil{
videoPlayer.seek(to: .zero)
videoPlayer.play()
}
// 2. 设置新数据
if let id = model.assets.first?.first?.localIdentifier{
// 保存当前的 identifier 用于验证
......@@ -213,12 +219,7 @@ extension HomeVideoCoverCell{
return
}
playerLayer.isHidden = false
if videoPlayer.rate == 0,videoPlayer.currentItem != nil{
videoPlayer.seek(to: .zero)
videoPlayer.play()
}
if videoURL == videoUrl{
// Print("地址相同,无需刷新")
return
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment