IOS crash when file URI contains spaces
MarioUnlam opened this issue · 0 comments
Hi. There seems to be a problem with file URIs containing spaces, on iOS. If there's any space in the URI, either in a subdirectory or the filename, when I try to play it, the app crashes without any JS errors. I found out what whas happening thanks to a bug report from a different library, "react-native-track-player", so it seems to be an issue with the OS. The post mentions something about encoding the URI, but it didn't work for me. If I use encodeURI, the plugin simply fails to play the audio, so I guess it needs to be fixed on the native side. More info here:
doublesymmetry/react-native-track-player#167
doublesymmetry/react-native-track-player#950
Version of react-native-audio-recorder-player
3.6.4
Version of React Native
0.70.6
Platforms you faced the error (IOS or Android or both?)
iOS
Expected behavior
Play audio file normally, regardless of path
Actual behavior
App crashes without error
Steps to reproduce the behabior
- Save an audio file in a folder containing spaces. For example:
RNFS.DocumentDirectoryPath + '/My files/" + filename;
Also happens if the filename has spaces. - Try to play the audio file using audioRecorderPlayer.startPlayer()