问题描述:
在使用 Media 插件时,如果保存路径设为 file.applicationStorageDirectory
,则不能保存录音文件,不能触发任何 CALLBACK 或 PROMISE,外部路径 file.externalApplicationStorageDirectory
就没问题。
解决方案:
参考资料:
具体步骤:
Just like what this guy <ihadeed> said:
- create new media file, enter file name only, not a full path. Example file.mp3
- record to the file
- stop recording
- wait a second or so (or wait for onStatusChange event to fire)
- now the file should be available at /sdcard/file.mp3... meaning you can retrieve it by calling this.file.resolveLocalFilesystemUrl(this.file.externalRootDirectory + 'file.mp3')
- you can now move the file elsewhere if you wish...
网友评论