|
|
|
@ -27,7 +27,10 @@ const prepareRNFSFile = (data: RNFS.StatResult): IFile => {
@@ -27,7 +27,10 @@ const prepareRNFSFile = (data: RNFS.StatResult): IFile => {
|
|
|
|
|
return { |
|
|
|
|
name: getFileName(data), |
|
|
|
|
size: data.size, |
|
|
|
|
type: getFileExtension(getFileName(data)), |
|
|
|
|
type: Platform.select({ |
|
|
|
|
ios: getFileExtension(getFileName(data)), |
|
|
|
|
android: 'audio/mpeg' |
|
|
|
|
}) , |
|
|
|
|
uri: getFileUri(data), |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -35,7 +38,6 @@ const prepareRNFSFile = (data: RNFS.StatResult): IFile => {
@@ -35,7 +38,6 @@ const prepareRNFSFile = (data: RNFS.StatResult): IFile => {
|
|
|
|
|
const getFileStat = async (filePath: string): Promise<IFile> => { |
|
|
|
|
try { |
|
|
|
|
const fileStat = await RNFS.stat(prepareUriToRNFS(filePath)) |
|
|
|
|
|
|
|
|
|
return prepareRNFSFile(fileStat) |
|
|
|
|
} catch (err) { |
|
|
|
|
console.log('getFileStat ERR:', err) |
|
|
|
|