diff --git a/src/ios/CDVSound.m b/src/ios/CDVSound.m index b12c0fb1..3915467a 100644 --- a/src/ios/CDVSound.m +++ b/src/ios/CDVSound.m @@ -604,8 +604,13 @@ - (void)getCurrentPositionAudio:(CDVInvokedUrlCommand*)command CDVAudioFile* audioFile = [[self soundCache] objectForKey:mediaId]; double position = -1; - if ((audioFile != nil) && (audioFile.player != nil) && [audioFile.player isPlaying]) { - position = round(audioFile.player.currentTime * 1000) / 1000; + if (audioFile != nil) { + if ((audioFile.player != nil) && [audioFile.player isPlaying]){ + position = round(audioFile.player.currentTime * 1000) / 1000; + } + else if ((audioFile.recorder != nil) && [audioFile.recorder isRecording]) { + position = round(audioFile.recorder.currentTime * 1000) / 1000; + } } if (avPlayer) { CMTime time = [avPlayer currentTime];