NPAPI:AudioControl

From MozillaWiki
Revision as of 23:32, 24 June 2015 by Josh (talk | contribs) (General updates and bool is in pointer value, not pointed to)
Jump to navigation Jump to search

Status

Approved

Contributors

  • Last modified: June 1, 2015
  • Authors: Kyle Huey (Mozilla), Benoit Girard (Mozilla)
  • Contributors: Josh Aas (Mozilla)

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

NPPVpluginIsPlayingAudio = 4000

This NPPVariable, when set via NPN_SetValue, will signal whether or not an instance is currently playing audio. This is done by assigning a BOOL value to NPN_SetValue's pointer value argument (not by pointing to a BOOL, as one might expect).

Mute/Unmute a plugin instance

NPNVmuteAudioBool = 4000

This NPNVariable, when set via NPP_SetValue, will indicate to a plugin whether or not it should mute audio for an instance. This is done by assigning a BOOL value to NPP_SetValue's pointer value argument (not by pointing to a BOOL, as one might expect).