Return-Path: X-Original-To: apmail-cordova-commits-archive@www.apache.org Delivered-To: apmail-cordova-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B0DFB17450 for ; Sat, 7 Mar 2015 00:18:15 +0000 (UTC) Received: (qmail 55558 invoked by uid 500); 7 Mar 2015 00:18:15 -0000 Delivered-To: apmail-cordova-commits-archive@cordova.apache.org Received: (qmail 55505 invoked by uid 500); 7 Mar 2015 00:18:15 -0000 Mailing-List: contact commits-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list commits@cordova.apache.org Received: (qmail 54756 invoked by uid 99); 7 Mar 2015 00:18:15 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 07 Mar 2015 00:18:15 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 9C076E10CF; Sat, 7 Mar 2015 00:18:14 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: shazron@apache.org To: commits@cordova.apache.org Date: Sat, 07 Mar 2015 00:18:19 -0000 Message-Id: <7b7204cf00714dc080098de2f48d9d59@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [06/43] ios commit: CB-7184 - Implement support for mediaPlaybackAllowsAirPlay in UIWebView and WKWebView 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/4.0.x Commit: 3d39ef4e34e2ff994ee725fe5e2b956334eee854 Parents: 7ce625b Author: Shazron Abdullah Authored: Mon Jul 21 14:48:51 2014 -0700 Committer: Shazron Abdullah 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