Closed Bug 967627 Opened 6 years ago Closed 4 years ago

UX Work - Show which tab in Metro Firefox is playing sound/audio

Categories

(Firefox for Metro Graveyard :: Browser, defect)

x86_64
Windows 8.1
defect
Not set

Tracking

(Not tracked)

RESOLVED INCOMPLETE

People

(Reporter: MarcoM, Unassigned)

References

Details

(Whiteboard: [ux] p=0)

+++ This bug was initially created as a clone of Bug #961202 +++

In desktop Firefox, it's hard to reliably determine which tab is making noise (bug 486262), because the browser doesn't get enough information from NPAPI plugins like Flash.  But since Metro Firefox does not support NPAPI plugins (bug 738600), it doesn't have that problem!

We should add code to determine when a tab uses a feature like <audio> or <video> that can make sounds (including APIs used via Shumway when it's enabled, bug 923596) and display an indicator in the tab bar until it stops.

Bug 923247 will add a notification that is sent by the observer service when media playback starts or stops.  We can add code to browser-ui.js here to observe these notifications and adjust the UI when they occur:
http://hg.mozilla.org/mozilla-central/file/fad7172d4542/browser/metro/base/content/browser-ui.js#l90
http://hg.mozilla.org/mozilla-central/file/fad7172d4542/browser/metro/base/content/browser-ui.js#l582

The observer can then set an attribute on the <documenttab> element corresponding to the appropriate tab, using code that looks something like this:

  case "media-playback": {
    let browser = Browser.getBrowserForWindow(aSubject);
    let tab = Browser.getTabForBrowser(aTab);
    // aData will be either "active" or "inactive":
    tab.chromeTab.setAttribute("media-playback", aData);
  }

...and we can use that attribute to change the appearance of the tab in our CSS stylesheet:
http://hg.mozilla.org/mozilla-central/file/fad7172d4542/browser/metro/theme/browser.css
Yuan/Michael - feel free to rename the summary for this UX design work.
Metro is dead.
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.