|
@@ -518,7 +518,7 @@ class BFRecordScreenCameraManager: BFRecordScreenBaseManager {
|
|
let su = (avplayer.currentItem?.asset as? AVURLAsset)?.url.lastPathComponent != (mod.locationPath as NSString?)?.lastPathComponent
|
|
let su = (avplayer.currentItem?.asset as? AVURLAsset)?.url.lastPathComponent != (mod.locationPath as NSString?)?.lastPathComponent
|
|
|
|
|
|
if !su {
|
|
if !su {
|
|
- if avplayer.timeControlStatus == .paused {
|
|
|
|
|
|
+ if avplayer.timeControlStatus == .paused && needPlay{
|
|
avplayer.play()
|
|
avplayer.play()
|
|
setCoverImage(currentAssetProgress)
|
|
setCoverImage(currentAssetProgress)
|
|
|
|
|
|
@@ -547,6 +547,8 @@ class BFRecordScreenCameraManager: BFRecordScreenBaseManager {
|
|
})
|
|
})
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
|
|
+ avplayerReplaceItem(newItem: nil)
|
|
|
|
+
|
|
locationTo(time: currentAssetProgress)
|
|
locationTo(time: currentAssetProgress)
|
|
playerCoverIV.isHidden = true
|
|
playerCoverIV.isHidden = true
|
|
BFLog(1, message: "prepareToPlayNext: 没找到 \(currentAssetProgress.seconds)")
|
|
BFLog(1, message: "prepareToPlayNext: 没找到 \(currentAssetProgress.seconds)")
|
|
@@ -577,19 +579,19 @@ class BFRecordScreenCameraManager: BFRecordScreenBaseManager {
|
|
if BFAudioPlayer.shared.player?.isPlaying ?? false {
|
|
if BFAudioPlayer.shared.player?.isPlaying ?? false {
|
|
wself.recordPlayer?.pause()
|
|
wself.recordPlayer?.pause()
|
|
}
|
|
}
|
|
- // 如果离结束大于0.7s,代表还有下一段视频
|
|
|
|
- if ((wself.recordItem?.materialDuraion ?? .zero) - wself.currentAssetProgress).seconds > 0.7 {
|
|
|
|
-// wself.findNextModel()
|
|
|
|
-// wself.setCoverImage(wself.currentAssetProgress)
|
|
|
|
-
|
|
|
|
-// wself.prepareToPlayNext()
|
|
|
|
- } else {
|
|
|
|
- // 播放到末尾了
|
|
|
|
- wself.dele?.isEndPlay = true
|
|
|
|
- wself.dele?.pause()
|
|
|
|
-// wself.playerLayer.removeFromSuperlayer()
|
|
|
|
- wself.playerCoverIV.isHidden = true
|
|
|
|
- }
|
|
|
|
|
|
+// // 如果离结束大于0.7s,代表还有下一段视频
|
|
|
|
+// if ((wself.recordItem?.materialDuraion ?? .zero) - wself.currentAssetProgress).seconds > 0.7 {
|
|
|
|
+//// wself.findNextModel()
|
|
|
|
+//// wself.setCoverImage(wself.currentAssetProgress)
|
|
|
|
+//
|
|
|
|
+//// wself.prepareToPlayNext()
|
|
|
|
+// } else {
|
|
|
|
+// // 播放到末尾了
|
|
|
|
+// wself.dele?.isEndPlay = true
|
|
|
|
+// wself.dele?.pause()
|
|
|
|
+//// wself.playerLayer.removeFromSuperlayer()
|
|
|
|
+// wself.playerCoverIV.isHidden = true
|
|
|
|
+// }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -622,9 +624,9 @@ class BFRecordScreenCameraManager: BFRecordScreenBaseManager {
|
|
playerCoverIV.image = getThumbImageAtTime(urlAsset: AVURLAsset(url: URL(fileURLWithPath: mod.locationPath)), time: currentAssetProgress - mod.timelineCMIn)
|
|
playerCoverIV.image = getThumbImageAtTime(urlAsset: AVURLAsset(url: URL(fileURLWithPath: mod.locationPath)), time: currentAssetProgress - mod.timelineCMIn)
|
|
playerCoverIV.isHidden = false
|
|
playerCoverIV.isHidden = false
|
|
|
|
|
|
- avplayerReplaceItem(newItem: AVPlayerItem(url: URL(fileURLWithPath: mod.locationPath)))
|
|
|
|
|
|
+// avplayerReplaceItem(newItem: AVPlayerItem(url: URL(fileURLWithPath: mod.locationPath)))
|
|
|
|
|
|
-// prepareToPlayNext(needPlay: false)
|
|
|
|
|
|
+ prepareToPlayNext(needPlay: false)
|
|
} else {
|
|
} else {
|
|
playerCoverIV.isHidden = true
|
|
playerCoverIV.isHidden = true
|
|
avplayerReplaceItem(newItem: nil)
|
|
avplayerReplaceItem(newItem: nil)
|
|
@@ -653,8 +655,8 @@ class BFRecordScreenCameraManager: BFRecordScreenBaseManager {
|
|
|
|
|
|
cameraProgressV?.isHidden = false
|
|
cameraProgressV?.isHidden = false
|
|
|
|
|
|
- prepareToPlayNext(needPlay: false)
|
|
|
|
- avplayerReplaceItem(newItem: nil)
|
|
|
|
|
|
+// prepareToPlayNext(needPlay: false)
|
|
|
|
+// avplayerReplaceItem(newItem: nil)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -708,6 +710,7 @@ class BFRecordScreenCameraManager: BFRecordScreenBaseManager {
|
|
dele?.isEndPlay = true
|
|
dele?.isEndPlay = true
|
|
isPlaying = false
|
|
isPlaying = false
|
|
dele?.pause()
|
|
dele?.pause()
|
|
|
|
+ playerCoverIV.isHidden = true
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
|