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 2012/11/28 01:18:41 UTC

ios commit: Fixed non-mp3 files not being able to be played using the Media API

Updated Branches:
  refs/heads/master cf5609fd2 -> 17a71e8b5


Fixed non-mp3 files not being able to be played using the Media API


Project: http://git-wip-us.apache.org/repos/asf/cordova-ios/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-ios/commit/17a71e8b
Tree: http://git-wip-us.apache.org/repos/asf/cordova-ios/tree/17a71e8b
Diff: http://git-wip-us.apache.org/repos/asf/cordova-ios/diff/17a71e8b

Branch: refs/heads/master
Commit: 17a71e8b5861a2948f04397a9914845bf51c3959
Parents: cf5609f
Author: Shazron Abdullah <sh...@apache.org>
Authored: Tue Nov 27 16:18:33 2012 -0800
Committer: Shazron Abdullah <sh...@apache.org>
Committed: Tue Nov 27 16:18:33 2012 -0800

----------------------------------------------------------------------
 CordovaLib/Classes/CDVSound.m |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/17a71e8b/CordovaLib/Classes/CDVSound.m
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/CDVSound.m b/CordovaLib/Classes/CDVSound.m
index 81cde78..f7a3adf 100644
--- a/CordovaLib/Classes/CDVSound.m
+++ b/CordovaLib/Classes/CDVSound.m
@@ -283,7 +283,7 @@
             // bug in AVAudioPlayer when playing downloaded data in NSData - we have to download the file and play from disk
             CFUUIDRef uuidRef = CFUUIDCreate(kCFAllocatorDefault);
             CFStringRef uuidString = CFUUIDCreateString(kCFAllocatorDefault, uuidRef);
-            NSString* filePath = [NSString stringWithFormat:@"%@/%@.mp3", [NSTemporaryDirectory ()stringByStandardizingPath], uuidString];
+            NSString* filePath = [NSString stringWithFormat:@"%@/%@", [NSTemporaryDirectory ()stringByStandardizingPath], uuidString];
             CFRelease(uuidString);
             CFRelease(uuidRef);
 
@@ -449,7 +449,7 @@
             }
         }
 
-        if (error != nil || recordingSuccess == NO) {
+        if ((error != nil) || (recordingSuccess == NO)) {
             if (error != nil) {
                 errorMsg = [NSString stringWithFormat:@"Failed to initialize AVAudioRecorder: %@\n", [error localizedFailureReason]];
             } else {