|
@@ -1427,20 +1427,21 @@ public class BFRecordScreenController: BFBaseViewController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ // 修正视频旋转方向,因为自己录制的竖屏视频会预览为横屏
|
|
|
func reloadMaterial(recordItem: BFRecordItemModel) {
|
|
|
-
|
|
|
- if let path = recordItem.localPath, let lastCell: BFImageCoverViewCell = collectionView.cellForItem(at: IndexPath(item: currItemModelIndex, section: 0)) as? BFImageCoverViewCell {
|
|
|
- setVideoPlay(item: recordItem.playItem, imageView: lastCell.playView)
|
|
|
+ if let path = recordItem.localPath, let cell: BFImageCoverViewCell = collectionView.cellForItem(at: IndexPath(item: currItemModelIndex, section: 0)) as? BFImageCoverViewCell {
|
|
|
+ setVideoPlay(item: recordItem.playItem, imageView: cell.playView)
|
|
|
setAudioPlay(item: recordItem.playItem)
|
|
|
-
|
|
|
+ playBtn = cell.playBtn
|
|
|
+
|
|
|
let degress = degressFromVideoFile(url: URL(fileURLWithPath: path))
|
|
|
switch degress {
|
|
|
case 90:
|
|
|
- lastCell.playView.setInputRotation(GPUImageRotationMode(rawValue: 2), at: 0)
|
|
|
+ cell.playView.setInputRotation(GPUImageRotationMode(rawValue: 2), at: 0)
|
|
|
case 180:
|
|
|
- lastCell.playView.setInputRotation(GPUImageRotationMode(rawValue: 7), at: 0)
|
|
|
+ cell.playView.setInputRotation(GPUImageRotationMode(rawValue: 7), at: 0)
|
|
|
case 270:
|
|
|
- lastCell.playView.setInputRotation(GPUImageRotationMode(rawValue: 1), at: 0)
|
|
|
+ cell.playView.setInputRotation(GPUImageRotationMode(rawValue: 1), at: 0)
|
|
|
default:
|
|
|
break
|
|
|
}
|
|
@@ -1531,6 +1532,14 @@ extension BFRecordScreenController: UICollectionViewDelegate, UICollectionViewDa
|
|
|
// 重置播放器
|
|
|
assetPlayer?.seek(to: CMTime.zero)
|
|
|
recordPlayer?.seek(to: CMTime.zero)
|
|
|
+
|
|
|
+ // 重设撤销栈
|
|
|
+ events.append(WithDrawModel(type: 0, timestamp: 0))
|
|
|
+ itemModels[currItemModelIndex].events = events
|
|
|
+ events = itemModels[page].events
|
|
|
+
|
|
|
+ // 更新当前page
|
|
|
+ currItemModelIndex = page
|
|
|
if recordItem.mediaType == .VIDEO {
|
|
|
reloadMaterial(recordItem: recordItem)
|
|
|
assetPlayer?.seek(to: .zero, toleranceBefore: CMTime(value: 1, timescale: 1_000_000), toleranceAfter: CMTime(value: 1, timescale: 1_000_000))
|
|
@@ -1538,15 +1547,9 @@ extension BFRecordScreenController: UICollectionViewDelegate, UICollectionViewDa
|
|
|
if changeItemHandle != nil {
|
|
|
changeItemHandle!(page)
|
|
|
}
|
|
|
- // 重设撤销栈
|
|
|
- itemModels[currItemModelIndex].events = events
|
|
|
- events = itemModels[page].events
|
|
|
- events.append(WithDrawModel(type: 0, timestamp: 0))
|
|
|
- if let cell = collectionView.visibleCells.first as? BFImageCoverViewCell {
|
|
|
- playBtn = cell.playBtn
|
|
|
- }
|
|
|
- // 更新当前page
|
|
|
- currItemModelIndex = page
|
|
|
+
|
|
|
+// movie?.startProcessing()
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
|