Bug 1315850 - Ensure we query for the correct string in HavePluginForKeySystem. r=gerald draft
authorChris Pearce <cpearce@mozilla.com>
Wed, 22 Feb 2017 13:06:58 +1300
changeset 504161 68ce766bede0f5c8e41de3a3f9e46b6ef88cab96
parent 504160 76937006b9e424f2588e7d06f8f7b0c3a68b5af2
child 504162 914db1f04e0770776ae25c7b8bdc59e729fe78d0
push id50748
push userbmo:cpearce@mozilla.com
push dateFri, 24 Mar 2017 01:10:17 +0000
reviewersgerald
bugs1315850
milestone55.0a1
Bug 1315850 - Ensure we query for the correct string in HavePluginForKeySystem. r=gerald Otherwise navigator.requestMediaKeySystemAccess() doesn't know whether we have a CDM or not. MozReview-Commit-ID: Hic6UneGA4u
dom/media/eme/MediaKeySystemAccess.cpp
--- a/dom/media/eme/MediaKeySystemAccess.cpp
+++ b/dom/media/eme/MediaKeySystemAccess.cpp
@@ -94,18 +94,21 @@ MediaKeySystemAccess::CreateMediaKeys(Er
                                        mKeySystem,
                                        mConfig));
   return keys->Init(aRv);
 }
 
 static bool
 HavePluginForKeySystem(const nsCString& aKeySystem)
 {
-  bool havePlugin = HaveGMPFor(NS_LITERAL_CSTRING(GMP_API_DECRYPTOR),
-                               { aKeySystem });
+  nsCString api = MediaPrefs::EMEChromiumAPIEnabled()
+                    ? NS_LITERAL_CSTRING(CHROMIUM_CDM_API)
+                    : NS_LITERAL_CSTRING(GMP_API_DECRYPTOR);
+
+  bool havePlugin = HaveGMPFor(api, { aKeySystem });
 #ifdef MOZ_WIDGET_ANDROID
   // Check if we can use MediaDrm for this keysystem.
   if (!havePlugin) {
     havePlugin = mozilla::java::MediaDrmProxy::IsSchemeSupported(aKeySystem);
   }
 #endif
   return havePlugin;
 }