fix(mobile): format of recorder audio file

This commit is contained in:
charlie
2022-10-28 15:42:08 +08:00
committed by Tienson Qin
parent 84924c66d5
commit 65e77e6523
4 changed files with 8 additions and 7 deletions

View File

@@ -226,7 +226,8 @@
(str "file://" (js/encodeURI dir)))
dir)
path (some-> path (string/replace #"^/+" ""))
encode-url #(let [encoded-chars? (boolean (re-find #"(?i)%[0-9a-f]{2}" path))]
encode-url #(let [encoded-chars?
(and (string? %) (boolean (re-find #"(?i)%[0-9a-f]{2}" %)))]
(cond-> %
(not encoded-chars?)
(js/encodeURI path)))]

View File

@@ -44,7 +44,7 @@
(defn- embed-audio [database64]
(p/let [page (or (state/get-current-page) (string/lower-case (date/journal-name)))
filename (str (date/get-date-time-string-2) ".m4a")
filename (str (date/get-date-time-string-2) ".aac")
edit-block (state/get-edit-block)
format (or (:block/format edit-block) (db/get-page-format page))
path (editor-handler/get-asset-path filename)