summaryrefslogtreecommitdiffstats
path: root/src/core/content_client_qt.cpp
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@theqtcompany.com>2016-04-28 11:31:47 +0200
committerAlexandru Croitor <alexandru.croitor@theqtcompany.com>2016-04-28 11:06:12 +0000
commit0cebc574fe8b6e0724c6f8b80a19fd69a2845fb8 (patch)
tree4c74ed355b2951c218a02eb56bd805ca3846dd6d /src/core/content_client_qt.cpp
parent59ba09bdb191888ea21aafcf90e576bfb3e7406c (diff)
[OSX] Try and load the widevine plugin where Chrome looks for it.
Chrome usually installs the widevine plugin into the /Library/Application Support/Google/Chrome/WidevineCDM directory. Try and load it from that location, so it doesn't have to be specified on the command line. Change-Id: Idb14ae677112f16c853bdc5d1ae700a75a735ebf Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
Diffstat (limited to 'src/core/content_client_qt.cpp')
-rw-r--r--src/core/content_client_qt.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/core/content_client_qt.cpp b/src/core/content_client_qt.cpp
index 7fc6556fb..fc9a2a283 100644
--- a/src/core/content_client_qt.cpp
+++ b/src/core/content_client_qt.cpp
@@ -184,6 +184,17 @@ void AddPepperWidevine(std::vector<content::PepperPluginInfo>* plugins)
pluginPaths << QtWebEngineCore::toQt(widevine_argument);
else {
pluginPaths << ppapiPluginsPath() + QStringLiteral("/") + QString::fromLatin1(kWidevineCdmAdapterFileName);
+#if defined(Q_OS_OSX)
+ QDir potentialWidevineDir(QDir::homePath() + "/Library/Application Support/Google/Chrome/WidevineCDM");
+ if (potentialWidevineDir.exists()) {
+ QFileInfoList widevineVersionDirs = potentialWidevineDir.entryInfoList(QDir::Dirs | QDir::NoDotAndDotDot, QDir::Name | QDir::Reversed);
+ for (int i = 0; i < widevineVersionDirs.size(); ++i) {
+ QString versionDirPath(widevineVersionDirs.at(i).absoluteFilePath());
+ QString potentialWidevinePluginPath = versionDirPath + "/_platform_specific/mac_x64/" + QString::fromLatin1(kWidevineCdmAdapterFileName);
+ pluginPaths << potentialWidevinePluginPath;
+ }
+ }
+#endif
#if defined(Q_OS_LINUX)
pluginPaths << QStringLiteral("/opt/google/chrome/libwidevinecdmadapter.so") // Google Chrome
<< QStringLiteral("/usr/lib/chromium/libwidevinecdmadapter.so"); // Arch