diff --git a/browser/brave_browser_main_parts.cc b/browser/brave_browser_main_parts.cc index 069500aac7d2..8ea81590ca7d 100644 --- a/browser/brave_browser_main_parts.cc +++ b/browser/brave_browser_main_parts.cc @@ -61,7 +61,7 @@ #include "chrome/browser/ui/browser_finder.h" #include "components/infobars/content/content_infobar_manager.h" #else -#include "brave/browser/android/background_video/features.h" +#include "brave/components/youtube_script_injector/common/features.h" #endif #if BUILDFLAG(ETHEREUM_REMOTE_CLIENT_ENABLED) && BUILDFLAG(ENABLE_EXTENSIONS) @@ -199,15 +199,14 @@ void ChromeBrowserMainParts::PostProfileInit(Profile* profile, ChromeBrowserMainParts_ChromiumImpl::PostProfileInit(profile, is_initial_profile); -#if BUILDFLAG(IS_ANDROID) - if (base::FeatureList::IsEnabled( - preferences::features::kBraveBackgroundVideoPlayback) || - profile->GetPrefs()->GetBoolean(kBackgroundVideoPlaybackEnabled)) { - content::RenderFrameHost::AllowInjectingJavaScript(); - auto* command_line = base::CommandLine::ForCurrentProcess(); - command_line->AppendSwitch(switches::kDisableBackgroundMediaSuspend); - } -#endif + #if BUILDFLAG(IS_ANDROID) + if (base::FeatureList::IsEnabled( + youtube_script_injector::features::kBraveYouTubeScriptInjector) || + profile->GetPrefs()->GetBoolean(kBackgroundVideoPlaybackEnabled)) { + auto* command_line = base::CommandLine::ForCurrentProcess(); + command_line->AppendSwitch(switches::kDisableBackgroundMediaSuspend); + } + #endif #if BUILDFLAG(ETHEREUM_REMOTE_CLIENT_ENABLED) && BUILDFLAG(ENABLE_EXTENSIONS) extensions::ExtensionService* service = diff --git a/browser/sources.gni b/browser/sources.gni index 43d005c49f76..6b73cd88c25f 100644 --- a/browser/sources.gni +++ b/browser/sources.gni @@ -390,8 +390,6 @@ if (is_android) { brave_chrome_browser_deps += [ "//brave/browser/android:android_browser_process", - "//brave/browser/android/background_video", - "//brave/browser/android/background_video:features", "//brave/browser/android/preferences", "//brave/browser/android/safe_browsing:buildflags", "//brave/browser/brave_ads/android",