Title: [201110] trunk/Source/WebKit2
Revision
201110
Author
[email protected]
Date
2016-05-18 15:52:09 -0700 (Wed, 18 May 2016)

Log Message

Disable default user gesture requirement for audio playback on Mac
https://bugs.webkit.org/show_bug.cgi?id=157820

Reviewed by Sam Weinig.

Disable the WebPreferences and matching WKWebViewConfiguration.mediaTypesRequiringUserActionForPlayback
settings on Mac (and other non-iOS ports).

* Shared/WebPreferencesDefinitions.h:
* UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
(-[WKWebViewConfiguration init]):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (201109 => 201110)


--- trunk/Source/WebKit2/ChangeLog	2016-05-18 22:49:32 UTC (rev 201109)
+++ trunk/Source/WebKit2/ChangeLog	2016-05-18 22:52:09 UTC (rev 201110)
@@ -1,3 +1,17 @@
+2016-05-18  Jer Noble  <[email protected]>
+
+        Disable default user gesture requirement for audio playback on Mac
+        https://bugs.webkit.org/show_bug.cgi?id=157820
+
+        Reviewed by Sam Weinig.
+
+        Disable the WebPreferences and matching WKWebViewConfiguration.mediaTypesRequiringUserActionForPlayback
+        settings on Mac (and other non-iOS ports).
+
+        * Shared/WebPreferencesDefinitions.h:
+        * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
+        (-[WKWebViewConfiguration init]):
+
 2016-05-18  Alex Christensen  <[email protected]>
 
         Build fix when not using CredentialStorage with NetworkSession.

Modified: trunk/Source/WebKit2/Shared/WebPreferencesDefinitions.h (201109 => 201110)


--- trunk/Source/WebKit2/Shared/WebPreferencesDefinitions.h	2016-05-18 22:49:32 UTC (rev 201109)
+++ trunk/Source/WebKit2/Shared/WebPreferencesDefinitions.h	2016-05-18 22:52:09 UTC (rev 201110)
@@ -56,12 +56,10 @@
 #define DEFAULT_HIDDEN_PAGE_DOM_TIMER_THROTTLING_ENABLED true
 #define DEFAULT_HIDDEN_PAGE_CSS_ANIMATION_SUSPENSION_ENABLED true
 #define DEFAULT_PDFPLUGIN_ENABLED true
-#define DEFAULT_REQUIRES_USER_GESTURE_FOR_AUDIO_PLAYBACK true
 #else
 #define DEFAULT_HIDDEN_PAGE_DOM_TIMER_THROTTLING_ENABLED false
 #define DEFAULT_HIDDEN_PAGE_CSS_ANIMATION_SUSPENSION_ENABLED false
 #define DEFAULT_PDFPLUGIN_ENABLED false
-#define DEFAULT_REQUIRES_USER_GESTURE_FOR_AUDIO_PLAYBACK false
 #endif
 
 #if PLATFORM(IOS)
@@ -78,6 +76,7 @@
 #define DEFAULT_MEDIA_DATA_LOADS_AUTOMATICALLY false
 #define DEFAULT_MEDIA_CONTROLS_SCALE_WITH_PAGE_ZOOM false
 #define DEFAULT_TEMPORARY_TILE_COHORT_RETENTION_ENABLED false
+#define DEFAULT_REQUIRES_USER_GESTURE_FOR_AUDIO_PLAYBACK true
 #else
 #define DEFAULT_BACKSPACE_KEY_NAVIGATION_ENABLED true
 #define DEFAULT_FRAME_FLATTENING_ENABLED false
@@ -92,6 +91,7 @@
 #define DEFAULT_MEDIA_DATA_LOADS_AUTOMATICALLY true
 #define DEFAULT_MEDIA_CONTROLS_SCALE_WITH_PAGE_ZOOM true
 #define DEFAULT_TEMPORARY_TILE_COHORT_RETENTION_ENABLED true
+#define DEFAULT_REQUIRES_USER_GESTURE_FOR_AUDIO_PLAYBACK false
 #endif
 
 #if PLATFORM(IOS_SIMULATOR)

Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewConfiguration.mm (201109 => 201110)


--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewConfiguration.mm	2016-05-18 22:49:32 UTC (rev 201109)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewConfiguration.mm	2016-05-18 22:52:09 UTC (rev 201110)
@@ -136,14 +136,15 @@
     _allowsInlineMediaPlayback = WebCore::deviceClass() == MGDeviceClassiPad;
     _inlineMediaPlaybackRequiresPlaysInlineAttribute = !_allowsInlineMediaPlayback;
     _mediaDataLoadsAutomatically = NO;
+    if (linkedOnOrAfter(WebKit::LibraryVersion::FirstWithMediaTypesRequiringUserActionForPlayback))
+        _mediaTypesRequiringUserActionForPlayback = WKAudiovisualMediaTypeAudio;
+    else
+        _mediaTypesRequiringUserActionForPlayback = WKAudiovisualMediaTypeAll;
 #else
+    _mediaTypesRequiringUserActionForPlayback = WKAudiovisualMediaTypeNone;
     _mediaDataLoadsAutomatically = YES;
     _userInterfaceDirectionPolicy = WKUserInterfaceDirectionPolicyContent;
 #endif
-    if (linkedOnOrAfter(WebKit::LibraryVersion::FirstWithMediaTypesRequiringUserActionForPlayback))
-        _mediaTypesRequiringUserActionForPlayback = WKAudiovisualMediaTypeAudio;
-    else
-        _mediaTypesRequiringUserActionForPlayback = WKAudiovisualMediaTypeAll;
     _mainContentUserGestureOverrideEnabled = NO;
     _invisibleAutoplayNotPermitted = NO;
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to