We would like for users to be able to control autoplay on a global and local (ie. website) basis. This should be done via a content settings that will be shared with Blink, likely via WebContentSettingsClient::allowAutoplay().
I have a CL adding the content settings and exposing it to Blink: https://codereview.chromium.org/1906533002
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/709d8a936ef6aefde7411adb814744dc864c8d49 commit 709d8a936ef6aefde7411adb814744dc864c8d49 Author: mlamouri <mlamouri@chromium.org> Date: Wed Apr 27 14:24:57 2016 Add 'autoplay' content settings and expose it to Blink. The new content settings is CONTENT_SETTINGS_TYPE_AUTOPLAY and it is exposed to Blink via WebContentSettingsClient::allowAutoplay(). The client is kept is sync by the browser process to avoid sync IPC or adding complex asynchronous logic to HTMLMediaElement. This CL doesn't add UI nor use the settings in order to keep things compartmented. HTMLMediaElement will check the settings value in some situations. More context in here: https://docs.google.com/presentation/d/17ZXOdGosCso_SoMvQ9ckCsElvn_0YW2Q13y5ZqQ9dyU/edit BUG= 604751 Review URL: https://codereview.chromium.org/1906533002 Cr-Commit-Position: refs/heads/master@{#390065} [modify] https://crrev.com/709d8a936ef6aefde7411adb814744dc864c8d49/chrome/browser/chrome_content_browser_client.cc [modify] https://crrev.com/709d8a936ef6aefde7411adb814744dc864c8d49/chrome/browser/content_settings/host_content_settings_map_unittest.cc [modify] https://crrev.com/709d8a936ef6aefde7411adb814744dc864c8d49/chrome/browser/extensions/api/content_settings/content_settings_apitest.cc [modify] https://crrev.com/709d8a936ef6aefde7411adb814744dc864c8d49/chrome/common/render_messages.h [modify] https://crrev.com/709d8a936ef6aefde7411adb814744dc864c8d49/chrome/renderer/content_settings_observer.cc [modify] https://crrev.com/709d8a936ef6aefde7411adb814744dc864c8d49/chrome/renderer/content_settings_observer.h [modify] https://crrev.com/709d8a936ef6aefde7411adb814744dc864c8d49/chrome/renderer/content_settings_observer_browsertest.cc [modify] https://crrev.com/709d8a936ef6aefde7411adb814744dc864c8d49/components/content_settings/core/browser/content_settings_registry.cc [modify] https://crrev.com/709d8a936ef6aefde7411adb814744dc864c8d49/components/content_settings/core/browser/content_settings_utils.cc [modify] https://crrev.com/709d8a936ef6aefde7411adb814744dc864c8d49/components/content_settings/core/common/content_settings.cc [modify] https://crrev.com/709d8a936ef6aefde7411adb814744dc864c8d49/components/content_settings/core/common/content_settings.h [modify] https://crrev.com/709d8a936ef6aefde7411adb814744dc864c8d49/components/content_settings/core/common/content_settings_types.h [modify] https://crrev.com/709d8a936ef6aefde7411adb814744dc864c8d49/third_party/WebKit/Source/core/loader/FrameLoaderClient.h [modify] https://crrev.com/709d8a936ef6aefde7411adb814744dc864c8d49/third_party/WebKit/Source/web/FrameLoaderClientImpl.cpp [modify] https://crrev.com/709d8a936ef6aefde7411adb814744dc864c8d49/third_party/WebKit/Source/web/FrameLoaderClientImpl.h [modify] https://crrev.com/709d8a936ef6aefde7411adb814744dc864c8d49/third_party/WebKit/public/web/WebContentSettingsClient.h
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/426f286226681c8792c2261c062a73842149ba13 commit 426f286226681c8792c2261c062a73842149ba13 Author: mlamouri <mlamouri@chromium.org> Date: Fri Apr 29 18:35:01 2016 TestRunner: add method to instrument autoplay settings and set default value. It adds window.testRunner.setAutoplayEnabled(bool) and sets the default value to true (this is what LayoutTests expects today). The new method is used in the following CL: https://codereview.chromium.org/1920863005 BUG= 604751 Review-Url: https://codereview.chromium.org/1926773002 Cr-Commit-Position: refs/heads/master@{#390705} [modify] https://crrev.com/426f286226681c8792c2261c062a73842149ba13/components/test_runner/layout_test_runtime_flags.cc [modify] https://crrev.com/426f286226681c8792c2261c062a73842149ba13/components/test_runner/layout_test_runtime_flags.h [modify] https://crrev.com/426f286226681c8792c2261c062a73842149ba13/components/test_runner/mock_content_settings_client.cc [modify] https://crrev.com/426f286226681c8792c2261c062a73842149ba13/components/test_runner/mock_content_settings_client.h [modify] https://crrev.com/426f286226681c8792c2261c062a73842149ba13/components/test_runner/test_runner.cc [modify] https://crrev.com/426f286226681c8792c2261c062a73842149ba13/components/test_runner/test_runner.h [modify] https://crrev.com/426f286226681c8792c2261c062a73842149ba13/third_party/WebKit/LayoutTests/http/tests/permissionclient/image-permissions-expected.txt [modify] https://crrev.com/426f286226681c8792c2261c062a73842149ba13/third_party/WebKit/LayoutTests/http/tests/permissionclient/video-permissions-expected.txt [modify] https://crrev.com/426f286226681c8792c2261c062a73842149ba13/third_party/WebKit/LayoutTests/permissionclient/audio-permissions-expected.txt [modify] https://crrev.com/426f286226681c8792c2261c062a73842149ba13/third_party/WebKit/LayoutTests/permissionclient/image-permissions-expected.txt [modify] https://crrev.com/426f286226681c8792c2261c062a73842149ba13/third_party/WebKit/LayoutTests/permissionclient/script-permissions-expected.txt [modify] https://crrev.com/426f286226681c8792c2261c062a73842149ba13/third_party/WebKit/LayoutTests/permissionclient/video-permissions-expected.txt
Comment 1 by mlamouri@chromium.org
, Apr 19 2016