incubator-callback-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fil...@apache.org
Subject [2/2] ios commit: [CB-571] stubbed out create method to remove error when creating Media objects, also added another check if file does not exist.
Date Fri, 27 Apr 2012 17:19:59 GMT
[CB-571] stubbed out create method to remove error when creating Media objects, also added
another check if file does not exist.


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

Branch: refs/heads/master
Commit: 098ac7cfe1bc64d06be19ebd2e7cefa8c3b9713c
Parents: 9b87baa
Author: Fil Maj <maj.fil@gmail.com>
Authored: Fri Apr 27 10:22:05 2012 -0700
Committer: Fil Maj <maj.fil@gmail.com>
Committed: Fri Apr 27 10:22:05 2012 -0700

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


http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/098ac7cf/CordovaLib/Classes/CDVSound.m
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/CDVSound.m b/CordovaLib/Classes/CDVSound.m
index 497f51f..706ae30 100644
--- a/CordovaLib/Classes/CDVSound.m
+++ b/CordovaLib/Classes/CDVSound.m
@@ -149,6 +149,13 @@
     NSLog(@"play is DEPRECATED!  Use startPlayingAudio.");
     [self startPlayingAudio:arguments withDict:options];
 }
+
+// not used
+- (void) create:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options
+{
+}
+
+
 - (void) startPlayingAudio:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options
 {
 
@@ -249,7 +256,7 @@
     }
     
     if (playerError != nil) {
-        NSLog(@"Failed to initialize AVAudioPlayer: %@\n", [playerError localizedFailureReason]);
+        NSLog(@"Failed to initialize AVAudioPlayer: %@\n", [playerError localizedDescription]);
         audioFile.player = nil;
         if (self.avSession) {
             [self.avSession setActive:NO error:nil];
@@ -502,7 +509,11 @@
 			NSLog(@"Started recording audio sample '%@'", audioFile.resourcePath);
             jsString = [NSString stringWithFormat: @"%@(\"%@\",%d,%d);", @"cordova.require('cordova/plugin/Media').onStatus",
mediaId, MEDIA_STATE, MEDIA_RUNNING];
 		}
-	}
+	} else {
+        // file does not exist
+        NSLog(@"Could not start recording audio, file '%@' does not exist.", audioFile.resourcePath);
+        jsString = [NSString stringWithFormat: @"%@(\"%@\",%d,%@);", @"cordova.require('cordova/plugin/Media').onStatus",
mediaId, MEDIA_ERROR, [self createMediaErrorWithCode: MEDIA_ERR_ABORTED message: @"File to
record to does not exist"]];
+    }
     if (jsString) {
        [super writeJavascript:jsString]; 
     }


Mime
View raw message