From 0cebc574fe8b6e0724c6f8b80a19fd69a2845fb8 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Thu, 28 Apr 2016 11:31:47 +0200 Subject: [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 --- src/core/content_client_qt.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/core/content_client_qt.cpp') 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* 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 -- cgit v1.2.3