hyochan / react-native-audio-recorder-player

react-native native module for audio recorder and player.
MIT License
681 stars 203 forks source link

IOS crash when file URI contains spaces #571

Open MarioUnlam opened 7 months ago

MarioUnlam commented 7 months ago

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:

https://github.com/doublesymmetry/react-native-track-player/issues/167 https://github.com/doublesymmetry/react-native-track-player/pull/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

1) Save an audio file in a folder containing spaces. For example: RNFS.DocumentDirectoryPath + '/My files/" + filename; Also happens if the filename has spaces. 2) Try to play the audio file using audioRecorderPlayer.startPlayer()