Bug 164590 - Add a preference to disable media autoplay
Summary: Add a preference to disable media autoplay
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: Other
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Eric Carlson
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2016-11-10 06:45 PST by Eric Carlson
Modified: 2016-11-14 06:50 PST (History)
4 users (show)

See Also:


Attachments
Proposed patch. (19.87 KB, patch)
2016-11-10 06:54 PST, Eric Carlson
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ews114 for mac-yosemite (1.99 MB, application/zip)
2016-11-10 08:19 PST, Build Bot
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Carlson 2016-11-10 06:45:42 PST
Add a preference to disable media autoplay
Comment 1 Eric Carlson 2016-11-10 06:46:28 PST
<rdar://problem/29152564>
Comment 2 Eric Carlson 2016-11-10 06:54:24 PST
Created attachment 294369 [details]
Proposed patch.
Comment 3 Build Bot 2016-11-10 08:19:30 PST
Comment on attachment 294369 [details]
Proposed patch.

Attachment 294369 [details] did not pass mac-debug-ews (mac):
Output: http://webkit-queues.webkit.org/results/2490262

New failing tests:
media/video-autoplay-blocked.html
Comment 4 Build Bot 2016-11-10 08:19:33 PST
Created attachment 294373 [details]
Archive of layout-test-results from ews114 for mac-yosemite

The attached test failures were seen while running run-webkit-tests on the mac-debug-ews.
Bot: ews114  Port: mac-yosemite  Platform: Mac OS X 10.10.5
Comment 5 Eric Carlson 2016-11-10 09:19:59 PST
(In reply to comment #3)
> Comment on attachment 294369 [details]
> Proposed patch.
> 
> Attachment 294369 [details] did not pass mac-debug-ews (mac):
> Output: http://webkit-queues.webkit.org/results/2490262
> 
> New failing tests:
> media/video-autoplay-blocked.html

This is failing because Internals didn't rebuild:

TypeError: internals.settings.setBlockMediaAutoplay is not a function. (In 'internals.settings.setBlockMediaAutoplay(true)', 'internals.settings.setBlockMediaAutoplay' is undefined)
Comment 6 Eric Carlson 2016-11-10 12:15:34 PST
This is unnecessary.
Comment 7 Darin Adler 2016-11-12 21:33:58 PST
Comment on attachment 294369 [details]
Proposed patch.

View in context: https://bugs.webkit.org/attachment.cgi?id=294369&action=review

> Source/WebKit2/UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:54
> +@property (nonatomic, setter=_setBlockMediaAutoplay:) BOOL _blockMediaAutoplay WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA));

Cocoa APIs try to stay away from property names that sound like action verb phrases. The method name, _blockMediaAutoplay, can sound like a method that actively blocks something, rather than a property name of a boolean determining what the policy is.

That thinking is where Cocoa property names like shouldBlockMediaAutoplay come from.

> Source/WebKit/mac/WebView/WebPreferencesPrivate.h:273
> +- (void)setBlockMediaAutoplay:(BOOL)flag;
> +- (BOOL)blockMediaAutoplay;

Ditto.