From 4fde6167a598a24069e0025cca2541bce093393e Mon Sep 17 00:00:00 2001 From: Johnny Date: Sat, 15 Jul 2023 07:21:13 +0100 Subject: [PATCH] remove buggy url encoding --- RNSound/RNSound.m | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/RNSound/RNSound.m b/RNSound/RNSound.m index 8ff31019..b89aabc8 100644 --- a/RNSound/RNSound.m +++ b/RNSound/RNSound.m @@ -198,18 +198,17 @@ - (NSDictionary *)constantsToExport { NSError *error; NSURL *fileNameUrl; AVAudioPlayer *player; - NSString* fileNameEscaped = [fileName stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; - if ([fileNameEscaped hasPrefix:@"http"]) { - fileNameUrl = [NSURL URLWithString:fileNameEscaped]; + if ([fileName hasPrefix:@"http"]) { + fileNameUrl = [NSURL URLWithString:fileName]; NSData *data = [NSData dataWithContentsOfURL:fileNameUrl]; player = [[AVAudioPlayer alloc] initWithData:data error:&error]; - } else if ([fileNameEscaped hasPrefix:@"ipod-library://"]) { - fileNameUrl = [NSURL URLWithString:fileNameEscaped]; + } else if ([fileName hasPrefix:@"ipod-library://"]) { + fileNameUrl = [NSURL URLWithString:fileName]; player = [[AVAudioPlayer alloc] initWithContentsOfURL:fileNameUrl error:&error]; } else { - fileNameUrl = [NSURL URLWithString:fileNameEscaped]; + fileNameUrl = [NSURL URLWithString:fileName]; player = [[AVAudioPlayer alloc] initWithContentsOfURL:fileNameUrl error:&error]; }