Enable Widevine on all Linux archs (#21040)
On Arm64 Linux, Widevine is not available via component updates. But distributions such as Raspberry Pi OS ship it. So users have ways of obtaining the library. This commit makes the browser attempt to load Widevine on non-x64 Linux architectures (and thus on Arm64). Users can then install it manually to see DRM-protected content.
This commit is contained in:
@@ -76,6 +76,13 @@ void BraveDrmTabHelper::BindBraveDRM(
|
||||
}
|
||||
|
||||
bool BraveDrmTabHelper::ShouldShowWidevineOptIn() const {
|
||||
#if BUILDFLAG(IS_LINUX) && !defined(ARCH_CPU_X86_64)
|
||||
// On non-x64 Linux, Widevine is not publicly available. This point is a
|
||||
// convenient single place for turning this class into a no-op:
|
||||
return false;
|
||||
// Users on non-x64 Linux may still install Widevine manually and enable it in
|
||||
// brave://settings.
|
||||
#else
|
||||
// If the user already opted in, don't offer it.
|
||||
PrefService* prefs =
|
||||
static_cast<Profile*>(web_contents()->GetBrowserContext())->GetPrefs();
|
||||
@@ -84,6 +91,7 @@ bool BraveDrmTabHelper::ShouldShowWidevineOptIn() const {
|
||||
}
|
||||
|
||||
return is_widevine_requested_;
|
||||
#endif // BUILDFLAG(IS_LINUX) && !defined(ARCH_CPU_X86_64)
|
||||
}
|
||||
|
||||
void BraveDrmTabHelper::DidStartNavigation(
|
||||
|
||||
@@ -80,6 +80,9 @@ void RegisterWidevineLocalstatePrefs(PrefRegistrySimple* registry) {
|
||||
}
|
||||
|
||||
bool IsWidevineEnabled() {
|
||||
// N.B.: As of this writing, kWidevineEnabled is also queried in other places.
|
||||
// If you want to change the logic for enabling Widevine, then you need to
|
||||
// change those other places as well.
|
||||
return g_browser_process->local_state()->GetBoolean(kWidevineEnabled);
|
||||
}
|
||||
|
||||
|
||||
@@ -518,10 +518,6 @@ Config.prototype.buildArgs = function () {
|
||||
args.use_vaapi = true
|
||||
|
||||
}
|
||||
if (this.targetArch === 'arm64') {
|
||||
// We don't yet support Widevine on Arm64 Linux.
|
||||
args.enable_widevine = false
|
||||
}
|
||||
}
|
||||
|
||||
if (['android', 'linux', 'mac'].includes(this.getTargetOS())) {
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
diff --git a/third_party/widevine/cdm/widevine.gni b/third_party/widevine/cdm/widevine.gni
|
||||
index 58f073ca562ca40c3165f4dd0f650dc467b43d5c..735a99c71e5086e146ec0bdbf2090d56bd5f08ca 100644
|
||||
--- a/third_party/widevine/cdm/widevine.gni
|
||||
+++ b/third_party/widevine/cdm/widevine.gni
|
||||
@@ -31,6 +31,7 @@ library_widevine_cdm_available =
|
||||
(target_os == "mac" && (target_cpu == "x64" || target_cpu == "arm64")) ||
|
||||
(target_os == "win" &&
|
||||
(target_cpu == "x86" || target_cpu == "x64" || target_cpu == "arm64"))
|
||||
+if (target_os == "linux") { library_widevine_cdm_available = true } # Let Linux users manually supply Widevine on architectures where it isn't publicly available.
|
||||
|
||||
# Widevine CDM is available as a library CDM and it's supported by Chromium.
|
||||
# This does not define how the CDM will be deployed. It can be bundled or
|
||||
Reference in New Issue
Block a user