Repository: cordova-ios
Updated Branches:
  refs/heads/wkwebview 6d6ab0a16 -> 641992c48


CB-7047 - Support config.xml preferences for WKWebView


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

Branch: refs/heads/wkwebview
Commit: 641992c4860ea107cefb0aae7c3dad2d04b156ca
Parents: 6d6ab0a
Author: Shazron Abdullah <[email protected]>
Authored: Mon Jul 21 14:34:05 2014 -0700
Committer: Shazron Abdullah <[email protected]>
Committed: Mon Jul 21 14:34:05 2014 -0700

----------------------------------------------------------------------
 CordovaLib/Classes/CDVWebViewPreferences.m | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/641992c4/CordovaLib/Classes/CDVWebViewPreferences.m
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/CDVWebViewPreferences.m 
b/CordovaLib/Classes/CDVWebViewPreferences.m
index a42b3aa..55f447b 100644
--- a/CordovaLib/Classes/CDVWebViewPreferences.m
+++ b/CordovaLib/Classes/CDVWebViewPreferences.m
@@ -242,6 +242,27 @@
         }
         theWebView.configuration.preferences.minimumFontSize = minimumFontSize;
 
+        BOOL allowInlineMediaPlayback = NO; // default
+        prefObj = [self cordovaSettings:settings 
forKey:@"AllowInlineMediaPlayback"];
+        if (prefObj != nil) {
+            allowInlineMediaPlayback = [(NSNumber*)prefObj boolValue];
+        }
+        theWebView.configuration.allowsInlineMediaPlayback = 
allowInlineMediaPlayback;
+
+        BOOL mediaPlaybackRequiresUserAction = YES;  // default
+        prefObj = [self cordovaSettings:settings 
forKey:@"MediaPlaybackRequiresUserAction"];
+        if (prefObj != nil) {
+            mediaPlaybackRequiresUserAction = [(NSNumber*)prefObj boolValue];
+        }
+        theWebView.configuration.mediaPlaybackRequiresUserAction = 
mediaPlaybackRequiresUserAction;
+
+        BOOL suppressesIncrementalRendering = NO; // default
+        prefObj = [self cordovaSettings:settings 
forKey:@"MediaPlaybackRequiresUserAction"];
+        if (prefObj != nil) {
+            suppressesIncrementalRendering = [(NSNumber*)prefObj boolValue];
+        }
+        theWebView.configuration.suppressesIncrementalRendering = 
suppressesIncrementalRendering;
+
         /*
         BOOL javaScriptEnabled = YES;  // default value
         if ([self cordovaSettings:settings forKey:@"JavaScriptEnabled"]) {

Reply via email to