NPAPI:AudioControl

From MozillaWiki
Revision as of 15:44, 14 August 2011 by Khuey (talk | contribs) (Created page with "= Status = Drafting. = Contributors = * Last modified: August 14, 2011 * Authors: Kyle Huey (Mozilla) * Contributors: = Use case = The ability to mute/unmute tabs or determ...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Status

Drafting.

Contributors

  • Last modified: August 14, 2011
  • Authors: Kyle Huey (Mozilla)
  • Contributors:

Use case

The ability to mute/unmute tabs or determine which tabs are playing audio is a commonly requested feature in web browsers. This specification allows browsers to mute/unmute instances of cooperating plugins and determine which instances are playing audio. Browsers can use these APIs to implement per-tab audio control.

Proposed Specification

Determine if an instance is playing audio

NPBool NPP_IsInstancePlayingAudio(NPP instance);

This function returns TRUE if the plugin instance 'instance' is currently playing audio and FALSE if the plugin instance 'instance' is not. This function may only be called when at least one instance of a plugin has been created and not destroyed and 'instance' must be a live plugin instance when called.

Mute/Unmute a plugin instance

NPError NPP_MuteInstance(NPP instance);
NPError NPP_UnmuteInstance(NPP instance);

These functions mute or unmute (respectively) the plugin instance 'instance'. These functions may only be called when at least one instance of a plugin has been created and not destroyed and 'instance' must be a live plugin instance when called.

Open issues

  • Should we condense NPP_[Mute|Unmute]Instance into a single function taking a boolean mute/unmute argument?
  • Will we want to be able to control the volume level on a per instance basis?