Bug 1146201 - Remove "we can't play EME because..." notifications when we successfully play EME. r=gijs a=sylvestre
authorChris Pearce <cpearce@mozilla.com>
Tue, 31 Mar 2015 20:50:01 +1300
changeset 258238 7a04aad0ab5d
parent 258237 9383010b69fe
child 258239 c481e8a84a6c
push id4625
push usercpearce@mozilla.com
push date2015-04-03 06:37 +0000
treeherdermozilla-beta@c481e8a84a6c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgijs, sylvestre
bugs1146201
milestone38.0
Bug 1146201 - Remove "we can't play EME because..." notifications when we successfully play EME. r=gijs a=sylvestre
browser/base/content/browser-eme.js
--- a/browser/base/content/browser-eme.js
+++ b/browser/base/content/browser-eme.js
@@ -150,16 +150,28 @@ let gEMEHandler = {
     while (descriptionContainer.childNodes.length) {
       fragment.appendChild(descriptionContainer.childNodes[0]);
     }
 
     box.appendNotification(fragment, notificationId, iconURL, box.PRIORITY_WARNING_MEDIUM,
                            buttons);
   },
   showPopupNotificationForSuccess: function(browser, keySystem) {
+    // We're playing EME content! Remove any "we can't play because..." messages.
+    var box = gBrowser.getNotificationBox(browser);
+    ["drmContentDisabled",
+     "drmContentCDMNotSupported",
+     "drmContentCDMInsufficientVersion",
+     "drmContentCDMInstalling"
+     ].forEach(function (value) {
+        var notification = box.getNotificationWithValue(value);
+        if (notification)
+          box.removeNotification(notification);
+      });
+
     // Don't bother creating it if it's already there:
     if (PopupNotifications.getNotification("drmContentPlaying", browser)) {
       return;
     }
 
     let msgPrefix = "emeNotifications.drmContentPlaying.";
     let msgId = msgPrefix + "message2";
     let btnLabelId = msgPrefix + "button.label";