LeOSium_webview/LeOS/patches/Add-flag-to-control-video-p...

77 lines
3.4 KiB
Diff
Raw Normal View History

2023-11-18 11:46:19 +01:00
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Thu, 25 Oct 2018 23:13:34 +0200
Subject: Add flag to control video playback resume feature
Disable it by default on Android as it is everywhere else
License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
---
chrome/browser/about_flags.cc | 4 ++++
chrome/browser/flag_descriptions.cc | 5 +++++
chrome/browser/flag_descriptions.h | 3 +++
media/base/media_switches.cc | 8 ++------
4 files changed, 14 insertions(+), 6 deletions(-)
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
@@ -4192,6 +4192,10 @@ const FeatureEntry kFeatureEntries[] = {
chrome::android::kContextualSearchSuppressShortView,
kContextualSearchSuppressShortViewVariations,
"ContextualSearchSuppressShortView")},
+ {"resume-background-video",
+ flag_descriptions::kResumeBackgroundVideoName,
+ flag_descriptions::kResumeBackgroundVideoDescription, kOsAll,
+ FEATURE_VALUE_TYPE(media::kResumeBackgroundVideo)},
{"related-searches", flag_descriptions::kRelatedSearchesName,
flag_descriptions::kRelatedSearchesDescription, kOsAndroid,
FEATURE_WITH_PARAMS_VALUE_TYPE(chrome::android::kRelatedSearches,
diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc
--- a/chrome/browser/flag_descriptions.cc
+++ b/chrome/browser/flag_descriptions.cc
@@ -1477,6 +1477,11 @@ const char kEnableManagedConfigurationWebApiDescription[] =
"Allows website to access a managed configuration provided by the device "
"administrator for the origin.";
+const char kResumeBackgroundVideoName[] = "Resume background video.";
+const char kResumeBackgroundVideoDescription[] =
+ "Resume background video playback when tab re-gains focus; additionally, "
+ "it will pause video playback every single time you switch tabs.";
+
const char kEnablePixelCanvasRecordingName[] = "Enable pixel canvas recording";
const char kEnablePixelCanvasRecordingDescription[] =
"Pixel canvas recording allows the compositor to raster contents aligned "
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h
--- a/chrome/browser/flag_descriptions.h
+++ b/chrome/browser/flag_descriptions.h
@@ -814,6 +814,9 @@ extern const char kEnablePenetratingImageSelectionDescription[];
extern const char kEnablePerfettoSystemTracingName[];
extern const char kEnablePerfettoSystemTracingDescription[];
+extern const char kResumeBackgroundVideoName[];
+extern const char kResumeBackgroundVideoDescription[];
+
extern const char kEnablePeripheralCustomizationName[];
extern const char kEnablePeripheralCustomizationDescription[];
diff --git a/media/base/media_switches.cc b/media/base/media_switches.cc
--- a/media/base/media_switches.cc
+++ b/media/base/media_switches.cc
@@ -360,12 +360,8 @@ BASE_FEATURE(kPreloadMetadataLazyLoad,
// Let videos be resumed via remote controls (for example, the notification)
// when in background.
BASE_FEATURE(kResumeBackgroundVideo,
- "resume-background-video",
-#if BUILDFLAG(IS_ANDROID)
- base::FEATURE_ENABLED_BY_DEFAULT
-#else
- base::FEATURE_DISABLED_BY_DEFAULT
-#endif
+ "resume-background-video", // disabled by default
+ base::FEATURE_DISABLED_BY_DEFAULT // in Bromite
);
#if BUILDFLAG(IS_MAC)
--
2.25.1