You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by al...@apache.org on 2016/08/26 22:39:45 UTC

cordova-plugin-media git commit: CB-11380 (ios) Overloaded audioFileForResource method instead of modifying its signature

Repository: cordova-plugin-media
Updated Branches:
  refs/heads/master bbb784312 -> 0405a2ee2


CB-11380 (ios) Overloaded audioFileForResource method instead of modifying its signature


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/0405a2ee
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media/tree/0405a2ee
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media/diff/0405a2ee

Branch: refs/heads/master
Commit: 0405a2ee2bfc7520e121e50483b2b5310e5e66bd
Parents: bbb7843
Author: Alexander Sorokin <al...@akvelon.com>
Authored: Fri Aug 26 21:41:51 2016 +0300
Committer: Alexander Sorokin <al...@akvelon.com>
Committed: Fri Aug 26 22:19:37 2016 +0300

----------------------------------------------------------------------
 src/ios/CDVSound.h |  1 +
 src/ios/CDVSound.m | 10 ++++++++--
 2 files changed, 9 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-media/blob/0405a2ee/src/ios/CDVSound.h
----------------------------------------------------------------------
diff --git a/src/ios/CDVSound.h b/src/ios/CDVSound.h
index c3f7a6c..2f1d0e0 100644
--- a/src/ios/CDVSound.h
+++ b/src/ios/CDVSound.h
@@ -106,6 +106,7 @@ typedef NSUInteger CDVMediaMsg;
 - (NSURL*)urlForRecording:(NSString*)resourcePath;
 - (NSURL*)urlForPlaying:(NSString*)resourcePath;
 
+- (CDVAudioFile*)audioFileForResource:(NSString*)resourcePath withId:(NSString*)mediaId doValidation:(BOOL)bValidate forRecording:(BOOL)bRecord;
 - (CDVAudioFile*)audioFileForResource:(NSString*)resourcePath withId:(NSString*)mediaId doValidation:(BOOL)bValidate forRecording:(BOOL)bRecord suppressValidationErrors:(BOOL)bSuppress;
 - (BOOL)prepareToPlay:(CDVAudioFile*)audioFile withId:(NSString*)mediaId;
 - (NSString*)createMediaErrorWithCode:(CDVMediaError)code message:(NSString*)message;

http://git-wip-us.apache.org/repos/asf/cordova-plugin-media/blob/0405a2ee/src/ios/CDVSound.m
----------------------------------------------------------------------
diff --git a/src/ios/CDVSound.m b/src/ios/CDVSound.m
index ddb524e..98de46f 100644
--- a/src/ios/CDVSound.m
+++ b/src/ios/CDVSound.m
@@ -181,6 +181,12 @@
     return audioFile;
 }
 
+// Creates or gets the cached audio file resource object
+- (CDVAudioFile*)audioFileForResource:(NSString*)resourcePath withId:(NSString*)mediaId doValidation:(BOOL)bValidate forRecording:(BOOL)bRecord
+{
+    return [self audioFileForResource:resourcePath withId:mediaId doValidation:bValidate forRecording:bRecord suppressValidationErrors:NO];
+}
+
 // returns whether or not audioSession is available - creates it if necessary
 - (BOOL)hasAudioSession
 {
@@ -313,7 +319,7 @@
     BOOL bError = NO;
     NSString* jsString = nil;
 
-    CDVAudioFile* audioFile = [self audioFileForResource:resourcePath withId:mediaId doValidation:YES forRecording:NO suppressValidationErrors:NO];
+    CDVAudioFile* audioFile = [self audioFileForResource:resourcePath withId:mediaId doValidation:YES forRecording:NO];
     if ((audioFile != nil) && (audioFile.resourceURL != nil)) {
         if (audioFile.player == nil) {
             bError = [self prepareToPlay:audioFile withId:mediaId];
@@ -636,7 +642,7 @@
 #pragma unused(callbackId)
 
     NSString* mediaId = [command argumentAtIndex:0];
-    CDVAudioFile* audioFile = [self audioFileForResource:[command argumentAtIndex:1] withId:mediaId doValidation:YES forRecording:YES suppressValidationErrors:NO];
+    CDVAudioFile* audioFile = [self audioFileForResource:[command argumentAtIndex:1] withId:mediaId doValidation:YES forRecording:YES];
     __block NSString* jsString = nil;
     __block NSString* errorMsg = @"";
 


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