[ 
https://issues.apache.org/jira/browse/CB-13852?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16637226#comment-16637226
 ] 

ASF GitHub Bot commented on CB-13852:
-------------------------------------

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:
us...@infra.apache.org


> cordova-plugin-media getPosition audio failed
> ---------------------------------------------
>
>                 Key: CB-13852
>                 URL: https://issues.apache.org/jira/browse/CB-13852
>             Project: Apache Cordova
>          Issue Type: Improvement
>          Components: cordova-plugin-media
>    Affects Versions: cordova-ios 4.5.0
>         Environment: iOS all versions
>            Reporter: Juan Sebastian Dussan Cubides
>            Priority: Minor
>
> (iOS)
> When I try to get the position of an audio that had an error while loading, 
> the crash appose exponentially because it can not cast the time = none



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org

Reply via email to