Quellcode durchsuchen

路径问题fix

harry vor 3 Jahren
Ursprung
Commit
c580315bef

+ 3 - 3
BFRecordScreenKit/Classes/RecordScreen/View/BFRecordAvatarView.swift

@@ -142,12 +142,12 @@ class BFRecordAvatarView: UIView {
             self.camera.audioEncodingTarget = nil
             self.movieOutput = nil
 
-            if self.recorderFilePath != nil && (self.recorderFilePath?.count ?? 0) > 0 {
+            if let filePath = self.recorderFilePath, filePath.count > 0 {
                 BFLog(message: "录制成功:\(self.recorderFilePath ?? "")")
-                self.recorderFilePath = self.recorderFilePath?.replacingOccurrences(of: documensDirectory, with: "")
+                self.recorderFilePath = filePath.replacingOccurrences(of: documensDirectory, with: "")
 
                 // 拼接回调 model
-                let movieAsset = AVURLAsset(url: URL(fileURLWithPath: self.recorderFilePath!), options: avAssertOptions)
+                let movieAsset = AVURLAsset(url: URL(fileURLWithPath: filePath), options: avAssertOptions)
 
                 let movieInfo: PQEditVisionTrackMaterialsModel = PQEditVisionTrackMaterialsModel()
                 movieInfo.type = StickerType.VIDEO.rawValue