Bug 1131758 - indicate 64-bit windows or OSX/Linux incompatibilities for Adobe's CDM, r=dolske
authorGijs Kruitbosch <gijskruitbosch@gmail.com>
Mon, 23 Feb 2015 11:51:48 +0000
changeset 250250 529b83aa2c7b
parent 250249 0631cc897937
child 250251 0e44d113855f
push id4526
push usergijskruitbosch@gmail.com
push date2015-03-05 00:08 +0000
treeherdermozilla-beta@0e44d113855f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdolske
bugs1131758
milestone37.0
Bug 1131758 - indicate 64-bit windows or OSX/Linux incompatibilities for Adobe's CDM, r=dolske
browser/base/content/browser-eme.js
browser/base/content/browser-eme.properties
--- a/browser/base/content/browser-eme.js
+++ b/browser/base/content/browser-eme.js
@@ -97,34 +97,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 ?
                   gEMEBundle.getFormattedString(msgId, labelParams) :
                   gEMEBundle.getString(msgId);
 
     let buttons = [];
     if (callback) {
       let btnLabelId = msgPrefix + "button.label";
       let btnAccessKeyId = msgPrefix + "button.accesskey";
--- a/browser/base/content/browser-eme.properties
+++ b/browser/base/content/browser-eme.properties
@@ -16,13 +16,17 @@ emeNotifications.drmContentDisabled.lear
 
 emeNotifications.drmContentCDMNotSupported.message = The audio or video on this page requires DRM software that %1$S does not support. %2$S
 emeNotifications.drmContentCDMNotSupported.learnMoreLabel = Learn More
 
 emeNotifications.drmContentCDMInsufficientVersion.message = %S is installing updates needed to play the audio or video on this page. Please try again later.
 
 emeNotifications.drmContentCDMInstalling.message = %S is installing components needed to play the audio or video on this page. Please try again later.
 
+emeNotifications.drmContentCDMNotSupported.64bit.message = The audio or video on this page requires DRM software that this 64-bit build of %1$S does not support. %2$S
+emeNotifications.drmContentCDMNotSupported.unsupportedOS.message = The audio or video on this page requires DRM software that %1$S does not support on %2$S. %3$S
++
+
 emeNotifications.optionsButton.label = Options
 emeNotifications.optionsButton.accesskey = O
 
 emeNotifications.unknownDRMSoftware = Unknown