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 2014/07/21 23:48:57 UTC

[1/2] ios commit: CB-7047 - typo fix

Repository: cordova-ios
Updated Branches:
  refs/heads/wkwebview 641992c48 -> 3d39ef4e3


CB-7047 - typo fix


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

Branch: refs/heads/wkwebview
Commit: 7ce625ba9279716e4a2f3958a49bf31e13e87fcd
Parents: 641992c
Author: Shazron Abdullah <sh...@apache.org>
Authored: Mon Jul 21 14:43:36 2014 -0700
Committer: Shazron Abdullah <sh...@apache.org>
Committed: Mon Jul 21 14:43:36 2014 -0700

----------------------------------------------------------------------
 CordovaLib/Classes/CDVWebViewPreferences.m | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/7ce625ba/CordovaLib/Classes/CDVWebViewPreferences.m
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/CDVWebViewPreferences.m b/CordovaLib/Classes/CDVWebViewPreferences.m
index 55f447b..f1cb48f 100644
--- a/CordovaLib/Classes/CDVWebViewPreferences.m
+++ b/CordovaLib/Classes/CDVWebViewPreferences.m
@@ -257,7 +257,7 @@
         theWebView.configuration.mediaPlaybackRequiresUserAction = mediaPlaybackRequiresUserAction;
 
         BOOL suppressesIncrementalRendering = NO; // default
-        prefObj = [self cordovaSettings:settings forKey:@"MediaPlaybackRequiresUserAction"];
+        prefObj = [self cordovaSettings:settings forKey:@"SuppressesIncrementalRendering"];
         if (prefObj != nil) {
             suppressesIncrementalRendering = [(NSNumber*)prefObj boolValue];
         }


[2/2] ios commit: CB-7184 - Implement support for mediaPlaybackAllowsAirPlay in UIWebView and WKWebView

Posted by sh...@apache.org.
CB-7184 - Implement support for mediaPlaybackAllowsAirPlay in UIWebView and WKWebView

plus config cleanup.


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

Branch: refs/heads/wkwebview
Commit: 3d39ef4e34e2ff994ee725fe5e2b956334eee854
Parents: 7ce625b
Author: Shazron Abdullah <sh...@apache.org>
Authored: Mon Jul 21 14:48:51 2014 -0700
Committer: Shazron Abdullah <sh...@apache.org>
Committed: Mon Jul 21 14:48:51 2014 -0700

----------------------------------------------------------------------
 CordovaLib/Classes/CDVWebViewPreferences.m | 42 +++++++++++++++++--------
 1 file changed, 29 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/3d39ef4e/CordovaLib/Classes/CDVWebViewPreferences.m
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/CDVWebViewPreferences.m b/CordovaLib/Classes/CDVWebViewPreferences.m
index f1cb48f..eb55c9d 100644
--- a/CordovaLib/Classes/CDVWebViewPreferences.m
+++ b/CordovaLib/Classes/CDVWebViewPreferences.m
@@ -72,25 +72,34 @@
 
 - (void)updateUIWebView:(UIWebView*)theWebView settings:(NSDictionary*)settings
 {
-    NSString* enableViewportScale = [self cordovaSettings:settings forKey:@"EnableViewportScale"];
-    NSNumber* allowInlineMediaPlayback = [self cordovaSettings:settings forKey:@"AllowInlineMediaPlayback"];
-    BOOL mediaPlaybackRequiresUserAction = YES;  // default value
+    BOOL scalesPageToFit = NO; // default
+    id prefObj = [self cordovaSettings:settings forKey:@"EnableViewportScale"];
 
-    if ([self cordovaSettings:settings forKey:@"MediaPlaybackRequiresUserAction"]) {
-        mediaPlaybackRequiresUserAction = [(NSNumber*)[self cordovaSettings:settings forKey:@"MediaPlaybackRequiresUserAction"] boolValue];
+    if (prefObj != nil) {
+        scalesPageToFit = [(NSNumber*)prefObj boolValue];
     }
+    theWebView.scalesPageToFit = scalesPageToFit;
 
-    theWebView.scalesPageToFit = [enableViewportScale boolValue];
+    BOOL allowInlineMediaPlayback = NO; // default
+    prefObj = [self cordovaSettings:settings forKey:@"AllowInlineMediaPlayback"];
+    if (prefObj != nil) {
+        allowInlineMediaPlayback = [(NSNumber*)prefObj boolValue];
+    }
+    theWebView.allowsInlineMediaPlayback = allowInlineMediaPlayback;
 
-    /*
-     * This is for iOS 4.x, where you can allow inline <video> and <audio>, and also autoplay them
-     */
-    if ([allowInlineMediaPlayback boolValue] && [theWebView respondsToSelector:@selector(allowsInlineMediaPlayback)]) {
-        theWebView.allowsInlineMediaPlayback = YES;
+    BOOL mediaPlaybackRequiresUserAction = YES;  // default
+    prefObj = [self cordovaSettings:settings forKey:@"MediaPlaybackRequiresUserAction"];
+    if (prefObj != nil) {
+        mediaPlaybackRequiresUserAction = [(NSNumber*)prefObj boolValue];
     }
-    if ((mediaPlaybackRequiresUserAction == NO) && [theWebView respondsToSelector:@selector(mediaPlaybackRequiresUserAction)]) {
-        theWebView.mediaPlaybackRequiresUserAction = NO;
+    theWebView.mediaPlaybackRequiresUserAction = mediaPlaybackRequiresUserAction;
+
+    BOOL mediaPlaybackAllowsAirPlay = YES;  // default
+    prefObj = [self cordovaSettings:settings forKey:@"MediaPlaybackAllowsAirPlay"];
+    if (prefObj != nil) {
+        mediaPlaybackAllowsAirPlay = [(NSNumber*)prefObj boolValue];
     }
+    theWebView.mediaPlaybackAllowsAirPlay = mediaPlaybackAllowsAirPlay;
 
     // By default, overscroll bouncing is allowed.
     // UIWebViewBounce has been renamed to DisallowOverscroll, but both are checked.
@@ -263,6 +272,13 @@
         }
         theWebView.configuration.suppressesIncrementalRendering = suppressesIncrementalRendering;
 
+        BOOL mediaPlaybackAllowsAirPlay = YES;  // default
+        prefObj = [self cordovaSettings:settings forKey:@"MediaPlaybackAllowsAirPlay"];
+        if (prefObj != nil) {
+            mediaPlaybackAllowsAirPlay = [(NSNumber*)prefObj boolValue];
+        }
+        theWebView.configuration.mediaPlaybackAllowsAirPlay = mediaPlaybackAllowsAirPlay;
+
         /*
         BOOL javaScriptEnabled = YES;  // default value
         if ([self cordovaSettings:settings forKey:@"JavaScriptEnabled"]) {