CB-11458 - media.spec.25 'should be able to play an audio stream' fails on iOS platform
diff --git a/src/ios/CDVSound.m b/src/ios/CDVSound.m
index df40d7d..1a78288 100644
--- a/src/ios/CDVSound.m
+++ b/src/ios/CDVSound.m
@@ -18,6 +18,7 @@
 #import "CDVSound.h"
 #import "CDVFile.h"
 #import <AVFoundation/AVFoundation.h>
+#include <math.h>
 
 #define DOCUMENTS_SCHEME_PREFIX @"documents://"
 #define HTTP_SCHEME_PREFIX @"http://"
@@ -345,6 +346,9 @@
                 if (avPlayer.currentItem && avPlayer.currentItem.asset) {
                     CMTime time = avPlayer.currentItem.asset.duration;
                     position = CMTimeGetSeconds(time);
+                    if (isnan(position)) {
+                        position = 0;
+                    }
 
                     if (audioFile.rate != nil){
                         float customRate = [audioFile.rate floatValue];