Fix macros for wireless playback
[WebKit-https.git] / Source / WebKit2 / UIProcess / API / Cocoa / WKWebViewConfiguration.mm
index 9be9a6e..b5772a3 100644 (file)
@@ -103,11 +103,13 @@ private:
         return nil;
     
 #if PLATFORM(IOS)
-    _mediaPlaybackRequiresUserAction = YES;
-    _mediaPlaybackAllowsAirPlay = YES;
+    _requiresUserActionForMediaPlayback = YES;
     _allowsAlternateFullscreen = YES;
 #endif
-    
+#if ENABLE(WIRELESS_TARGET_PLAYBACK)
+    _allowsAirPlayForMediaPlayback = YES;
+#endif
+
     return self;
 }
 
@@ -138,10 +140,12 @@ private:
 #if PLATFORM(IOS)
     configuration->_allowsInlineMediaPlayback = self->_allowsInlineMediaPlayback;
     configuration->_allowsAlternateFullscreen = self->_allowsAlternateFullscreen;
-    configuration->_mediaPlaybackRequiresUserAction = self->_mediaPlaybackRequiresUserAction;
-    configuration->_mediaPlaybackAllowsAirPlay = self->_mediaPlaybackAllowsAirPlay;
+    configuration->_requiresUserActionForMediaPlayback = self->_requiresUserActionForMediaPlayback;
     configuration->_selectionGranularity = self->_selectionGranularity;
 #endif
+#if ENABLE(WIRELESS_TARGET_PLAYBACK)
+    configuration->_allowsAirPlayForMediaPlayback = self->_allowsAirPlayForMediaPlayback;
+#endif
 
     return configuration;
 }
@@ -323,4 +327,30 @@ static NSString *defaultApplicationNameForUserAgent()
 
 @end
 
+@implementation WKWebViewConfiguration (WKDeprecated)
+
+#if PLATFORM(IOS)
+- (BOOL)mediaPlaybackAllowsAirPlay
+{
+    return self.allowsAirPlayForMediaPlayback;
+}
+
+- (void)setMediaPlaybackAllowsAirPlay:(BOOL)allowed
+{
+    self.allowsAirPlayForMediaPlayback = allowed;
+}
+
+- (BOOL)mediaPlaybackRequiresUserAction
+{
+    return self.requiresUserActionForMediaPlayback;
+}
+
+- (void)setMediaPlaybackRequiresUserAction:(BOOL)required
+{
+    self.requiresUserActionForMediaPlayback = required;
+}
+#endif // PLATFORM(IOS)
+
+@end
+
 #endif // WK_API_ENABLED