cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mmo...@apache.org
Subject [22/50] ios commit: [CB-2342] Media API allows non-whitelisted audio to be played
Date Mon, 25 Feb 2013 13:41:02 GMT
[CB-2342] Media API allows non-whitelisted audio to be played


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

Branch: refs/heads/multipart_plugin_result
Commit: 57c3c082ed9be41c0588d0d63a1d2bfcd2ed878c
Parents: 96c587b
Author: Shazron Abdullah <shazron@apache.org>
Authored: Fri Feb 15 12:29:37 2013 -0800
Committer: Shazron Abdullah <shazron@apache.org>
Committed: Fri Feb 15 12:29:37 2013 -0800

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


http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/57c3c082/CordovaLib/Classes/CDVSound.m
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/CDVSound.m b/CordovaLib/Classes/CDVSound.m
index 96812ca..8ae2067 100644
--- a/CordovaLib/Classes/CDVSound.m
+++ b/CordovaLib/Classes/CDVSound.m
@@ -275,7 +275,12 @@
     if ([resourceURL isFileURL]) {
         audioFile.player = [[CDVAudioPlayer alloc] initWithContentsOfURL:resourceURL error:&playerError];
     } else {
-        NSURLRequest* request = [NSURLRequest requestWithURL:resourceURL];
+        NSMutableURLRequest* request = [NSMutableURLRequest requestWithURL:resourceURL];
+        NSString* userAgent = [self.commandDelegate userAgent];
+        if (userAgent) {
+            [request setValue:userAgent forHTTPHeaderField:@"User-Agent"];
+        }
+
         NSURLResponse* __autoreleasing response = nil;
         NSData* data = [NSURLConnection sendSynchronousRequest:request returningResponse:&response
error:&playerError];
         if (playerError) {


Mime
View raw message