You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by sh...@apache.org on 2016/06/20 23:15:30 UTC

cordova-plugin-media git commit: CB-11458 - media.spec.25 'should be able to play an audio stream' fails on iOS platform

Repository: cordova-plugin-media
Updated Branches:
  refs/heads/master f8cae719c -> f206e96d5


CB-11458 - media.spec.25 'should be able to play an audio stream' fails on iOS platform


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media/commit/f206e96d
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media/tree/f206e96d
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media/diff/f206e96d

Branch: refs/heads/master
Commit: f206e96d50d5bddc88b1e8775f3e5960fa78182f
Parents: f8cae71
Author: Shazron Abdullah <sh...@apache.org>
Authored: Mon Jun 20 16:16:50 2016 -0700
Committer: Shazron Abdullah <sh...@apache.org>
Committed: Mon Jun 20 16:16:50 2016 -0700

----------------------------------------------------------------------
 src/ios/CDVSound.m | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-media/blob/f206e96d/src/ios/CDVSound.m
----------------------------------------------------------------------
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];


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org