Allow autoplay in WebAPK |
|||||
Issue descriptionWe need to pass flag "--disable-gesture-requirement-for-media-playback" when starting WebAPK to allow media to autoplay without user gesture. Currently, the flag is off on Android. hanxi@, can you point me where should init the flags? Should I set the flag directly through CommandLine.getInstance().appendSwitch() from WebApkActivity.java? Or do I need plumb anything to ChildProcessLauncher.java? The goal is to pass the flag only for WebApk while not affecting non-WebApk tabs.
,
Dec 22 2016
If the browser process stays the same, it sounds reasonable to set the flags when creating the renderer processes indeed. hanxi@, is there any other feature/behaviour using WebAPK as a signal?
,
Dec 22 2016
As per https://crbug.com/664530 , WebAPK is still setting the global instance of ChildProcessCreationParams, so I assume it would affect normal browser tabs unless it gets fixed?
,
Dec 22 2016
mlamouri@:I don't think other feature uses WebApk as a signal, but ChildProcessLauncher connects to the WebApk's child process service definitely is. zqzhang@: I am not too concern about that bug, since it's only apply to the case that a renderer process created in the background while a WebApk is the active app, the ChildProcessLauncher may connect to a WebApk's renderer process, but I don't think it would effect regular tabs. We use the creation parameter is based on the assumption that there's only one activity is active on Android. Yes, you could pass command line flags to a renderer process, but it is not ideal. Because you need to do lots of plumbing from Java to content in native, but content shouldn't know which Activity it is in.
,
Jan 26 2017
,
Feb 8 2017
,
Feb 15 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/183dc82ce88ae08056adfcc97e48937c0fe1be59 commit 183dc82ce88ae08056adfcc97e48937c0fe1be59 Author: zqzhang <zqzhang@chromium.org> Date: Wed Feb 15 17:04:11 2017 Allow autoplay unmuted for WebAPK in the manifest scope Previously, we block all autoplay with sound on Android. To close the gap between Web apps and native apps, this CL uses the manifest scope as a whitelist, so that frames matching the scope are allowed to autoplay with sound. Design doc: https://docs.google.com/a/google.com/document/d/12kghzV5FBk4JNgtOJk2pTGqNhMzNmXt2GEpstJ-4tHc/edit?usp=sharing BUG= 676312 Review-Url: https://codereview.chromium.org/2640143002 Cr-Commit-Position: refs/heads/master@{#450727} [modify] https://crrev.com/183dc82ce88ae08056adfcc97e48937c0fe1be59/chrome/android/java/src/org/chromium/chrome/browser/tab/Tab.java [modify] https://crrev.com/183dc82ce88ae08056adfcc97e48937c0fe1be59/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebApkActivity.java [modify] https://crrev.com/183dc82ce88ae08056adfcc97e48937c0fe1be59/chrome/browser/android/tab_android.cc [modify] https://crrev.com/183dc82ce88ae08056adfcc97e48937c0fe1be59/chrome/browser/android/tab_android.h [modify] https://crrev.com/183dc82ce88ae08056adfcc97e48937c0fe1be59/chrome/browser/chrome_content_browser_client.cc [modify] https://crrev.com/183dc82ce88ae08056adfcc97e48937c0fe1be59/content/public/common/common_param_traits_macros.h [modify] https://crrev.com/183dc82ce88ae08056adfcc97e48937c0fe1be59/content/public/common/web_preferences.h [modify] https://crrev.com/183dc82ce88ae08056adfcc97e48937c0fe1be59/content/renderer/render_view_impl.cc [add] https://crrev.com/183dc82ce88ae08056adfcc97e48937c0fe1be59/third_party/WebKit/LayoutTests/media/autoplay-non-whitelisted-scope.html [add] https://crrev.com/183dc82ce88ae08056adfcc97e48937c0fe1be59/third_party/WebKit/LayoutTests/media/autoplay-whitelisted-scope.html [modify] https://crrev.com/183dc82ce88ae08056adfcc97e48937c0fe1be59/third_party/WebKit/Source/core/frame/Settings.json5 [modify] https://crrev.com/183dc82ce88ae08056adfcc97e48937c0fe1be59/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp [modify] https://crrev.com/183dc82ce88ae08056adfcc97e48937c0fe1be59/third_party/WebKit/Source/web/WebSettingsImpl.cpp [modify] https://crrev.com/183dc82ce88ae08056adfcc97e48937c0fe1be59/third_party/WebKit/Source/web/WebSettingsImpl.h [modify] https://crrev.com/183dc82ce88ae08056adfcc97e48937c0fe1be59/third_party/WebKit/public/web/WebSettings.h
,
Feb 16 2017
,
Feb 16 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/89e4e76885c3ba68394bb8ef2f58098a0ebe530d commit 89e4e76885c3ba68394bb8ef2f58098a0ebe530d Author: zqzhang <zqzhang@chromium.org> Date: Thu Feb 16 16:15:38 2017 [Blink>Media] Add Chrome feature for disabling autoplay unmuted in WebAPK This CL adds a Chrome feature for disabling autoplay unmuted in WebAPK, in case if we need to disable the feature via Finch. BUG= 676312 Review-Url: https://codereview.chromium.org/2698253002 Cr-Commit-Position: refs/heads/master@{#450982} [modify] https://crrev.com/89e4e76885c3ba68394bb8ef2f58098a0ebe530d/chrome/browser/chrome_content_browser_client.cc [modify] https://crrev.com/89e4e76885c3ba68394bb8ef2f58098a0ebe530d/chrome/common/chrome_features.cc [modify] https://crrev.com/89e4e76885c3ba68394bb8ef2f58098a0ebe530d/chrome/common/chrome_features.h
,
Feb 24 2017
|
|||||
►
Sign in to add a comment |
|||||
Comment 1 by hanxi@chromium.org
, Dec 21 2016I am not sure whether you can set flag for a particular kind of tab, not others, since CommandlLine flag would be the same no matter where CommandLine.getInstance().hasSwitch("...") is called. Maybe what you need is a global variable indicating whether you are in the WebAPK's runtime or not. I think you can use ChildProcessCreationParams, which have the package name of the current running app, either WebAPKs or Chrome. The ChildProcessCreationParams can be accessed via ChromeApplication.getChildProcessCreationParams(). If the package name starts from WebApkConstants.WEBAPK_PACKAGE_PREFIX, we know it is in a WebAPK's runtime.