Bug 1131758 - Indicate 64-bit windows or OSX/Linux incompatibilities for Adobe's CDM. r=dolske, a=lsblakk
authorGijs Kruitbosch <gijskruitbosch@gmail.com>
Mon, 23 Feb 2015 11:51:48 +0000
changeset 262170 1304475d63b747079a0f46c12f695f3b35884422
parent 262169 12ac5041ad5622a2cf5d3be0f5de20962afedc5f
child 262171 3095f0eb1b3cf308bbb111f5809bd35cef748804
push id1963
push userpaolo.mozmail@amadzone.org
push dateSun, 10 May 2015 10:26:20 +0000
reviewersdolske, lsblakk
bugs1131758
milestone38.0a2
Bug 1131758 - Indicate 64-bit windows or OSX/Linux incompatibilities for Adobe's CDM. r=dolske, a=lsblakk
browser/base/content/browser-eme.js
--- a/browser/base/content/browser-eme.js
+++ b/browser/base/content/browser-eme.js
@@ -84,34 +84,46 @@ let gEMEHandler = {
       case "error":
         // Fall through and do the same for unknown messages:
       default:
         let typeOfIssue = status == "error" ? "error" : "message ('" + status + "')";
         Cu.reportError("Unknown " + typeOfIssue + " dealing with EME key request: " + data);
         return;
     }
 
-    this.showNotificationBar(browser, notificationId, params, buttonCallback);
+    this.showNotificationBar(browser, notificationId, keySystem, params, buttonCallback);
   },
-  showNotificationBar: function(browser, notificationId, labelParams, callback) {
+  showNotificationBar: function(browser, notificationId, keySystem, labelParams, callback) {
     let box = gBrowser.getNotificationBox(browser);
     if (box.getNotificationWithValue(notificationId)) {
       return;
     }
 
     // If the user turned these off, bail out:
     try {
       if (Services.prefs.getBoolPref("browser.eme.ui." + notificationId + ".disabled")) {
         return;
       }
     } catch (ex) { /* Don't care if the pref doesn't exist */ }
 
     let msgPrefix = "emeNotifications." + notificationId + ".";
     let msgId = msgPrefix + "message";
 
+    // Specialcase Adobe's CDM on unsupported platforms to be more informative:
+    if (notificationId == "drmContentCDMNotSupported" &&
+        keySystem.startsWith("com.adobe")) {
+      let os = Services.appinfo.OS.toLowerCase();
+      if (os.startsWith("win") && Services.appinfo.XPCOMABI.startsWith("x86_64")) {
+        msgId = msgPrefix + "64bit.message";
+      } else if (os.startsWith("linux") || os.startsWith("darwin")) {
+        msgId = msgPrefix + "unsupportedOS.message";
+        labelParams.splice(1, 0, os.startsWith("linux") ? "Linux" : "Mac OS X");
+      }
+    }
+
     let message = labelParams.length ?
                   gNavigatorBundle.getFormattedString(msgId, labelParams) :
                   gNavigatorBundle.getString(msgId);
 
     let buttons = [];
     if (callback) {
       let btnLabelId = msgPrefix + "button.label";
       let btnAccessKeyId = msgPrefix + "button.accesskey";