nosnia-audio-recorder 0.9.2 → 0.9.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ios/NosniaAudioRecorder.mm +17 -11
- package/package.json +1 -1
|
@@ -66,11 +66,14 @@ RCT_EXPORT_MODULE(NosniaAudioRecorder)
|
|
|
66
66
|
NSTimeInterval currentTime = self->_audioRecorder.currentTime;
|
|
67
67
|
NSLog(@"[NosniaAudioRecorder] Sending progress: duration=%f ms", currentTime * 1000);
|
|
68
68
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
69
|
+
// Ensure event is sent on main thread
|
|
70
|
+
dispatch_async(dispatch_get_main_queue(), ^{
|
|
71
|
+
[self sendEventWithName:@"onRecordingProgress"
|
|
72
|
+
body:@{
|
|
73
|
+
@"duration": @(currentTime * 1000),
|
|
74
|
+
@"isRecording": @(self->_audioRecorder.isRecording)
|
|
75
|
+
}];
|
|
76
|
+
});
|
|
74
77
|
} else {
|
|
75
78
|
NSLog(@"[NosniaAudioRecorder] Skipping event: audioRecorder=%@, isRecording=%d",
|
|
76
79
|
self->_audioRecorder ? @"yes" : @"no", self->_isRecording);
|
|
@@ -127,12 +130,15 @@ RCT_EXPORT_MODULE(NosniaAudioRecorder)
|
|
|
127
130
|
RCT_EXPORT_METHOD(testEventEmitter) {
|
|
128
131
|
NSLog(@"[NosniaAudioRecorder] testEventEmitter called - sending test event");
|
|
129
132
|
NSLog(@"[NosniaAudioRecorder] hasListeners: %d", _hasListeners);
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
133
|
+
|
|
134
|
+
dispatch_async(dispatch_get_main_queue(), ^{
|
|
135
|
+
[self sendEventWithName:@"onRecordingProgress"
|
|
136
|
+
body:@{
|
|
137
|
+
@"duration": @(999.0),
|
|
138
|
+
@"isRecording": @(NO)
|
|
139
|
+
}];
|
|
140
|
+
NSLog(@"[NosniaAudioRecorder] Test event sent from main thread");
|
|
141
|
+
});
|
|
136
142
|
}
|
|
137
143
|
|
|
138
144
|
RCT_EXPORT_METHOD(startRecording:(NSDictionary *)options
|
package/package.json
CHANGED