jcesarmobile commented on a change in pull request #785: refactor: deprecate 
mediaPlaybackAllowsAirPlay
URL: https://github.com/apache/cordova-ios/pull/785#discussion_r383585272
 
 

 ##########
 File path: 
CordovaLib/Classes/Private/Plugins/CDVWebViewEngine/CDVWebViewEngine.m
 ##########
 @@ -84,7 +84,17 @@ - (WKWebViewConfiguration*) 
createConfigurationFromSettings:(NSDictionary*)setti
     configuration.mediaTypesRequiringUserActionForPlayback = 
mediaTypesRequiringUserActionForPlayback;
 
     configuration.suppressesIncrementalRendering = [settings 
cordovaBoolSettingForKey:@"SuppressesIncrementalRendering" defaultValue:NO];
-    configuration.mediaPlaybackAllowsAirPlay = [settings 
cordovaBoolSettingForKey:@"MediaPlaybackAllowsAirPlay" defaultValue:YES];
+
+    /*
+     * If the old preference key "MediaPlaybackAllowsAirPlay" exists, use it 
or default to "YES".
+     * Check if the new preference key "AllowsAirPlayForMediaPlayback" exists 
and overwrite the "MediaPlaybackAllowsAirPlay" value.
+     */
+    BOOL allowsAirPlayForMediaPlayback = [settings 
cordovaBoolSettingForKey:@"MediaPlaybackAllowsAirPlay" defaultValue:YES];
+    if([settings cordovaSettingForKey:@"AllowsAirPlayForMediaPlayback"] != 
nil) {
+        allowsAirPlayForMediaPlayback = [settings 
cordovaBoolSettingForKey:@"MediaPlaybackAllowsAirPlay" defaultValue:YES];
 
 Review comment:
   Should check AllowsAirPlayForMediaPlayback , right?
   
   ```suggestion
           allowsAirPlayForMediaPlayback = [settings 
cordovaBoolSettingForKey:@"AllowsAirPlayForMediaPlayback" defaultValue:YES];
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to