浏览代码

路径问题fix

harry 3 年之前
父节点
当前提交
c580315bef
共有 1 个文件被更改,包括 3 次插入3 次删除
  1. 3 3
      BFRecordScreenKit/Classes/RecordScreen/View/BFRecordAvatarView.swift

+ 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