Commit abbfdf3f authored by Mark Bradshaw's avatar Mark Bradshaw Committed by Andrew Grieve
Browse files

CB-5748 Make sure that Media.onStatus is called when recording is started.

parent 563b4b6d
Loading
Loading
Loading
Loading
+2 −0
Changes for src/ios/CDVSound.m: 2 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -561,6 +561,7 @@
                if (recordingSuccess) {
                    NSLog(@"Started recording audio sample '%@'", audioFile.resourcePath);
                    jsString = [NSString stringWithFormat:@"%@(\"%@\",%d,%d);", @"cordova.require('org.apache.cordova.media.Media').onStatus", mediaId, MEDIA_STATE, MEDIA_RUNNING];
                    [self.commandDelegate evalJs:jsString];
                }
            }
            
@@ -575,6 +576,7 @@
                    [self.avSession setActive:NO error:nil];
                }
                jsString = [NSString stringWithFormat:@"%@(\"%@\",%d,%@);", @"cordova.require('org.apache.cordova.media.Media').onStatus", mediaId, MEDIA_ERROR, [self createMediaErrorWithCode:MEDIA_ERR_ABORTED message:errorMsg]];
                [self.commandDelegate evalJs:jsString];
            }
        };