Skip to content

Commit b61d97c

Browse files
Leo Schubertfilmaj
authored andcommitted
CB-12542: (ios) Fix wav file recording, add m4a extension. make IOS status handling compatible with Android/Windows
implement a "messageChannel" command and if the messageChannel command is called the plugin hands back results to the plugin container via "sendPluginResult" instead of "evalJs" even for oldschool usage it cleans the code Closes #134.
1 parent 3353eac commit b61d97c

File tree

3 files changed

+97
-94
lines changed

3 files changed

+97
-94
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,7 @@ function recordAudio() {
558558

559559
### iOS Quirks
560560

561-
- iOS only records to files of type _.wav_ and returns an error if the file name extension is not correct.
561+
- iOS only records to files of type _.wav_ and _.m4a_ and returns an error if the file name extension is not correct.
562562

563563
- If a full path is not provided, the recording is placed in the application's `documents/tmp` directory. This can be accessed via the `File` API using `LocalFileSystem.TEMPORARY`. Any subdirectory specified at record time must already exist.
564564

src/ios/CDVSound.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,12 @@ typedef NSUInteger CDVMediaMsg;
8787
NSString* currMediaId;
8888
AVAudioSession* avSession;
8989
AVPlayer* avPlayer;
90+
NSString* statusCallbackId;
9091
}
9192
@property (nonatomic, strong) NSMutableDictionary* soundCache;
9293
@property (nonatomic, strong) AVAudioSession* avSession;
9394
@property (nonatomic, strong) NSString* currMediaId;
95+
@property (nonatomic, strong) NSString* statusCallbackId;
9496

9597
- (void)startPlayingAudio:(CDVInvokedUrlCommand*)command;
9698
- (void)pausePlayingAudio:(CDVInvokedUrlCommand*)command;
@@ -110,7 +112,7 @@ typedef NSUInteger CDVMediaMsg;
110112
- (CDVAudioFile*)audioFileForResource:(NSString*)resourcePath withId:(NSString*)mediaId doValidation:(BOOL)bValidate forRecording:(BOOL)bRecord;
111113
- (CDVAudioFile*)audioFileForResource:(NSString*)resourcePath withId:(NSString*)mediaId doValidation:(BOOL)bValidate forRecording:(BOOL)bRecord suppressValidationErrors:(BOOL)bSuppress;
112114
- (BOOL)prepareToPlay:(CDVAudioFile*)audioFile withId:(NSString*)mediaId;
113-
- (NSString*)createMediaErrorWithCode:(CDVMediaError)code message:(NSString*)message;
115+
- (NSDictionary*)createMediaErrorWithCode:(CDVMediaError)code message:(NSString*)message;
114116

115117
- (void)startRecordingAudio:(CDVInvokedUrlCommand*)command;
116118
- (void)stopRecordingAudio:(CDVInvokedUrlCommand*)command;

0 commit comments

Comments
 (0)