Bug 1146201 - Remove "we can't play EME because..." notifications when we successfully play EME. r=gijs, a=sledru
authorChris Pearce <cpearce@mozilla.com>
Tue, 31 Mar 2015 20:50:01 +1300
changeset 266821 f50fad2de4a63e440894aa88c2539af7586b644d
parent 266820 60a94093038feaae7b94a57e624729fcf477ab4b
child 266822 6f68c7109d952e9a4da4a709691200b5cf321135
push id830
push userraliiev@mozilla.com
push dateFri, 19 Jun 2015 19:24:37 +0000
treeherdermozilla-release@932614382a68 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgijs, sledru
bugs1146201
milestone39.0a2
Bug 1146201 - Remove "we can't play EME because..." notifications when we successfully play EME. r=gijs, a=sledru
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";