Переглянути джерело

修改图片素材的缩略图

harry 3 роки тому
батько
коміт
a1e5019b0c

+ 5 - 7
BFRecordScreenKit/Classes/BFRecordExport.swift

@@ -62,9 +62,9 @@ public class BFRecordExport {
             for (_, itemModel) in itemModels.enumerated() {
                 itemModel.videoStickers.removeAll()
                 
-                // 是否按录音顺序合成保留录音部分的 最终成果
+                // 保留录音部分时,是否按录音顺序合成最终视频
                 // 如果需要排序,则排视频的顺序;否则排音频的顺序
-                let needSort = false 
+                let needSort = false
                 if needSort {
                     
                 }else{
@@ -148,12 +148,10 @@ public class BFRecordExport {
                             subDur += range.duration.seconds
                         }
                         
-                        var subtitleDur = 0.0
                         for titleS in itemModel.titleStickers {
-                            let leng = titleS.timelineOut - titleS.timelineIn
-                            titleS.timelineIn = totalDur + subtitleDur
-                            titleS.timelineOut = totalDur + subtitleDur + leng
-                            subtitleDur += leng
+//                            let leng = titleS.timelineOut - titleS.timelineIn
+                            titleS.timelineIn = totalDur + titleS.timelineIn
+                            titleS.timelineOut = totalDur + titleS.timelineOut
                         }
                         totalDur += subDur
                     }

+ 8 - 1
BFRecordScreenKit/Classes/RecordScreen/View/BFVideoThumbProgressView.swift

@@ -119,7 +119,7 @@ class BFVideoThumbProgressView: UIView {
                 make.right.equalTo(width * -0.5)
                 make.bottom.equalToSuperview()
                 make.height.equalTo(6)
-                make.width.equalTo(CGFloat(count) * thumbImageWidth)
+                make.width.equalTo(CGFloat(count) * thumbImageWidth).priority(.high)
             }
             
             let fps = Double(count) / dur
@@ -165,6 +165,7 @@ class BFVideoThumbProgressView: UIView {
             if images.count > 0 {
 //                self?.thumbImgs = images
                 if let sself = self {
+                    var lastImg = UIImageView()
                     for (i, img) in images.enumerated() {
                         let iv = UIImageView(image: img)
                         iv.contentMode = .scaleAspectFill
@@ -176,6 +177,12 @@ class BFVideoThumbProgressView: UIView {
                             make.height.equalTo(50)
                             make.width.equalTo(sself.thumbImageWidth)
                         }
+                        lastImg = iv
+                    }
+                    if sself.recordItem?.mediaType == .IMAGE {
+                        lastImg.snp.makeConstraints { make in
+                            make.right.equalTo(sself.width * -0.5)
+                        }
                     }
                 }
             }