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

 ##########
 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:
   No, this is correct..
   
   It suppose to read the old preference option first and store its to be used 
if uses still sets the old option, not the new one. But it will though still 
set the new flag. If the new preference value is set when the old one is or is 
not set, the value stored is trash for the new preference options.
   
   If this is too complicated, then I want to completely trash the old 
preference option and done with it. I don't care if the old preference option 
is completely removed with small step for migration. If the app stops working 
as intended, they should still be able to figure it out with the build warnings.

----------------------------------------------------------------
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