janpio closed pull request #165: CB-13852: (iOS) Fix bug prevent error on 
getPosition
URL: https://github.com/apache/cordova-plugin-media/pull/165
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/package.json b/package.json
index b7b2eb1f..8bf0e69d 100644
--- a/package.json
+++ b/package.json
@@ -1,5 +1,6 @@
 {
   "name": "cordova-plugin-media",
+
   "version": "5.0.3-dev",
   "description": "Cordova Media Plugin",
   "types": "./types/index.d.ts",
diff --git a/src/ios/CDVSound.m b/src/ios/CDVSound.m
index 7a00eadf..075d3504 100644
--- a/src/ios/CDVSound.m
+++ b/src/ios/CDVSound.m
@@ -643,6 +643,10 @@ - 
(void)getCurrentPositionAudio:(CDVInvokedUrlCommand*)command
        position = CMTimeGetSeconds(time);
     }
 
+    if (isnan(position)){
+        position = -1;
+    }
+
     CDVPluginResult* result = [CDVPluginResult 
resultWithStatus:CDVCommandStatus_OK messageAsDouble:position];
 
     [self onStatus:MEDIA_POSITION mediaId:mediaId param:@(position)];


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to