code: "ENSOSSTATUSERRORDOMAIN2003334207", message: "The operation couldn鈥檛 be completed. (OSStatus error 2003334207.)"
<key>NSAppTransportSecurity</key>
<dict>
<key>NSExceptionDomains</key>
<dict>
<key>localhost</key>
<dict>
<key>NSExceptionAllowsInsecureHTTPLoads</key>
<true/>
</dict>
</dict>
sound = new Sound('http://www.noiseaddicts.com/samples_1w72b820/4923.mp3', Sound.MAIN_BUNDLE, (error) => {
if (error) {
console.warn('failed to load sound, ', error);
} else {
// sound.play();
this.setState({
isPlaying: true,
});
}
});
I think you should replace Sound.MAIN_BUNDLE with '' (empty string). And for iOS - add www.noiseaddicts.com to exception domains
@Andrfas Solution worked fine, Thanks!
For iOS what worked for me is the following:
npm run iosThis is my code:
const sound = new Sound(
"myFile.mp3",
Sound.MAIN_BUNDLE,
error => {
if (error) {
console.log("failed to load the sound", error);
return;
}
sound.play(() => sound.release());
}
);
// The play dispatcher
sound.play();
Most helpful comment
I think you should replace
Sound.MAIN_BUNDLEwith''(empty string). And for iOS - addwww.noiseaddicts.comto exception domains