From f1cd0bf8c3dd7bcea56acee19ab33c1a58f1c8c8 Mon Sep 17 00:00:00 2001 From: "Juan S. Escobar" Date: Tue, 31 Mar 2020 11:14:33 -0500 Subject: [PATCH] Replicate change of PR #168 into startRecorder PR #168 fixed the possibility to add a custom path on iOS, but only for startPlayer, the same code is in startRecorder, so I replicated the change in that method also. --- ios/RNAudioRecorderPlayer.m | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ios/RNAudioRecorderPlayer.m b/ios/RNAudioRecorderPlayer.m index a52e86f9..72db4fb3 100644 --- a/ios/RNAudioRecorderPlayer.m +++ b/ios/RNAudioRecorderPlayer.m @@ -127,9 +127,13 @@ - (dispatch_queue_t)methodQueue NSNumber *audioQuality = [RCTConvert NSNumber:audioSets[@"AVEncoderAudioQualityKeyIOS"]]; if ([path isEqualToString:@"DEFAULT"]) { - audioFileURL = [NSURL fileURLWithPath:[GetDirectoryOfType_Sound(NSCachesDirectory) stringByAppendingString:@"sound.m4a"]]; + audioFileURL = [NSURL fileURLWithPath:[GetDirectoryOfType_Sound(NSCachesDirectory) stringByAppendingString:@"sound.m4a"]]; } else { - audioFileURL = [NSURL fileURLWithPath: [GetDirectoryOfType_Sound(NSCachesDirectory) stringByAppendingString:path]]; + if ([path rangeOfString:@"file://"].location == NSNotFound) { + audioFileURL = [NSURL fileURLWithPath: [GetDirectoryOfType_Sound(NSCachesDirectory) stringByAppendingString:path]]; + } else { + audioFileURL = [NSURL URLWithString:path]; + } } if (!sampleRate) {